php - Transaction id is invalid 10609

Solution:
Two things:
First, in paypal_pay_redirect.php, addPAYMENTREQUEST_0_PAYMENTACTION => 'Authorization'
to$orderParams
.
Second, in paypal_success.php, changePAYMENTACTION
TOPAYMENTREQUEST_0_PAYMENTACTION
.
Here's why:
In your SetExpressCheckout call, if you don't setPAYMENTREQUEST_0_PAYMENTACTION
, PayPal assumes that it will beSale
. And if this is set toSale
in your SetExpressCheckout call, then PayPal will only allow you to set it toSale
on your DoExpressCheckoutPayment call.
Additionally, in your DoExpressCheckoutPayment call, you're mixing new and old-style variable names. (Some variables, such asPAYMENTACTION
, were renamed when PayPal introduced parallel payments for Express Checkout.PAYMENTACTION
is the old style;PAYMENTREQUEST_0_PAYMENTACTION
is the new style.) When you mix old-style and new-style names like this, PayPal recognizes variables using one style, and ignores the other. In your case,PAYMENTREQUEST_0_AMT
andPAYMENTREQUEST_0_CURRENCYCODE
are being recognized, butPAYMENTACTION
is being ignored.
The combination of these two factors means that your transaction is most likely being run as a Sale transaction, not an Authorization. Since you can't capture against a Sale transaction (since it's technically already captured), PayPal responds by saying that the transaction ID is invalid.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: composer detected issues in your platform: your composer dependencies require a php version ">= 8.0.2".
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.