0
votes

I have an express checkout button on my webpage which looks somethin like that:

<body>
<div id="paypal-button"></div>

<script src="https://www.paypalobjects.com/api/checkout.js"></script>

<script>
    paypal.Button.render({

        env: 'sandbox', // Or 'sandbox'

        client: {
            sandbox:    '<censored>',
            production: 'xxxxxxxxx'
        },

        commit: true, // Show a 'Pay Now' button

        payment: function(data, actions) {
            return actions.payment.create({
                payment: {
                    transactions: [
                        {
                            amount: { total: '1.00', currency: 'USD' }
                        }
                    ]
                }
            });
        },

        onAuthorize: function(data, actions) {
            return actions.payment.execute().then(function(payment) {
                console.log(data);
            });
        }

    }, '#paypal-button');
</script>

I also have an IPN handler on my rails backend that i tested with the IPN simulator at https://developer.paypal.com/developer/ipnSimulator/ and selected express checkout and it works fine. The only thing I couldn't figure out is how to setup paypal to send the IPNs to my server. I tried setting up a paypal business account and entering url there for IPNs but i don't recieve anything on the server nor on the IPNs history website.

1

1 Answers

0
votes

I see button code is for sandbox. Sandbox is a test environment, you should setup IPN in your sandbox account to receive IPN notifications. You can login to sandbox account in this URL: www.sandbox.paypal.com

If you are using live account, you'll need to change "env" and "client" to production.