Skip to content
Snippets Groups Projects
Commit 46aaebe1 authored by Rich's avatar Rich Committed by mattwire
Browse files

payment method id is not required when passing in an existing payment intent

parent 81c4bb8a
No related branches found
No related tags found
No related merge requests found
...@@ -16,7 +16,7 @@ class CRM_Stripe_AJAX { ...@@ -16,7 +16,7 @@ class CRM_Stripe_AJAX {
* @throws \CiviCRM_API3_Exception * @throws \CiviCRM_API3_Exception
*/ */
public static function confirmPayment() { public static function confirmPayment() {
$paymentMethodID = CRM_Utils_Request::retrieveValue('payment_method_id', 'String', NULL, TRUE); $paymentMethodID = CRM_Utils_Request::retrieveValue('payment_method_id', 'String');
$paymentIntentID = CRM_Utils_Request::retrieveValue('payment_intent_id', 'String'); $paymentIntentID = CRM_Utils_Request::retrieveValue('payment_intent_id', 'String');
$amount = CRM_Utils_Request::retrieveValue('amount', 'Money', NULL, TRUE); $amount = CRM_Utils_Request::retrieveValue('amount', 'Money', NULL, TRUE);
$currency = CRM_Utils_Request::retrieveValue('currency', 'String', CRM_Core_Config::singleton()->defaultCurrency); $currency = CRM_Utils_Request::retrieveValue('currency', 'String', CRM_Core_Config::singleton()->defaultCurrency);
...@@ -26,9 +26,7 @@ class CRM_Stripe_AJAX { ...@@ -26,9 +26,7 @@ class CRM_Stripe_AJAX {
if ($paymentIntentID) { if ($paymentIntentID) {
$intent = \Stripe\PaymentIntent::retrieve($paymentIntentID); $intent = \Stripe\PaymentIntent::retrieve($paymentIntentID);
$intent->confirm([ $intent->confirm();
'payment_method' => $paymentMethodID,
]);
} }
else { else {
try { try {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment