Skip to content
Snippets Groups Projects
Commit 0f4a5fe9 authored by mattwire's avatar mattwire
Browse files

Fix 'DirectTest'

parent 6bbfe205
No related branches found
No related tags found
1 merge request!176Release 6.7
...@@ -171,6 +171,7 @@ function civicrm_api3_stripe_paymentintent_process($params) { ...@@ -171,6 +171,7 @@ function civicrm_api3_stripe_paymentintent_process($params) {
_civicrm_api3_stripe_paymentintent_returnInvalid(); _civicrm_api3_stripe_paymentintent_returnInvalid();
} }
$referrer = $_SERVER['HTTP_REFERER'] ?? '';
$title = CRM_Utils_Type::validate($params['description'], 'String'); $title = CRM_Utils_Type::validate($params['description'], 'String');
$intentParams['confirm'] = TRUE; $intentParams['confirm'] = TRUE;
$currency = CRM_Utils_Type::validate($params['currency'], 'String', CRM_Core_Config::singleton()->defaultCurrency); $currency = CRM_Utils_Type::validate($params['currency'], 'String', CRM_Core_Config::singleton()->defaultCurrency);
...@@ -227,7 +228,7 @@ function civicrm_api3_stripe_paymentintent_process($params) { ...@@ -227,7 +228,7 @@ function civicrm_api3_stripe_paymentintent_process($params) {
'payment_processor_id' => $paymentProcessorID, 'payment_processor_id' => $paymentProcessorID,
'status' => 'failed', 'status' => 'failed',
'description' => "{$e->getRequestId()};{$e->getMessage()};{$title}", 'description' => "{$e->getRequestId()};{$e->getMessage()};{$title}",
'referrer' => $_SERVER['HTTP_REFERER'], 'referrer' => $referrer,
]; ];
isset($params['extra_data']) ? $stripePaymentintentParams['extra_data'] = $params['extra_data'] : NULL; isset($params['extra_data']) ? $stripePaymentintentParams['extra_data'] = $params['extra_data'] : NULL;
CRM_Stripe_BAO_StripePaymentintent::create($stripePaymentintentParams); CRM_Stripe_BAO_StripePaymentintent::create($stripePaymentintentParams);
...@@ -251,7 +252,7 @@ function civicrm_api3_stripe_paymentintent_process($params) { ...@@ -251,7 +252,7 @@ function civicrm_api3_stripe_paymentintent_process($params) {
'payment_processor_id' => $paymentProcessorID, 'payment_processor_id' => $paymentProcessorID,
'status' => $intent->status, 'status' => $intent->status,
'description' => "{$title}", 'description' => "{$title}",
'referrer' => $_SERVER['HTTP_REFERER'], 'referrer' => $referrer,
]; ];
isset($params['extra_data']) ? $stripePaymentintentParams['extra_data'] = $params['extra_data'] : NULL; isset($params['extra_data']) ? $stripePaymentintentParams['extra_data'] = $params['extra_data'] : NULL;
CRM_Stripe_BAO_StripePaymentintent::create($stripePaymentintentParams); CRM_Stripe_BAO_StripePaymentintent::create($stripePaymentintentParams);
......
...@@ -197,7 +197,7 @@ class CRM_Stripe_BaseTest extends \PHPUnit\Framework\TestCase implements Headles ...@@ -197,7 +197,7 @@ class CRM_Stripe_BaseTest extends \PHPUnit\Framework\TestCase implements Headles
$processor->setAPIParams(); $processor->setAPIParams();
try { try {
$processor->stripeClient->charges->retrieve(["id" => $this->trxn_id]); $processor->stripeClient->charges->retrieve($this->trxn_id);
$found = TRUE; $found = TRUE;
} }
catch (Exception $e) { catch (Exception $e) {
......
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