Add translation for Venmo

This commit is contained in:
David Bomba 2023-10-16 16:49:47 +11:00
parent 15941b8273
commit 92e3f05e8b

View File

@ -29,43 +29,40 @@
@push('footer') @push('footer')
<!-- Replace "test" with your own sandbox Business account app client ID --> <script src="https://www.paypal.com/sdk/js?client-id={!! $client_id !!}&components=buttons,funding-eligibility&intent=capture" data-client-token="{!! $token !!}"></script>
<script src="https://www.paypal.com/sdk/js?client-id={!! $client_id !!}&components=buttons,funding-eligibility&intent=capture" data-client-token="{!! $token !!}"></script> <div id="paypal-button-container"></div>
<div id="paypal-button-container"></div> <script>
<script> const fundingSource = "{!! $funding_source !!}";
const testMode = {{ $gateway->company_gateway->getConfigField('testMode') }};
const clientId = "{{ $gateway->company_gateway->getConfigField('clientId') }}";
const sandbox = { sandbox: clientId };
const production = { production: clientId };
const orderId = "{!! $order_id !!}";
paypal.Buttons({ paypal.Buttons({
env: "{{ $gateway->company_gateway->getConfigField('testMode') ? 'sandbox' : 'production' }}", env: testMode ? 'sandbox' : 'production',
fundingSource: "{{ $funding_source }}", fundingSource: fundingSource,
client: { client: testMode ? sandbox : production,
@if($gateway->company_gateway->getConfigField('testMode')) // Order is created on the server and the order id is returned
sandbox: "{{ $gateway->company_gateway->getConfigField('clientId') }}" createOrder: function(data, actions) {
@else return orderId;
production: "{{ $gateway->company_gateway->getConfigField('clientId') }}" },
@endif // Finalize the transaction on the server after payer approval
}, onApprove: function(data, actions) {
// Order is created on the server and the order id is returned
createOrder: function(data, actions) {
return "{!! $order_id !!}"
},
// Finalize the transaction on the server after payer approval
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) { return actions.order.capture().then(function(details) {
document.getElementById("gateway_response").value =JSON.stringify( details ); document.getElementById("gateway_response").value =JSON.stringify( details );
document.getElementById("server_response").submit(); document.getElementById("server_response").submit();
}); });
}, },
onError: function(err) { onError: function(err) {
console.log(err); console.log(err);
} }
}).render('#paypal-button-container'); }).render('#paypal-button-container');
</script>
</script>
@endpush @endpush