first commit

This commit is contained in:
2025-08-02 16:30:27 +02:00
commit 23646bfcee
14851 changed files with 1750626 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
paypalcheckout:
resource: "@PayPalCheckoutBundle/Controller/"
type: annotation

View File

@@ -0,0 +1,9 @@
services:
_defaults:
autowire: true
autoconfigure: true
public: false
KupShop\PayPalCheckoutBundle\:
resource: ../../{Controller}

View File

@@ -0,0 +1,35 @@
<script src="https://www.paypal.com/sdk/js?client-id={$cfg.Modules.payments.PayPalCheckout.clientID}&currency={$ctrl.active_currency}"></script>
<div class="paypal-container">
<div id="paypal-button-container"></div>
</div>
<script>
paypal.Buttons({
createOrder: function() {
return fetch('/paypal-checkout/create-paypal-order/', {
method: 'post',
headers: {
'content-type': 'application/json'
}
}).then(function(res) {
return res.json();
}).then(function(response) {
console.log('/paypal-checkout/create-paypal-order/ response');
console.log(response);
if (response.result.status == 'CREATED') {
return response.result.id; // Use the same key name for order ID on the client and server
} else if (response.hasOwnProperty('error')) {
alert(response.error);
}
});
},
style: {
layout: 'horizontal',
color: 'silver',
},
onApprove: function(data, actions) {
$('input, button').prop('disabled', true);
$('#paypal-button-container').hide();
window.location.replace('/paypal-checkout/capture-paypal-order/' + data.orderID + '/');
}
}).render('#paypal-button-container');
</script>