1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

stripe alipay

This commit is contained in:
Benjamin Beganović 2020-10-20 17:15:55 +02:00
parent 024d839038
commit d26565b5ad
4 changed files with 20 additions and 56 deletions

View File

@ -31,9 +31,7 @@ class ProcessAlipay {
}, },
}; };
document.getElementById('pay-now').addEventListener('submit', (e) => { document.getElementById('pay-now').addEventListener('click', (e) => {
e.preventDefault();
document.getElementById('pay-now-button').disabled = true; document.getElementById('pay-now-button').disabled = true;
document.querySelector('#pay-now-button > svg').classList.add('hidden'); document.querySelector('#pay-now-button > svg').classList.add('hidden');
document.querySelector('#pay-now-button > span').classList.remove('hidden'); document.querySelector('#pay-now-button > span').classList.remove('hidden');

View File

@ -1,61 +1,25 @@
@extends('portal.ninja2020.layout.app') @extends('portal.ninja2020.layout.payments', ['gateway_title' => 'Alipay (Stripe)', 'card_title' => 'Alipay (Stripe)'])
@section('meta_title', ctrans('texts.alipay'))
@push('head') @section('gateway_head')
<meta name="stripe-publishable-key" content="{{ $gateway->getPublishableKey() }}"> <meta name="stripe-publishable-key" content="{{ $gateway->getPublishableKey() }}">
<meta name="return-url" content="{{ $return_url }}"> <meta name="return-url" content="{{ $return_url }}">
<meta name="currency" content="{{ $currency }}"> <meta name="currency" content="{{ $currency }}">
<meta name="amount" content="{{ $stripe_amount }}"> <meta name="amount" content="{{ $stripe_amount }}">
@endpush @endsection
@section('body') @section('gateway_content')
<div class="container mx-auto"> <div class="alert alert-failure mb-4" hidden id="errors"></div>
<div class="grid grid-cols-6 gap-4">
<div class="col-span-6 md:col-start-2 md:col-span-4"> @include('portal.ninja2020.gateways.includes.payment_details')
<div class="alert alert-failure mb-4" hidden id="errors"></div>
<div class="bg-white shadow overflow-hidden sm:rounded-lg"> @component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.payment_type')])
<div class="px-4 py-5 border-b border-gray-200 sm:px-6"> {{ ctrans('texts.alipay') }}
<h3 class="text-lg leading-6 font-medium text-gray-900"> @endcomponent
{{ ctrans('texts.pay_now') }}
</h3> @include('portal.ninja2020.gateways.includes.pay_now')
<p class="mt-1 max-w-2xl text-sm leading-5 text-gray-500">
{{ ctrans('texts.complete_your_payment') }}
</p>
</div>
<form action="#" method="POST" id="pay-now">
<div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 flex items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
{{ ctrans('texts.payment_type') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
{{ ctrans('texts.alipay') }}
</dd>
</div>
<div class="bg-white px-4 py-5 sm:grid sm:grid-cols-3 sm:gap-4 sm:px-6 flex items-center">
<dt class="text-sm leading-5 font-medium text-gray-500 mr-4">
{{ ctrans('texts.amount') }}
</dt>
<dd class="mt-1 text-sm leading-5 text-gray-900 sm:mt-0 sm:col-span-2">
<span class="font-bold">{{ App\Utils\Number::formatMoney($amount, $client) }}</span>
</dd>
</div>
<div class="bg-gray-50 px-4 py-5 flex justify-end">
<button class="button button-primary bg-primary" id="pay-now-button">
<svg class="animate-spin h-5 w-5 text-white hidden" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
</svg>
<span>{{ __('texts.save') }}</span>
</button>
</div>
</form>
</div>
</div>
</div>
</div>
@endsection @endsection
@push('footer') @push('footer')
<script src="https://js.stripe.com/v3/"></script> <script src="https://js.stripe.com/v3/"></script>
<script src="{{ asset('js/clients/payments/alipay.js') }}"></script> <script src="{{ asset('js/clients/payments/stripe-alipay.js') }}"></script>
@endpush @endpush

View File

@ -10,6 +10,8 @@
@section('gateway_content') @section('gateway_content')
<div class="alert alert-failure mb-4" hidden id="errors"></div> <div class="alert alert-failure mb-4" hidden id="errors"></div>
@include('portal.ninja2020.gateways.includes.payment_details')
@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.sofort') }} ({{ ctrans('texts.bank_transfer') }}) {{ ctrans('texts.sofort') }} ({{ ctrans('texts.bank_transfer') }})
@endcomponent @endcomponent

4
webpack.mix.js vendored
View File

@ -27,8 +27,8 @@ mix.js("resources/js/app.js", "public/js")
"public/js/clients/payments/stripe-sofort.js" "public/js/clients/payments/stripe-sofort.js"
) )
.js( .js(
"resources/js/clients/payments/alipay.js", "resources/js/clients/payments/stripe-alipay.js",
"public/js/clients/payments/alipay.js" "public/js/clients/payments/stripe-alipay.js"
) )
.js( .js(
"resources/js/clients/payments/checkout.com.js", "resources/js/clients/payments/checkout.com.js",