B
B
BonBon Slick2017-06-26 19:58:28
API
BonBon Slick, 2017-06-26 19:58:28

PayPal sandbox, no account history after transactions?

I made an account, created an application and several test accounts. Connected Express Checkout, configured everything. He writes what he needs, they say, the money was sent to the seller and the transaction was successful, I created it on the server and calculated what was needed in the response from the API. However, if you go to test accounts: 1 - there is no history that you successfully paid / accepted payment. 2 - does not withdraw money from the buyer. 3 - does not add to the seller.
Here is the code:

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

                <script>
                    paypal.Button.render({
                        env: 'sandbox', 
                        client: {
                            sandbox:    'Adn*******O1p',
                        },
                        commit: true,
                        payment: function(data, actions) {
                            return actions.payment.create({
                                transactions: [
                                    {
                                        amount: { total: '1', currency: 'USD' }
                                    }
                                ]
                            });
                        },

                        onAuthorize: function(data, actions) {
                            var EXECUTE_URL =  laroute.route('pay_pal_pay');
                            var data = {
                                paymentID: data.paymentID,
                                payerID: data.payerID
                            };
                            return paypal.request.post(EXECUTE_URL, data)
                                .then(function (res) {
                                    window.alert('Payment Complete!');
                                });
                        }
                    }, '#paypal-button-container');
                </script>

Displays that the payment is successful, the route works out to which it sends data. Payment ID and the one who pays.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
BonBon Slick, 2017-06-27
@BonBonSlick

I don't know why, the server-side creak helped me. There we send a request to create a payment, create it on our server, and return it to the front. Upon confirmation, we again send it to our server and validate it there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question