【发布时间】:2016-07-01 19:14:21
【问题描述】:
每当我尝试获取信用卡付款时,我都会从 omnipay 桥接器收到此错误:
Credit card details has to be set explicitly or there has to be an action that supports ObtainCreditCard request.
这是我的代码:
//...
$payum = (new PayumBuilder())
->addDefaultStorages()
->addGateway('paymentexpress_pxpost', ['factory' => 'omnipay_paymentexpress_pxpost', 'username' => 'some_username', 'password'=>'some_password'])
->getPayum();
$card = [
'number' => $request->input('cc_number'),
'expiryMonth' => $request->input('expiry_month'),
'expiryYear' => $request->input('expiry_year'),
'cvv' => $request->input('cvv'),
'name' => $request->input('card_name')
];
$payment = new ArrayObject(['amount' => '1.00', 'currency' => 'AUD', 'card' => $card]);
if ($reply = $payum->getGateway('paymentexpress_pxpost')->execute(new Capture($payment), true)) {
// convert reply to http response
}
//...
->execute() 函数是引发错误的函数。我也从Error: Credit card details has to be set explicitly or there has to be an action that supports ObtainCreditCard request 提到了同样的问题。
【问题讨论】:
-
你为什么要创建一个新的 payum 构建器而不是使用 laravel 包中的那个。包装中的那个有一些额外的东西设置(比如获取信用卡操作)。
标签: laravel payment-gateway omnipay payum