4

I'm using PayPal Express Checkout. It shows users an option to checkout with PayPal or checkout as a guest using just a credit card.

https://developer.paypal.com/demo/checkout/#/pattern/buynow

Sometimes when a user attempts to check out as a PayPal Guest the screen will redirect but the user is not charged. Clearly some type of payment issue (or something) but PayPal shows no error notifications. This is incredibly confusing to the customer because they believe they've been charged when they have not.

I think something is wrong with my setup but I'm not sure what that might be.

    <script>

    // Render the PayPal button

    paypal.Button.render({

        // Set your environment

        env: 'production', // sandbox | production

        // Specify the style of the button

        style: {
            label: 'checkout',
            fundingicons: true, // optional
            branding: true, // optional
            size:  'medium', // small | medium | large | responsive
            shape: 'rect',   // pill | rect
            color: 'blue' // gold | blue | silve | black


        },

        // PayPal Client IDs - replace with your own
        // Create a PayPal app: 


        client: {
            sandbox:    'MY#',
            production: 'MY#'
        },

 Wait for the PayPal button to be clicked

        payment: function(data, actions) {

            // Make a client-side call to the REST api to create the payment

            return actions.payment.create({
                payment: {
                    transactions: [
                        {
                            amount: { total: '9.99', currency: 'USD' }
                        }
                    ]
                },

                experience: {
                    input_fields: {
                        no_shipping: 1
                    }
                }
            });
        },

         Wait for the payment to be authorized by the customer
     commit: true,
        onAuthorize: function(data, actions) {

            // Execute the payment

            return actions.payment.execute().then(function() {
                $("#payWall").hide();
                $("#signUpForm").show();
            });
        }

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

</script>
AndrewLeonardi
  • 3,351
  • 9
  • 47
  • 100

0 Answers0