0

I have two questions One: What values can we send to Stripe using Omnipay authorize(), example below is only sending amount and description

$response = $gateway->authorize([
     'amount'                   => '10.00',
     'currency'                 => 'USD',
     'description'              => 'This is a test purchase transaction.',
     'paymentMethod'            => $paymentMethod,
     'returnUrl'                => $completePaymentUrl,
     'confirm'                  => true,
 ])->send();

what if we want name and email to be sent, how can we achieve this also

Two: the payment intent we get back from the above request, is generating error log on Godaddy server, I am using the following code;

$paymentIntentReference = $response->getPaymentIntentReference();
$response = $gateway->confirm([
    'paymentIntentReference' => $paymentIntentReference,
    'returnUrl' => $completePaymentUrl,
])->send();

error log: PHP Fatal error: Uncaught Omnipay\Common\Exception\InvalidRequestException: The paymentIntentReference parameter is required

by my confusion is that in spite of this error log the payment process is being complete, so should I worry about this error or not,

and I hope this time I asked my question in the right manner

thanks in advance

Yaser
  • 15
  • 3
  • According to the error, the $paymentIntentReference looks like undefined. You need to check why $response->getPaymentIntentReference() is sending undefined value. Otherwise, Why are you using Omnipay, is there any particular requirement? you can use just Stripe PHP library to achieve this and by sending the Customer details (email, name..) https://stripe.com/docs/api/customers/create?lang=php Here is Stripe official PHP library: https://github.com/stripe/stripe-php You can find a complete payment example here: https://stripe.com/docs/payments/quickstart?client=html&lang=php&platform=web – os4m37 Dec 12 '22 at 13:39
  • I tried looking up this payment intent issue, but couldn't find any way to debug it me being a newbie, Client requirement is to use card data directly on checkout page , not direct to stripe website for payment processing like this https://i.imgur.com/o5RC8RV.png – Yaser Dec 12 '22 at 13:42
  • Yes, you can use Stripe Elements/Cards, by including the cards details input in yout checkout page. https://stripe.com/docs/payments/elements https://stripe.com/docs/payments/accept-card-payments?platform=web&ui=elements – os4m37 Dec 12 '22 at 14:05

0 Answers0