网关〔paypal〕不支持方法〔create〕


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

我遵循了这个教程。我试着将贝宝整合到我的网站中。我的目的是允许用户使用贝宝通过捐赠按钮向另一个用户汇款。我的配置:

      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' => ''
        )
    )
)

);

但当我调用$gateway = Omnipay::create('PayPal_Express');时,我得到了这个错误:

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

我该如何纠正这里的问题,在调用create函数之前,是否需要进行任何配置?有什么方法可以将Laravel中的贝宝支付集成到我的网站中吗?

实际上,在进入控制器类之前,我忘记了调用:use Omnipay'Omnipay;。现在它起作用了。

我认为应该是$gateway=GatewayFactory::create('PayPal_Express');