mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 17:14:31 -04:00
Fixes for ACSS
This commit is contained in:
parent
85b58ec8df
commit
cfd76fc8df
@ -154,6 +154,7 @@ class ACSS
|
|||||||
'interval_description' => 'when any invoice becomes due',
|
'interval_description' => 'when any invoice becomes due',
|
||||||
'transaction_type' => 'personal' // TODO: check if is company or personal https://stripe.com/docs/payments/acss-debit
|
'transaction_type' => 'personal' // TODO: check if is company or personal https://stripe.com/docs/payments/acss-debit
|
||||||
],
|
],
|
||||||
|
'verification_method' => 'instant',
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
], $this->stripe->stripe_connect_auth);
|
], $this->stripe->stripe_connect_auth);
|
||||||
@ -183,7 +184,7 @@ class ACSS
|
|||||||
$this->stripe->payment_hash->save();
|
$this->stripe->payment_hash->save();
|
||||||
|
|
||||||
if (property_exists($gateway_response, 'status') && $gateway_response->status == 'processing') {
|
if (property_exists($gateway_response, 'status') && $gateway_response->status == 'processing') {
|
||||||
$this->storePaymentMethod($gateway_response);
|
// $this->storePaymentMethod($gateway_response);
|
||||||
return $this->processSuccessfulPayment($gateway_response->id);
|
return $this->processSuccessfulPayment($gateway_response->id);
|
||||||
}
|
}
|
||||||
return $this->processUnsuccessfulPayment();
|
return $this->processUnsuccessfulPayment();
|
||||||
@ -243,12 +244,13 @@ class ACSS
|
|||||||
|
|
||||||
private function storePaymentMethod($intent)
|
private function storePaymentMethod($intent)
|
||||||
{
|
{
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$method = $this->stripe->getStripePaymentMethod($intent->payment_method);
|
$method = $this->stripe->getStripePaymentMethod($intent->payment_method);
|
||||||
|
|
||||||
$payment_meta = new \stdClass;
|
$payment_meta = new \stdClass;
|
||||||
$payment_meta->brand = (string) \sprintf('%s (%s)', $method->au_becs_debit->bank_code, ctrans('texts.acss'));
|
$payment_meta->brand = (string) $method->acss_debit->bank_name;
|
||||||
$payment_meta->last4 = (string) $method->au_becs_debit->last4;
|
$payment_meta->last4 = (string) $method->acss_debit->last4;
|
||||||
$payment_meta->state = 'authorized';
|
$payment_meta->state = 'authorized';
|
||||||
$payment_meta->type = GatewayType::ACSS;
|
$payment_meta->type = GatewayType::ACSS;
|
||||||
|
|
||||||
|
@ -533,12 +533,10 @@ class StripePaymentDriver extends BaseDriver
|
|||||||
//payment_intent.succeeded - this will confirm or cancel the payment
|
//payment_intent.succeeded - this will confirm or cancel the payment
|
||||||
if($request->type === 'payment_intent.succeeded'){
|
if($request->type === 'payment_intent.succeeded'){
|
||||||
PaymentIntentWebhook::dispatch($request->data, $request->company_key, $this->company_gateway->id)->delay(10);
|
PaymentIntentWebhook::dispatch($request->data, $request->company_key, $this->company_gateway->id)->delay(10);
|
||||||
// PaymentIntentWebhook::dispatch($request->data, $request->company_key, $this->company_gateway->id);
|
|
||||||
return response()->json([], 200);
|
return response()->json([], 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($request->type === 'charge.succeeded') {
|
if ($request->type === 'charge.succeeded') {
|
||||||
// if ($request->type === 'charge.succeeded' || $request->type === 'payment_intent.succeeded') {
|
|
||||||
|
|
||||||
foreach ($request->data as $transaction) {
|
foreach ($request->data as $transaction) {
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@
|
|||||||
{{ $payment_method->formatDateTimestamp($payment_method->created_at, $client->date_format()) }}
|
{{ $payment_method->formatDateTimestamp($payment_method->created_at, $client->date_format()) }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm leading-5 text-gray-500">
|
<td class="px-6 py-4 whitespace-nowrap text-sm leading-5 text-gray-500">
|
||||||
{{ ctrans("texts.{$payment_method->gateway_type->alias}") }}
|
{{ App\Models\GatewayType::getAlias($payment_method->gateway_type_id) }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4 whitespace-nowrap text-sm leading-5 text-gray-500">
|
<td class="px-6 py-4 whitespace-nowrap text-sm leading-5 text-gray-500">
|
||||||
{{ ucfirst(optional($payment_method->meta)->brand) }}
|
{{ ucfirst(optional($payment_method->meta)->brand) }}
|
||||||
|
@ -28,6 +28,9 @@
|
|||||||
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.payment_type')])
|
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.payment_type')])
|
||||||
{{ ctrans('texts.acss') }} ({{ ctrans('texts.bank_transfer') }})
|
{{ ctrans('texts.acss') }} ({{ ctrans('texts.bank_transfer') }})
|
||||||
@endcomponent
|
@endcomponent
|
||||||
|
|
||||||
|
@include('portal.ninja2020.gateways.stripe.acss.acss')
|
||||||
|
|
||||||
@include('portal.ninja2020.gateways.includes.pay_now')
|
@include('portal.ninja2020.gateways.includes.pay_now')
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="mt-5 sm:mt-4 sm:flex sm:flex-row-reverse">
|
<div class="mt-5 sm:mt-4 sm:flex sm:flex-row-reverse">
|
||||||
<div class="flex w-full rounded-md shadow-sm sm:ml-3 sm:w-auto">
|
<div class="flex w-full rounded-md shadow-sm sm:ml-3 sm:w-auto">
|
||||||
<form action="{{ route('client.payment_methods.destroy', [$payment_method->hashed_id, 'method' => $payment_method->gateway_type->id]) }}" method="post">
|
<form action="{{ route('client.payment_methods.destroy', [$payment_method->hashed_id, 'method' => $payment_method->gateway_type_id]) }}" method="post">
|
||||||
@csrf
|
@csrf
|
||||||
@method('DELETE')
|
@method('DELETE')
|
||||||
<button type="submit" onclick="setTimeout(() => this.disabled = true, 0); return true;" class="button button-danger button-block" dusk="confirm-payment-removal">
|
<button type="submit" onclick="setTimeout(() => this.disabled = true, 0); return true;" class="button button-danger button-block" dusk="confirm-payment-removal">
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
@extends('portal.ninja2020.layout.app')
|
@extends('portal.ninja2020.layout.app')
|
||||||
@section('meta_title', ucfirst($payment_method->gateway_type->name))
|
@section('meta_title', App\Models\GatewayType::getAlias($payment_method->gateway_type_id))
|
||||||
|
|
||||||
@section('body')
|
@section('body')
|
||||||
<div class="container mx-auto">
|
<div class="container mx-auto">
|
||||||
<div class="overflow-hidden bg-white shadow sm:rounded-lg">
|
<div class="overflow-hidden bg-white shadow sm:rounded-lg">
|
||||||
<div class="px-4 py-5 border-b border-gray-200 sm:px-6">
|
<div class="px-4 py-5 border-b border-gray-200 sm:px-6">
|
||||||
<h3 class="text-lg font-medium leading-6 text-gray-900">
|
<h3 class="text-lg font-medium leading-6 text-gray-900">
|
||||||
{{ ctrans("texts.{$payment_method->gateway_type->alias}") }}
|
{{ App\Models\GatewayType::getAlias($payment_method->gateway_type_id) }}
|
||||||
</h3>
|
</h3>
|
||||||
<p class="max-w-2xl mt-1 text-sm leading-5 text-gray-500" translate>
|
<p class="max-w-2xl mt-1 text-sm leading-5 text-gray-500" translate>
|
||||||
{{ ctrans('texts.payment_method_details') }}
|
{{ ctrans('texts.payment_method_details') }}
|
||||||
@ -14,13 +14,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<dl>
|
<dl>
|
||||||
@if(!empty($payment_method->gateway_type->name) && !is_null($payment_method->gateway_type->name))
|
@if(!empty(App\Models\GatewayType::getAlias($payment_method->gateway_type_id)) && !is_null(App\Models\GatewayType::getAlias($payment_method->gateway_type_id)))
|
||||||
<div class="px-4 py-5 bg-gray-50 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
<div class="px-4 py-5 bg-gray-50 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6">
|
||||||
<dt class="text-sm font-medium leading-5 text-gray-500">
|
<dt class="text-sm font-medium leading-5 text-gray-500">
|
||||||
{{ ctrans('texts.payment_type') }}
|
{{ ctrans('texts.payment_type') }}
|
||||||
</dt>
|
</dt>
|
||||||
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
|
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
|
||||||
{{ ucfirst($payment_method->gateway_type->name) }}
|
{{ App\Models\GatewayType::getAlias($payment_method->gateway_type_id) }}
|
||||||
</dd>
|
</dd>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user