Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paypal express checkout integration security issue

There are 3 ways to execute and create a payment as mentioned here

  1. Client side REST
  2. Server side REST
  3. Braintree SDK

What we used was Client side REST. Code integration found on their website:

paypal.Button.render({

        env: 'sandbox', // sandbox | production

        // PayPal Client IDs - replace with your own
        // Create a PayPal app: https://developer.paypal.com/developer/applications/create
        client: {
            sandbox:    'AZDxjDScFpQtjWTOUtWKbyN_bDt4OgqaF4eYXlewfBP4-8aqX3PiV8e1GWU6liB2CUXlkA59kJXE7M6R',
            production: '<insert production client id>'
        },

        // Show the buyer a 'Pay Now' button in the checkout flow
        commit: true,

        // payment() is called when the button is clicked
        payment: function(data, actions) {

            // Make a call to the REST api to create the payment
            return actions.payment.create({
                transactions: [
                    {
                        amount: { total: '0.01', currency: 'USD' }
                    }
                ]
            });
        },

        // onAuthorize() is called when the buyer approves the payment
        onAuthorize: function(data, actions) {

            // Make a call to the REST api to execute the payment
            return actions.payment.execute().then(function() {
                window.alert('Payment Complete!');
            });
        }

    }, '#paypal-button-container');

Is this safe?

client: {
            sandbox:    'AZDxjDScFpQtjWTOUtWKbyN_bDt4OgqaF4eYXlewfBP4-8aqX3PiV8e1GWU6liB2CUXlkA59kJXE7M6R',
            production: '<insert production client id>'
        },

We are exposing our client id on the client side which others might be able to get and use it.

Thanks and more power

like image 579
Defyleiti Avatar asked Feb 21 '26 16:02

Defyleiti


1 Answers

looks like no one answer this question, and might be some other persons who searched it. well some other guy answer this question in the comment for the same question here paypal express checkout security with cilent ajax call

like image 103
Beni Gazala Avatar answered Feb 24 '26 06:02

Beni Gazala



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!