Skip to content

Commit 2cd0396

Browse files
committed
Merge branch 'MAG-905' into v4.1.3
2 parents b6dd2d4 + dcf9304 commit 2cd0396

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

lib/Models/Payment/Authorizenet.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class Authorizenet extends AbstractGateway
88
{
9-
protected $response = '';
9+
protected $response = [];
1010

1111
/**
1212
* @var string[]
@@ -22,7 +22,7 @@ class Authorizenet extends AbstractGateway
2222
*/
2323
public function fetchData($transactionId, $orderId)
2424
{
25-
if (empty($this->response)) {
25+
if (isset($this->response[$orderId]) === false) {
2626
$request = [
2727
"getTransactionDetailsRequest" => [
2828
"merchantAuthentication" => [
@@ -52,15 +52,15 @@ public function fetchData($transactionId, $orderId)
5252
$response = curl_exec($curl);
5353

5454
$info = json_decode(preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $response), true);
55-
$this->response = new \Signifyd\Models\Payment\Response\Authorizenet();
55+
$this->response[$orderId] = new \Signifyd\Models\Payment\Response\Authorizenet();
5656

5757
if (isset($info['transaction']) &&
5858
isset($info['transaction']['billTo']) &&
5959
isset($info['transaction']['billTo']['firstName']) &&
6060
isset($info['transaction']['billTo']['lastName'])
6161
) {
6262
$holderName = $info['transaction']['billTo']['firstName'] . " " . $info['transaction']['billTo']['lastName'];
63-
$this->response->setCardholder($holderName);
63+
$this->response[$orderId]->setCardholder($holderName);
6464
}
6565

6666
if (isset($info['transaction']) &&
@@ -69,24 +69,24 @@ public function fetchData($transactionId, $orderId)
6969
isset($info['transaction']['payment']['creditCard']['cardNumber'])
7070
) {
7171
$last4 = substr($info['transaction']['payment']['creditCard']['cardNumber'], -4);
72-
$this->response->setLast4($last4);
72+
$this->response[$orderId]->setLast4($last4);
7373
}
7474

7575
if (isset($info['transaction']) &&
7676
isset($info['transaction']['AVSResponse'])
7777
) {
7878
$avs = $info['transaction']['AVSResponse'];
79-
$this->response->setAvs($avs);
79+
$this->response[$orderId]->setAvs($avs);
8080
}
8181

8282
if (isset($info['transaction']) &&
8383
isset($info['transaction']['cardCodeResponse'])
8484
) {
8585
$cvv = $info['transaction']['cardCodeResponse'];
86-
$this->response->setCvv($cvv);
86+
$this->response[$orderId]->setCvv($cvv);
8787
}
8888
}
8989

90-
return $this->response;
90+
return $this->response[$orderId];
9191
}
9292
}

lib/Models/Payment/Braintree.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class Braintree extends \Signifyd\Models\Payment\AbstractGateway
88
{
9-
protected $response = '';
9+
protected $response = [];
1010

1111
/**
1212
* @var string[]
@@ -23,7 +23,7 @@ class Braintree extends \Signifyd\Models\Payment\AbstractGateway
2323
*/
2424
public function fetchData($transactionId, $orderId)
2525
{
26-
if (empty($this->response)) {
26+
if (isset($this->response[$orderId]) === false) {
2727
$requestArr = [
2828
'query' => 'query Search($input: PaymentSearchInput!) {
2929
search {
@@ -93,7 +93,7 @@ public function fetchData($transactionId, $orderId)
9393
curl_close($ch);
9494

9595
$info = json_decode(preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $serverOutput), true);
96-
$this->response = new BraintreeResponse();
96+
$this->response[$orderId] = new BraintreeResponse();
9797

9898
if (isset($info['data']) &&
9999
isset($info['data']['search']) &&
@@ -105,7 +105,7 @@ public function fetchData($transactionId, $orderId)
105105
isset($info['data']['search']['payments']['edges'][0]['node']['paymentMethodSnapshot']['last4'])
106106
) {
107107
$last4 = $info['data']['search']['payments']['edges'][0]['node']['paymentMethodSnapshot']['last4'];
108-
$this->response->setLast4($last4);
108+
$this->response[$orderId]->setLast4($last4);
109109
}
110110

111111
if (isset($info['data']) &&
@@ -119,7 +119,7 @@ public function fetchData($transactionId, $orderId)
119119

120120
) {
121121
$bin = $info['data']['search']['payments']['edges'][0]['node']['paymentMethodSnapshot']['bin'];
122-
$this->response->setBin($bin);
122+
$this->response[$orderId]->setBin($bin);
123123
}
124124

125125
if (isset($info['data']) &&
@@ -133,7 +133,7 @@ public function fetchData($transactionId, $orderId)
133133

134134
) {
135135
$expirationMonth = $info['data']['search']['payments']['edges'][0]['node']['paymentMethodSnapshot']['expirationMonth'];
136-
$this->response->setExpiryMonth($expirationMonth);
136+
$this->response[$orderId]->setExpiryMonth($expirationMonth);
137137
}
138138

139139
if (isset($info['data']) &&
@@ -147,7 +147,7 @@ public function fetchData($transactionId, $orderId)
147147

148148
) {
149149
$expirationYear = $info['data']['search']['payments']['edges'][0]['node']['paymentMethodSnapshot']['expirationYear'];
150-
$this->response->setExpiryYear($expirationYear);
150+
$this->response[$orderId]->setExpiryYear($expirationYear);
151151
}
152152

153153
if (isset($info['data']) &&
@@ -160,7 +160,7 @@ public function fetchData($transactionId, $orderId)
160160
isset($info['data']['search']['payments']['edges'][0]['node']['paymentMethodSnapshot']['cardholderName'])
161161
) {
162162
$cardholderName = $info['data']['search']['payments']['edges'][0]['node']['paymentMethodSnapshot']['cardholderName'];
163-
$this->response->setCardholder($cardholderName);
163+
$this->response[$orderId]->setCardholder($cardholderName);
164164
}
165165

166166
if (isset($info['data']) &&
@@ -175,7 +175,7 @@ public function fetchData($transactionId, $orderId)
175175
isset($info['data']['search']['payments']['edges'][0]['node']['statusHistory'][0]['processorResponse']['cvvResponse'])
176176
) {
177177
$cvvResponse = $info['data']['search']['payments']['edges'][0]['node']['statusHistory'][0]['processorResponse']['cvvResponse'];
178-
$this->response->setCvv($cvvResponse);
178+
$this->response[$orderId]->setCvv($cvvResponse);
179179
}
180180

181181
if (isset($info['data']) &&
@@ -193,10 +193,10 @@ public function fetchData($transactionId, $orderId)
193193
$avsPostalCodeResponse = $info['data']['search']['payments']['edges'][0]['node']['statusHistory'][0]['processorResponse']['avsPostalCodeResponse'];
194194
$avsStreetAddressResponse = $info['data']['search']['payments']['edges'][0]['node']['statusHistory'][0]['processorResponse']['avsStreetAddressResponse'];
195195

196-
$this->response->setAvsResponse($avsPostalCodeResponse, $avsStreetAddressResponse);
196+
$this->response[$orderId]->setAvsResponse($avsPostalCodeResponse, $avsStreetAddressResponse);
197197
}
198198
}
199199

200-
return $this->response;
200+
return $this->response[$orderId];
201201
}
202202
}

0 commit comments

Comments
 (0)