Skip to content

Commit f669412

Browse files
author
has.well
committed
WD-314
1 parent ed24c73 commit f669412

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

Api/Token.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,7 @@ public function getToken($cartId, $method, $customerData)
115115
}
116116
$addData = $cart->getQuote()->getBillingAddress()->getData();
117117
$addInfo = [
118-
'firstname' => isset($addData['firstname']) ? $addData['firstname'] : '',
119-
'middlename' => isset($addData['middlename']) ? $addData['middlename'] : '',
120-
'lastname' => isset($addData['lastname']) ? $addData['lastname'] : '',
118+
'customer_name' => $addData['firstname'] . ' ' . $addData['middlename'] . ' ' . $addData['lastname'],
121119
'company' => isset($addData['company']) ? $addData['company'] : '',
122120
'street' => isset($addData['street']) ? $addData['street'] : '',
123121
'city' => isset($addData['city']) ? $addData['city'] : '',
@@ -154,8 +152,10 @@ public function getToken($cartId, $method, $customerData)
154152

155153
if (!empty($email))
156154
$requestData['sender_email'] = $email;
155+
157156
if (!empty($merchant_data))
158-
$requestData['merchant_data'] = array($merchant_data);
157+
$requestData['merchant_data'] = $merchant_data;
158+
159159
$sign = $this->getSignature($requestData, $decrypted_key);
160160
$requestData['signature'] = $sign;
161161

@@ -175,7 +175,7 @@ public function getToken($cartId, $method, $customerData)
175175
return $answer;
176176

177177
} catch (\Exception $e) {
178-
$this->logger->error(__('Payment capturing error.'));
178+
$this->logger->error(__('Payment capturing error. Reason: ' . $e->getMessage()));
179179
throw new \Magento\Framework\Validator\Exception(__('Payment capturing error.'));
180180
}
181181
}
@@ -216,7 +216,7 @@ private function doRequest($data)
216216
return $response->getBody();
217217

218218
} catch (\Exception $e) {
219-
$this->logger->error(__('Payment capturing error.'));
219+
$this->logger->error(__('Payment capturing error. Reason: ' . $e->getMessage()));
220220
throw new \Magento\Framework\Validator\Exception(__('Payment capturing error.'));
221221
}
222222

0 commit comments

Comments
 (0)