omnipay icon indicating copy to clipboard operation
omnipay copied to clipboard

PayU Issue : Call to a member function getBillingLastName() on null

Open ridislam opened this issue 8 years ago • 1 comments
trafficstars

$gateway = Omnipay::create('PayU'); $gateway->setMerchantId('JBZaLc'); $gateway->setSecretKey('GQs7yium'); $gateway->setTestMode(true);

              $params = [
                    'txnid'       => 'A_UNIQUE_TRANSACTION_ID',
                    'amount'      => 10.50,
                    'productinfo' => 'A book',
                    'firstname'   => 'Peter',
                    'email'       => '[email protected]',
                    'phone'       => '1234567890',
                    'returnUrl'        => route('invoice.cancel', $invoice->id),
                    'cancelUrl'        => route('invoice.success', $invoice->id),
                ];
         $gateway->purchase($params)->send();

                if ($response->isSuccessful()) {

// // payment was successful: update database dd("ok"); } elseif ($response->isRedirect()) { // redirect to offsite payment gateway $response->redirect(); } else { // payment failed: display message to customer echo $response->getMessage(); }

ridislam avatar Jan 19 '17 20:01 ridislam

It's not clear from the above exactly where that happened.

The getBillingLastName() function is in the CreditCard class. Maybe a null card object is being used?

Also this is a problem with the gateway that you're using, not omnipay itself. Which fork of the PayU gateway are you using? Best raise this issue there.

delatbabel avatar Feb 07 '17 01:02 delatbabel