Skip to content

fast forward #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 8, 2019
2 changes: 1 addition & 1 deletion src/Message/ChargeRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
];
}

Expand Down
16 changes: 8 additions & 8 deletions src/Message/ChargeResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -68,7 +68,7 @@ public function getMessage()
$message .= $this->data['code'] . ': ';
}

return $message . ($this->data['error'] ?? '');
return $message . ($this->data['detail'] ?? '');
}

/**
Expand All @@ -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;
}
}
2 changes: 1 addition & 1 deletion src/Message/CreateCardRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
];
}

Expand Down
13 changes: 12 additions & 1 deletion src/Message/CreateCustomerRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand All @@ -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;
}
Expand Down Expand Up @@ -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()
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Message/DeleteCardRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Message/DeleteCustomerRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Message/FetchCardRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Message/FetchCustomerRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Message/ListRefundsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Message/ListTransactionsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Message/RefundRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Message/TransactionRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Message/UpdateCustomerRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Message/WebPaymentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
];
}

Expand Down