Dev DOS
Dev DOS

Reputation: 1068

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

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?

Upvotes: 2

Views: 464

Answers (2)

Dev DOS
Dev DOS

Reputation: 1068

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

Upvotes: 2

Mihai P.
Mihai P.

Reputation: 9357

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

Upvotes: 0

Related Questions