In the capturePayment(), voidPayment(), refundPayment() methods we have the following code:
$remote_id = $payment->getRemoteId();
$intent = NULL;
if (strpos($remote_id, "pi_") === 0) {
$intent = PaymentIntent::retrieve($remote_id);
$intent_id = $intent->id;
}
else {
$charge = Charge::retrieve($remote_id);
$intent_id = $charge->payment_intent;
}
It should be updated to use only the PaymentIntent ID as we always save it for the payment remoteId.
Issue fork commerce_stripe-3390553
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
jsacksick commentedNo, you shouldn't do that.
Comment #3
jsacksick commentedTake a look at this: https://stripe.com/docs/payments/payment-intents/migration/charges
This is the reason why the current gateway uses the payment intent ID as the remote ID.
Comment #4
vmarchukAs discussed with @jsacksick, the above code has been added to support legacy payments (with stored charge ID) and to support new payments that use PaymentIntent ID as the remote ID.
The old issue is here https://www.drupal.org/project/commerce_stripe/issues/3185801.
So after implementing https://www.drupal.org/project/commerce_stripe/issues/3390551 we only need to use code with PaymentIntent ID.
Comment #7
vmarchukCommitted!