mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Updates for authorize.net
This commit is contained in:
parent
2ab2eef293
commit
d2f186962b
@ -115,7 +115,7 @@ class AuthorizeCreditCard
|
|||||||
];
|
];
|
||||||
|
|
||||||
$logger_message = [
|
$logger_message = [
|
||||||
'server_response' => $response->getTransactionResponse()->getTransId(),
|
'server_response' => $response->getTransId(),
|
||||||
'data' => $this->formatGatewayResponse($data, $vars),
|
'data' => $this->formatGatewayResponse($data, $vars),
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -130,11 +130,11 @@ class AuthorizeCreditCard
|
|||||||
];
|
];
|
||||||
|
|
||||||
$logger_message = [
|
$logger_message = [
|
||||||
'server_response' => $response->getTransactionResponse()->getTransId(),
|
'server_response' => $response->getTransId(),
|
||||||
'data' => $this->formatGatewayResponse($data, $vars),
|
'data' => $this->formatGatewayResponse($data, $vars),
|
||||||
];
|
];
|
||||||
|
|
||||||
PaymentFailureMailer::dispatch($this->authorize->client, $response->getTransactionResponse()->getTransId(), $this->authorize->client->company, $amount);
|
PaymentFailureMailer::dispatch($this->authorize->client, $response->getTransId(), $this->authorize->client->company, $amount);
|
||||||
|
|
||||||
SystemLogger::dispatch($logger_message, SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_FAILURE, SystemLog::TYPE_AUTHORIZE, $this->authorize->client, $this->authorize->client->company);
|
SystemLogger::dispatch($logger_message, SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_FAILURE, SystemLog::TYPE_AUTHORIZE, $this->authorize->client, $this->authorize->client->company);
|
||||||
|
|
||||||
@ -147,8 +147,8 @@ class AuthorizeCreditCard
|
|||||||
{
|
{
|
||||||
$response = $data['response'];
|
$response = $data['response'];
|
||||||
|
|
||||||
if ($response != null && $response->getMessages()->getResultCode() == 'Ok') {
|
// if ($response != null && $response->getMessages()->getResultCode() == 'Ok') {
|
||||||
|
if ($response != null && $response->getMessages() != null) {
|
||||||
return $this->processSuccessfulResponse($data, $request);
|
return $this->processSuccessfulResponse($data, $request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ class AuthorizeCreditCard
|
|||||||
$payment_record['amount'] = $amount;
|
$payment_record['amount'] = $amount;
|
||||||
$payment_record['payment_type'] = PaymentType::CREDIT_CARD_OTHER;
|
$payment_record['payment_type'] = PaymentType::CREDIT_CARD_OTHER;
|
||||||
$payment_record['gateway_type_id'] = GatewayType::CREDIT_CARD;
|
$payment_record['gateway_type_id'] = GatewayType::CREDIT_CARD;
|
||||||
$payment_record['transaction_reference'] = $response->getTransactionResponse()->getTransId();
|
$payment_record['transaction_reference'] = $response->getTransId();
|
||||||
|
|
||||||
$payment = $this->authorize->createPayment($payment_record);
|
$payment = $this->authorize->createPayment($payment_record);
|
||||||
|
|
||||||
@ -183,7 +183,7 @@ class AuthorizeCreditCard
|
|||||||
];
|
];
|
||||||
|
|
||||||
$logger_message = [
|
$logger_message = [
|
||||||
'server_response' => $data['response']->getTransactionResponse()->getTransId(),
|
'server_response' => $data['response']->getTransId(),
|
||||||
'data' => $this->formatGatewayResponse($data, $vars),
|
'data' => $this->formatGatewayResponse($data, $vars),
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -204,7 +204,7 @@ class AuthorizeCreditCard
|
|||||||
$response = $data['response'];
|
$response = $data['response'];
|
||||||
$amount = array_key_exists('amount_with_fee', $data) ? $data['amount_with_fee'] : 0;
|
$amount = array_key_exists('amount_with_fee', $data) ? $data['amount_with_fee'] : 0;
|
||||||
|
|
||||||
PaymentFailureMailer::dispatch($this->authorize->client, $response->getTransactionResponse()->getTransId(), $this->authorize->client->company, $data['amount_with_fee']);
|
PaymentFailureMailer::dispatch($this->authorize->client, $response->getTransId(), $this->authorize->client->company, $data['amount_with_fee']);
|
||||||
|
|
||||||
throw new \Exception(ctrans('texts.error_title'));
|
throw new \Exception(ctrans('texts.error_title'));
|
||||||
}
|
}
|
||||||
@ -216,15 +216,20 @@ class AuthorizeCreditCard
|
|||||||
$code = '';
|
$code = '';
|
||||||
$description = '';
|
$description = '';
|
||||||
|
|
||||||
if($response->getTransactionResponse()->getMessages() !== null){
|
if($response->getMessages() !== null){
|
||||||
$code = $response->getTransactionResponse()->getMessages()[0]->getCode();
|
$code = $response->getMessages()[0]->getCode();
|
||||||
$description = $response->getTransactionResponse()->getMessages()[0]->getDescription();
|
$description = $response->getMessages()[0]->getDescription();
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($response->getErrors() != null) {
|
||||||
|
$code = $response->getErrors()[0]->getErrorCode();
|
||||||
|
$description = $response->getErrors()[0]->getErrorText();
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'transaction_reference' => $response->getTransactionResponse()->getTransId(),
|
'transaction_reference' => $response->getTransId(),
|
||||||
'amount' => $vars['amount'],
|
'amount' => $vars['amount'],
|
||||||
'auth_code' => $response->getTransactionResponse()->getAuthCode(),
|
'auth_code' => $response->getAuthCode(),
|
||||||
'code' => $code,
|
'code' => $code,
|
||||||
'description' => $description,
|
'description' => $description,
|
||||||
'invoices' => $vars['invoices'],
|
'invoices' => $vars['invoices'],
|
||||||
|
@ -93,7 +93,7 @@ class ChargePaymentProfile
|
|||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'response' => $response,
|
'response' => $tresponse,
|
||||||
'amount' => $amount,
|
'amount' => $amount,
|
||||||
'profile_id' => $profile_id,
|
'profile_id' => $profile_id,
|
||||||
'payment_profile_id' => $payment_profile_id,
|
'payment_profile_id' => $payment_profile_id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user