0

According to the documentation, this is the example code I used to make the payment.

$paymentMethod = $_POST['paymentMethodId'];

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

But it gives me a validation error:

Omnipay stripe error

How can I solve this?

A.Seddighi
  • 1,695
  • 1
  • 20
  • 43
Dasun Tharanga
  • 163
  • 1
  • 11
  • Did you try 'source' => $paymentMethod, – Pathum Bandara Feb 19 '23 at 02:20
  • If `paymentMethod` is set, the value should start with `pm_xxx`. If the value of your payment method starts with `tok_xxx`, then [`source`](https://stripe.com/docs/api/charges/create#create_charge-source) parameter should be used instead according to omnipay's [doc](https://github.com/thephpleague/omnipay-stripe#stripe-payment-intents). – yuting Feb 20 '23 at 01:05

0 Answers0