From 5362ea5d974f44d0581d2c20f208632ee30cfaf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benoi=CC=82t=20Rouleau?= Date: Mon, 8 Jun 2020 19:24:58 -0400 Subject: [PATCH] Wrap every call to $this->merchantAccountId in Craft::parseEnv() --- src/gateways/Gateway.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gateways/Gateway.php b/src/gateways/Gateway.php index 5e3f6b5..538bba7 100644 --- a/src/gateways/Gateway.php +++ b/src/gateways/Gateway.php @@ -173,7 +173,7 @@ public function getSettingsHtml() if ($paymentForm && $paymentForm->hasProperty('nonce') && $paymentForm->nonce) { $request['token'] = $paymentForm->nonce; } - $request['merchantAccountId'] = $this->merchantAccountId[$request['currency']]; + $request['merchantAccountId'] = Craft::parseEnv($this->merchantAccountId[$request['currency']]); //Craft::dd($request); }*/ @@ -313,7 +313,7 @@ public function purchase(Transaction $transaction, BasePaymentForm $form): Reque $data['paymentMethodToken'] = $form->token; } if (isset($this->merchantAccountId[$transaction->currency]) && !empty($this->merchantAccountId[$transaction->currency])) { - $data['merchantAccountId'] = $this->merchantAccountId[$transaction->currency]; + $data['merchantAccountId'] = Craft::parseEnv($this->merchantAccountId[$transaction->currency]); } else { $data['merchantAccountId'] = ""; $data['amount'] = $transaction->amount; @@ -526,7 +526,7 @@ public function subscribe(User $user, BasePlan $plan, SubscriptionForm $paramete 'paymentMethodToken' => $source->token, 'planId' => $plan->reference, 'price' => $plan->price, - 'merchantAccountId' => $this->merchantAccountId[$plan->getCurrency()], + 'merchantAccountId' => Craft::parseEnv($this->merchantAccountId[$plan->getCurrency()]), ]; $response = $this->createSubscription($data);