Skip to content

Commit

Permalink
Merge pull request webdna#30 from benface/benface/parse-env
Browse files Browse the repository at this point in the history
Wrap every call to $this->merchantAccountId in Craft::parseEnv()
  • Loading branch information
samuelbirch authored Jun 23, 2020
2 parents 664426a + 5362ea5 commit 18564c5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gateways/Gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}*/

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -530,7 +530,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);
Expand Down

0 comments on commit 18564c5

Please sign in to comment.