2

I followed thistutorial. I tried to integrate the paypal into my website. My purpose is to allow to user to send money to another user via a donation button using paypal. my configuration :

      return array(

// The default gateway to use
'default' => 'paypal',

// Add in each gateway here
'gateways' => array(
    'paypal' => array(
        'driver' => 'PayPal_Express',
        'options' => array(
            'solutionType' => '',
            'landingPage' => '',
            'headerImageUrl' => ''
        )
    )
)

);

But when I call $gateway = Omnipay::create('PayPal_Express'); I get this error:

BadMethodCallException

Method [create] is not supported by the gateway [paypal].

How can I correct the problem here,is there any configuration I have to make before calling the create function? Is there any way to integrate paypal payment in Laravel into my website?

Dev DOS
  • 1,018
  • 4
  • 18
  • 45

2 Answers2

2

Actually I forget to call : use Omnipay\Omnipay; before getting into my controller class. Now it works.

Dev DOS
  • 1,018
  • 4
  • 18
  • 45
0

I believe it should be $gateway = GatewayFactory::create('PayPal_Express');

Mihai P.
  • 9,307
  • 3
  • 38
  • 49