1

I've been getting this error from omnipay bridge whenever I try to capture credit card payment:

Credit card details has to be set explicitly or there has to be an action that supports ObtainCreditCard request.

Here's my code:

//...
$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
}
//...

The ->execute() function is the one that throws an error. I also referred to the same issue from Error: Credit card details has to be set explicitly or there has to be an action that supports ObtainCreditCard request.

Community
  • 1
  • 1
user1240207
  • 217
  • 1
  • 3
  • 13
  • Why do you create a new payum builder instead of using the one from laravel package. The one from package have some additional stuff set (like obtain credit card action). – Maksim Kotlyar Mar 17 '16 at 18:01

1 Answers1

0

Why do you create a new payum builder instead of using the one from laravel package. The one from package have some additional stuff set (like obtain credit card action).

Accoding to the docs you should do something like this

App::resolving('payum.builder', function(\Payum\Core\PayumBuilder $payumBuilder) {
    $payumBuilder
        ->addGateway('paymentexpress_pxpost', [
            'factory' => 'omnipay_paymentexpress_pxpost', 
            'username' => 'some_username',
            'password'=>'some_password'
        ])
    ;
});
Maksim Kotlyar
  • 3,821
  • 27
  • 31
  • Update: I'm now using the pxpay instead of pxpost. I've added that in the provider. And ran into a new issue. InvalidArgumentException in HttpRedirect.php line 41: Cannot redirect to an empty URL.. Seems like it's not genarating a correct URL though the payum tokens are generated. – user1240207 Mar 18 '16 at 00:25
  • maybe a bug in the paymentexpress omnipay extension? – Maksim Kotlyar Mar 30 '16 at 08:17