I am trying to create subscription from JS Call and getting Json error. Please check: IS there any document which uses smart button and send the request to API Call and get the reponse. JS CODE paypal.Buttons({ createSubscription: function (data, actions) { return fetch('/AuthorizedNet/CreateSubscription/', { method: 'post', //headers: { // 'content-type': 'application/json' //} }).then(function (res) { //return { subscriptionID: res }; return res.json(); }).then(function (data) { debugger; return data.Id; }); }, // Finalize the transaction onApprove: function (data, actions) { return fetch('/AuthorizedNet/PaypalCallBack/' + data.subscriptionID, { method: 'post' }).then(function (res) { var a = JSON.parse(res); return res.json(); }).then(function (details) { // Show a success message to the buyer alert('Transaction completed by ' + details.payer.name.given_name + '!'); }); } }).render('#paypal-button-container');
... View more