1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

fix payment status

This commit is contained in:
Benjamin Beganović 2020-06-15 13:27:14 +02:00
parent 9a2286fb7b
commit 8a3c8ef9fb
2 changed files with 12 additions and 6 deletions

View File

@ -62,7 +62,7 @@ class CheckoutComPaymentDriver extends BasePaymentDriver
'public' => $this->company_gateway->getConfigField('publicApiKey'),
'sandbox' => $this->company_gateway->getConfigField('testMode'),
];
$this->gateway = new CheckoutApi($config['secret'], $config['sandbox'], $config['public']);
}
@ -86,6 +86,12 @@ class CheckoutComPaymentDriver extends BasePaymentDriver
$data['raw_value'] = $data['amount_with_fee'];
$data['customer_email'] = $this->client->present()->email;
// dd($data['token']);
// if (isset($data['token'])) {
// $data['raw_token'] = $data['token'];
// }
return render($this->viewForType($data['payment_method_id']), $data);
}
@ -148,7 +154,7 @@ class CheckoutComPaymentDriver extends BasePaymentDriver
$data = [
'payment_method' => $state['charge_id'],
'payment_type' => PaymentType::CREDIT_CARD_OTHER, // @todo: needs proper status
'payment_type' => PaymentType::parseCardType($state['server_response']->card->paymentMethod),
'amount' => $state['raw_value'],
];
@ -173,14 +179,14 @@ class CheckoutComPaymentDriver extends BasePaymentDriver
public function processPendingPayment($state)
{
$state['charge_id'] = $state['payment_response']->id;
if (isset($state['store_card'])) {
$this->saveCard($state);
}
$data = [
'payment_method' => $state['charge_id'],
'payment_type' => PaymentType::CREDIT_CARD_OTHER, // @todo: needs proper status
'payment_type' => PaymentType::parseCardType($state['server_response']->card->paymentMethod),
'amount' => $state['raw_value'],
];

View File

@ -35,7 +35,7 @@
{{ ctrans('texts.method') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
{{ $payment->type->name }}
{{ optional($payment->type)->name }}
</dd>
</div>
<div class="bg-white px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
@ -62,7 +62,7 @@
<h3 class="text-lg leading-6 font-medium text-gray-900">
{{ ctrans('texts.invoices') }}
</h3>
<p class="mt-1 max-w-2xl text-sm leading-5 text-gray-500" translate>
<p class="mt-1 max-w-2xl text-sm leading-5 text-gray-500">
{{ ctrans('texts.list_of_payment_invoices') }}
</p>
</div>