Been some time since I used paypal, but I suggest play (test) what you need in their sandbox. And I suggest following paypals documentation on setting up things. Accepting payments use their guides, don't try to "customize".
Confused about server-side SDK of PayPal
Hello everyone! Currently I'm integrating PayPal payment into my project, but I'm confused about something. Everything works fine and I'm glad to see it is working, but somehow my sixth sense tells me to create a server-side SDK request instead of the current client-side. Here's what I've done so far:
paypal.Buttons({
style: {
layout: 'vertical',
color: 'blue',
shape: 'rect',
label: 'pay',
}, createOrder: function(data, actions) {
return actions.order.create({
purchase_units: [{
amount: {
description: '{{ $setup->plan->name }}',
value: '{{ $setup->plan->price }}'
}
}],
application_context: {
shipping_preference: 'NO_SHIPPING'
}
});
}, onApprove: function(data, actions) {
return actions.order.capture().then(function(orderData) {
alert('successfull payment');
}).render('#paypal-button-container');
and everything works great, but I want to create a server-side intent because I somehow feel it more secure. Can someone explain me how can I easily either check the transaction within this javascript code if it is completed successfully and the user paid the exact price for the goods or create a server-side intent for the payment so I can prevent users from manually edit the price? The documentation is way too difficult to understand for me that's why I asked my question here.
Please or to participate in this conversation.