From b166372d8dad8a088df370bcc3fe9986c38733d0 Mon Sep 17 00:00:00 2001 From: Rich Lott / Artful Robot <forums@artfulrobot.uk> Date: Mon, 8 Mar 2021 17:33:39 +0000 Subject: [PATCH] move IpnTest to using stripeClient --- tests/phpunit/CRM/Stripe/BaseTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/CRM/Stripe/BaseTest.php b/tests/phpunit/CRM/Stripe/BaseTest.php index 291038c0..c7242fb3 100644 --- a/tests/phpunit/CRM/Stripe/BaseTest.php +++ b/tests/phpunit/CRM/Stripe/BaseTest.php @@ -100,6 +100,8 @@ class CRM_Stripe_BaseTest extends \PHPUnit\Framework\TestCase implements Headles $this->paymentProcessor = $processor; $this->paymentProcessorID = $result['id']; $this->paymentObject = new CRM_Core_Payment_Stripe('test' /*mode*/, $this->paymentProcessor); + // Set params, creates stripeClient + $this->paymentObject->setAPIParams(); } /** @@ -107,10 +109,8 @@ class CRM_Stripe_BaseTest extends \PHPUnit\Framework\TestCase implements Headles */ public function doPayment($params = []) { - \Stripe\Stripe::setApiKey(CRM_Core_Payment_Stripe::getSecretKey($this->paymentProcessor)); - - // Send in credit card to get payment method. - $paymentMethod = \Stripe\PaymentMethod::create([ + // Send in credit card to get payment method. xxx mock here + $paymentMethod = $this->paymentObject->stripeClient->paymentMethods->create([ 'type' => 'card', 'card' => [ 'number' => $this->cc, -- GitLab