diff --git a/src/Message/ChargeRequest.php b/src/Message/ChargeRequest.php index 6efcd74..d7772e2 100755 --- a/src/Message/ChargeRequest.php +++ b/src/Message/ChargeRequest.php @@ -182,7 +182,7 @@ public function sendData($data) } catch (\Exception $e) { $response = [ 'status' => 'error', - 'detail' => 'Exception when creating transaction: ', $e->getMessage() + 'detail' => 'Exception when creating transaction: ' . $e->getMessage() ]; } diff --git a/src/Message/ChargeResponse.php b/src/Message/ChargeResponse.php index 147805e..8d2f14d 100755 --- a/src/Message/ChargeResponse.php +++ b/src/Message/ChargeResponse.php @@ -38,27 +38,27 @@ public function getRedirectData() public function getTransactionId() { - return $this->data['transactionId']; + return $this->data['transactionId'] ?? null; } public function getTenders() { - return $this->data['tenders']; + return $this->data['tenders'] ?? null; } public function getOrderId() { - return $this->data['orderId']; + return $this->data['orderId'] ?? null; } public function getCreatedAt() { - return $this->data['created_at']; + return $this->data['created_at'] ?? null; } public function getReferenceId() { - return $this->data['referenceId']; + return $this->data['referenceId'] ?? null; } public function getMessage() @@ -68,7 +68,7 @@ public function getMessage() $message .= $this->data['code'] . ': '; } - return $message . ($this->data['error'] ?? ''); + return $message . ($this->data['detail'] ?? ''); } /** @@ -84,10 +84,10 @@ public function getTransactionReference() /** * Get the tender id that is used for processing refunds * - * @return string + * @return null|string */ public function getBillingId() { - return $this->getTenders()[0]['id']; + return $this->getTenders()[0]['id'] ?? null; } } diff --git a/src/Message/CreateCardRequest.php b/src/Message/CreateCardRequest.php index cef51bf..12d577b 100644 --- a/src/Message/CreateCardRequest.php +++ b/src/Message/CreateCardRequest.php @@ -86,7 +86,7 @@ public function sendData($data) } catch (\Exception $e) { $response = [ 'status' => 'error', - 'detail' => 'Exception when creating card: ', $e->getMessage() + 'detail' => 'Exception when creating card: ' . $e->getMessage() ]; } diff --git a/src/Message/CreateCustomerRequest.php b/src/Message/CreateCustomerRequest.php index 596e1d1..a309c75 100644 --- a/src/Message/CreateCustomerRequest.php +++ b/src/Message/CreateCustomerRequest.php @@ -60,6 +60,16 @@ public function setEmail($value) return $this->setParameter('email', $value); } + public function getReferenceId() + { + return $this->getParameter('referenceId'); + } + + public function setReferenceId($value) + { + return $this->setParameter('referenceId', $value); + } + public function getData() { $data = []; @@ -68,6 +78,7 @@ public function getData() $data['family_name'] = $this->getLastName(); $data['company_name'] = $this->getCompanyName(); $data['email_address'] = $this->getEmail(); + $data['reference_id'] = $this->getReferenceId(); return $data; } @@ -96,7 +107,7 @@ public function sendData($data) } catch (\Exception $e) { $response = [ 'status' => 'error', - 'detail' => 'Exception when creating customer: ', $e->getMessage() + 'detail' => 'Exception when creating customer: ' . $e->getMessage() ]; } diff --git a/src/Message/DeleteCardRequest.php b/src/Message/DeleteCardRequest.php index 9afabe7..af14f73 100644 --- a/src/Message/DeleteCardRequest.php +++ b/src/Message/DeleteCardRequest.php @@ -91,7 +91,7 @@ public function sendData($data) } catch (\Exception $e) { $response = [ 'status' => 'error', - 'detail' => 'Exception when creating card: ', $e->getMessage() + 'detail' => 'Exception when creating card: ' . $e->getMessage() ]; } diff --git a/src/Message/DeleteCustomerRequest.php b/src/Message/DeleteCustomerRequest.php index 30fbbda..a76ddc2 100644 --- a/src/Message/DeleteCustomerRequest.php +++ b/src/Message/DeleteCustomerRequest.php @@ -78,7 +78,7 @@ public function sendData($data) } catch (\Exception $e) { $response = [ 'status' => 'error', - 'detail' => 'Exception when creating customer: ', $e->getMessage() + 'detail' => 'Exception when creating customer: ' . $e->getMessage() ]; } diff --git a/src/Message/FetchCardRequest.php b/src/Message/FetchCardRequest.php index 64bae60..f829b29 100644 --- a/src/Message/FetchCardRequest.php +++ b/src/Message/FetchCardRequest.php @@ -97,7 +97,7 @@ public function sendData($data) } catch (\Exception $e) { $response = [ 'status' => 'error', - 'detail' => 'Exception when creating customer: ', $e->getMessage() + 'detail' => 'Exception when creating customer: ' . $e->getMessage() ]; } diff --git a/src/Message/FetchCustomerRequest.php b/src/Message/FetchCustomerRequest.php index 29a6385..3e450a0 100644 --- a/src/Message/FetchCustomerRequest.php +++ b/src/Message/FetchCustomerRequest.php @@ -83,7 +83,7 @@ public function sendData($data) } catch (\Exception $e) { $response = [ 'status' => 'error', - 'detail' => 'Exception when creating customer: ', $e->getMessage() + 'detail' => 'Exception when creating customer: ' . $e->getMessage() ]; } diff --git a/src/Message/ListRefundsRequest.php b/src/Message/ListRefundsRequest.php index 1a689cc..62d11ca 100644 --- a/src/Message/ListRefundsRequest.php +++ b/src/Message/ListRefundsRequest.php @@ -137,7 +137,7 @@ public function sendData() } catch (\Exception $e) { $response = [ 'status' => 'error', - 'detail' => 'Exception when calling TransactionsApi->listRefunds: ', $e->getMessage() + 'detail' => 'Exception when calling TransactionsApi->listRefunds: ' . $e->getMessage() ]; } diff --git a/src/Message/ListTransactionsRequest.php b/src/Message/ListTransactionsRequest.php index 16d07d6..e6823fd 100644 --- a/src/Message/ListTransactionsRequest.php +++ b/src/Message/ListTransactionsRequest.php @@ -187,7 +187,7 @@ public function sendData() } catch (\Exception $e) { $response = [ 'status' => 'error', - 'detail' => 'Exception when calling TransactionsApi->listTransactions: ', $e->getMessage() + 'detail' => 'Exception when calling TransactionsApi->listTransactions: ' . $e->getMessage() ]; } diff --git a/src/Message/RefundRequest.php b/src/Message/RefundRequest.php index b43dd5d..abf0d9a 100755 --- a/src/Message/RefundRequest.php +++ b/src/Message/RefundRequest.php @@ -123,7 +123,7 @@ public function sendData($data) } catch (\Exception $e) { $response = [ 'status' => 'error', - 'detail' => 'Exception when creating refund: ', $e->getMessage() + 'detail' => 'Exception when creating refund: ' . $e->getMessage() ]; } diff --git a/src/Message/TransactionRequest.php b/src/Message/TransactionRequest.php index 81caa2d..4045acd 100644 --- a/src/Message/TransactionRequest.php +++ b/src/Message/TransactionRequest.php @@ -100,7 +100,7 @@ public function sendData($data) } catch (\Exception $e) { $response = [ 'status' => 'error', - 'detail' => 'Exception when calling LocationsApi->listLocations: ', $e->getMessage() + 'detail' => 'Exception when calling LocationsApi->listLocations: ' . $e->getMessage() ]; } diff --git a/src/Message/UpdateCustomerRequest.php b/src/Message/UpdateCustomerRequest.php index 162f7c6..766f58e 100644 --- a/src/Message/UpdateCustomerRequest.php +++ b/src/Message/UpdateCustomerRequest.php @@ -179,7 +179,7 @@ public function sendData($data) } catch (\Exception $e) { $response = [ 'status' => 'error', - 'detail' => 'Exception when creating customer: ', $e->getMessage() + 'detail' => 'Exception when creating customer: ' . $e->getMessage() ]; } diff --git a/src/Message/WebPaymentRequest.php b/src/Message/WebPaymentRequest.php index 6dc1f02..32fbf09 100644 --- a/src/Message/WebPaymentRequest.php +++ b/src/Message/WebPaymentRequest.php @@ -84,7 +84,7 @@ public function sendData($data) } catch (\Exception $e) { $response = [ 'status' => 'error', - 'detail' => 'Exception when creating web payment request: ', $e->getMessage() + 'detail' => 'Exception when creating web payment request: ' . $e->getMessage() ]; }