ASP .NET - Setup a transaction at server side using /v2/checkout/orders

arvindt
Contributor
Contributor

I'm trying to setup a transaction on the server side using the Orders V2 API, I followed all the steps and when I test, the call to PayPal to setup the transaction never returns back and I'm stuck with the rotating icon on the popup window.

var response = await PayPalClient.client().Execute(request);

 my JS looks like this:

paypal.Buttons({
    createOrder: function () {
        return fetch('Default.aspx/CreateTransaction', {
            method: 'post',
            headers: {
                'content-type''application/json'
            }
        }).then(function (res) {
            console.log(res);
            return res.json();
            }).then(function (data) {
                console.log(data);
            return data.orderID;
        });
    },
    onApprove: function (data, actions) {
       .........
}).render('#paypal-button-container');

 

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.