mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 02:34:35 -04:00
Fixes for authorize
This commit is contained in:
parent
dff41d4881
commit
ccac432978
@ -103,14 +103,16 @@ class AuthorizeCreditCard
|
|||||||
/*Refactor and push to BaseDriver*/
|
/*Refactor and push to BaseDriver*/
|
||||||
if ($data['response'] != null && $data['response']->getMessages()->getResultCode() == 'Ok') {
|
if ($data['response'] != null && $data['response']->getMessages()->getResultCode() == 'Ok') {
|
||||||
|
|
||||||
$response = $data['response'];
|
// $response = $data['response'];
|
||||||
|
|
||||||
$payment_record = [];
|
|
||||||
$payment_record['amount'] = $amount;
|
|
||||||
$payment_record['payment_type'] = PaymentType::CREDIT_CARD_OTHER;;
|
|
||||||
$payment_record['transaction_reference'] = $response->getTransactionResponse()->getTransId();
|
|
||||||
|
|
||||||
$this->authorize->createPayment($payment_record);
|
// $payment_record = [];
|
||||||
|
// $payment_record['amount'] = $amount;
|
||||||
|
// $payment_record['payment_type'] = PaymentType::CREDIT_CARD_OTHER;;
|
||||||
|
// $payment_record['transaction_reference'] = $response->getTransactionResponse()->getTransId();
|
||||||
|
|
||||||
|
// $this->authorize->createPayment($payment_record);
|
||||||
|
|
||||||
|
$this->storePayment($payment_hash, $data);
|
||||||
|
|
||||||
// $payment = $this->createPaymentRecord($data, $amount);
|
// $payment = $this->createPaymentRecord($data, $amount);
|
||||||
// $payment->meta = $cgt->meta;
|
// $payment->meta = $cgt->meta;
|
||||||
@ -148,31 +150,6 @@ class AuthorizeCreditCard
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private function handleResponse($data, $request)
|
private function handleResponse($data, $request)
|
||||||
{
|
{
|
||||||
$response = $data['response'];
|
$response = $data['response'];
|
||||||
@ -190,16 +167,14 @@ class AuthorizeCreditCard
|
|||||||
{
|
{
|
||||||
$amount = array_sum(array_column($payment_hash->invoices(), 'amount')) + $payment_hash->fee_total;
|
$amount = array_sum(array_column($payment_hash->invoices(), 'amount')) + $payment_hash->fee_total;
|
||||||
|
|
||||||
$payment = $this->createPaymentRecord($data, $amount);
|
$response = $data['response'];
|
||||||
|
|
||||||
$payment_hash->payment_id = $payment->id;
|
|
||||||
$payment_hash->save();
|
|
||||||
|
|
||||||
$this->authorize->attachInvoices($payment, $payment_hash);
|
$payment_record = [];
|
||||||
|
$payment_record['amount'] = $amount;
|
||||||
|
$payment_record['payment_type'] = PaymentType::CREDIT_CARD_OTHER;;
|
||||||
|
$payment_record['transaction_reference'] = $response->getTransactionResponse()->getTransId();
|
||||||
|
|
||||||
$payment->service()->updateInvoicePayment($payment_hash);
|
$payment = $this->authorize->createPayment($payment_record);
|
||||||
|
|
||||||
event(new PaymentWasCreated($payment, $payment->company, Ninja::eventVars()));
|
|
||||||
|
|
||||||
return $payment;
|
return $payment;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user