Cookies help us customize the PayPal Community for you, and some are necessary to make our site work. By browsing this website, you consent to the use of cookies. Learn more
Accept
Reject
PayPal Navigation
  • Send
  • Request
  • Business
  • Help
Log in to Ask the Community Log in to Help the Community
Choose where to post your question
Skip to main content Skip to search PayPal Home
  • Send
  • Request
  • Business
  • Help
  • Community
Log in
since ‎Sep-28-2020
bg_nox

bg_nox

Contributor
2
Posts
0
Kudos
0
Solutions
The Return
Active
View All
Latest Contributions by bg_nox
  • Topics bg_nox has Participated In
  • Latest Contributions by bg_nox

"Expected an order id to be passed"

by bg_nox Contributor in PayPal Payments Standard
‎Sep-29-2020 03:05 PM
‎Sep-29-2020 03:05 PM
Here is the paypal button function which makes an API call and receives a response, but the response causes the error "Expected an order id to be passed", what can be wrong here?  See below for the response.     paypal.Buttons({ createOrder: function () { var data = { 'sku': $("input[type='radio']:checked").val(), 'qty': $('#productQty').val() } return fetch('/api/Paypal', { method: 'post', headers: { 'content-type': 'application/json' }, body: JSON.stringify(data) }).then(function (res) { return res.json(); }).then(function (data) { return data.Id; // Also tried data.orderID }); }, onApprove: function (data, actions) { // This function captures the funds from the transaction. return actions.order.create().then(function (details) { // This function shows a transaction success message to your buyer. alert('Transaction completed by ' + details.payer.name.given_name); }); } }).render('#paypal-button-container');     You can see the response has a valid ID: Id: "32C401489U432333G" Status: "CREATED" Here's the same response seen in visual studio:   Here's my controller which is receiving the call and sending back the response to the button:   public async Task<PayPalHttp.HttpResponse> Post([FromBody]Order order) { return await Orders.CreateOrder(order); // returns the HttpResponse from paypal }   Again, I verified that this response has the above information in the screenshot.   ... View more
Labels:
  • PayPal HTML Buttons

Call to PayPal API loads forever

by bg_nox Contributor in REST APIs
‎Sep-28-2020 07:59 PM
‎Sep-28-2020 07:59 PM
I'm currently using the sample code here https://github.com/paypal/Checkout-NET-SDK   In particular, the line var response = await PayPalClient.client().Execute(request); in this file https://github.com/paypal/Checkout-NET-SDK/blob/develop/Samples/CaptureIntentExamples/CreateOrderSample.cs never returns any response, it just loads forever.  Is there any reason this is happening? I've waited an hour and nothing happens, both on a local copy and the deployed site. ... View more
Powered by Khoros
  • Help & Contact
  • Security

©1999-2023 PayPal, Inc. All rights reserved.

  • Privacy
  • Legal
  • Policy updates