Skip to content
Snippets Groups Projects
Commit 8b03c0ad authored by mattwire's avatar mattwire
Browse files

Update tests to use StripePaymentintent.ProcessPublic instead of (deleted)...

Update tests to use StripePaymentintent.ProcessPublic instead of (deleted) API3 StripePaymentintent.process
parent b18077fe
No related branches found
No related tags found
No related merge requests found
......@@ -402,9 +402,20 @@ abstract class CRM_Stripe_BaseTest extends \PHPUnit\Framework\TestCase implement
'description' => NULL,
'csrfToken' => $firewall->generateCSRFToken(),
];
$result = civicrm_api3('StripePaymentintent', 'process', $paymentIntentParams);
$paymentIntentID = $result['values']['paymentIntent']['id'];
$result = \Civi\Api4\StripePaymentintent::processPublic(TRUE)
->setPaymentMethodID($paymentMethod->id)
->setAmount($this->total)
->setPaymentProcessorID($this->paymentProcessorID)
->setIntentID($params['paymentIntentID'] ?? NULL)
->setDescription(NULL)
->setCsrfToken($firewall->generateCSRFToken())
->execute();
// $result = civicrm_api3('StripePaymentintent', 'process', $paymentIntentParams);
if (empty($result['success'])) {
throw new CRM_Core_Exception('StripePaymentintent::processPublic did not return success');
}
$paymentIntentID = $result['paymentIntent']['id'];
}
else {
$paymentMethodID = $paymentMethod->id;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment