Livewire fixes for subscription purchasds

This commit is contained in:
David Bomba 2024-01-27 18:59:56 +11:00
parent 753c9c4239
commit d05a58cebe
6 changed files with 19 additions and 17 deletions

View File

@ -353,6 +353,7 @@ class BillingPortalPurchase extends Component
$this->payment_method_id = $gateway_type_id; $this->payment_method_id = $gateway_type_id;
$this->handleBeforePaymentEvents(); $this->handleBeforePaymentEvents();
} }
/** /**

View File

@ -44,6 +44,7 @@ class InstantPayment
public function run() public function run()
{ {
nlog($this->request->all());
$is_credit_payment = false; $is_credit_payment = false;
$tokens = []; $tokens = [];

View File

@ -6,18 +6,19 @@
@stop @stop
@push('footer') @push('footer')
<script>
function updateGatewayFields(companyGatewayId, paymentMethodId) {
document.getElementById('company_gateway_id').value = companyGatewayId;
document.getElementById('payment_method_id').value = paymentMethodId;
}
<script>
document.addEventListener('livewire:init', () => { document.addEventListener('livewire:init', () => {
Livewire.on('beforePaymentEventsCompleted', () => document.getElementById('payment-method-form').submit()); Livewire.on('beforePaymentEventsCompleted', () => {
setTimeout(() => {
document.getElementById('payment-method-form').submit()
}, 2000);
});
}); });
</script> </script>
@endpush @endpush

View File

@ -7,12 +7,6 @@
@push('footer') @push('footer')
<script> <script>
function updateGatewayFields(companyGatewayId, paymentMethodId) {
console.log(companyGatewayId, paymentMethodId);
document.getElementById('company_gateway_id').value = companyGatewayId;
document.getElementById('payment_method_id').value = paymentMethodId;
}
document.addEventListener('livewire:init', () => { document.addEventListener('livewire:init', () => {

View File

@ -143,7 +143,7 @@
@if($steps['started_payment'] == false) @if($steps['started_payment'] == false)
@foreach($this->methods as $method) @foreach($this->methods as $method)
<button <button
wire:click="handleMethodSelectingEvent('{{ $method['company_gateway_id'] }}', '{{ $method['gateway_type_id'] }}')" wire:click="handleMethodSelectingEvent('{{ $method['company_gateway_id'] }}', '{{ $method['gateway_type_id'] }}'); $wire.$refresh(); "
class="px-3 py-2 border rounded mr-4 hover:border-blue-600"> class="px-3 py-2 border rounded mr-4 hover:border-blue-600">
{{ $method['label'] }} {{ $method['label'] }}
</button> </button>

View File

@ -51,9 +51,14 @@
document.addEventListener('livewire:init', () => { document.addEventListener('livewire:init', () => {
Livewire.on('beforePaymentEventsCompleted', () => document.getElementById('payment-method-form').submit()); Livewire.on('beforePaymentEventsCompleted', () => {
setTimeout(() => {
document.getElementById('payment-method-form').submit()
}, 2000);
});
}); });
</script> </script>
@endpush @endpush