Comments (2)
Hello @prakash-gangadharan
Thanks for your answer . I have 3 differents objects inside this.props.orders.orders,I noted that this code doesn't works:
var items=[];
var tempItem={};
var tempSubtotal=0;
this.props.orders.orders.forEach(function(order) {
tempSubtotal+=order.quantity*order.price;
tempItem.name=order.name.toString();
tempItem.sku=order.id;
tempItem.price=order.price;
tempItem.currency=order.currency.toString();
tempItem.quantity=order.quantity;
items.push(tempItem);
});
this.setState({
subtotal:tempSubtotal,
items
});
Inside this.props.orders.orders I have this data:
{
category: "Soup",
currency: "USD",
description: "With beef stock base, slow-cooked caramelized onions,↵ French bread, gruyere and Parmesan cheese,especially with↵ a thick slice of toasted bread loaded with melty Gruyere cheese ↵ and lots of caramelized onions.",
id: "5ENTR",
name: "French Onion Soup",
picture: "/img/entrees/french-onion-soup.png",
price: "5.60",
quantity: 2
},
{
category: "Meat",
currency: "USD",
description: "Oybox tomatoes, basil seed vinaigrette .",
id: "6ENTR",
name: "Strips of Filet Mignon",
picture: "/img/entrees/strips-of-filet-mignon.png",
price: "6.50",
quantity: 2
},
{
category: "Fast Food",
currency: "USD",
description: "A hamburger, beefburger or burger is a sandwich consisting of one or more cooked patties of ground meat, usually↵ beef, placed inside a sliced bread roll or bun",
id: "3BGD",
name: "Hamburguer",
picture: "/img/strong-dish/hamburger.png",
price: "5.50",
quantity: 2
}
from paypal-node-sdk.
Hi @LeoCR , with respect to the PayPal-Debug-ID
: 3b1078db6e31
The request payload given by you to create payment is as below
{
"intent": "order",
"payer": {
"payment_method": "paypal"
},
"transactions": [
{
"amount": {
"total": "25.35",
"currency": "USD",
"details": {
"subtotal": "24.20",
"tax": "0.15",
"shipping": "1"
}
},
"description": "Hat for the best team ever.",
"item_list": {
"items": [
{
"name": "French Onion Soup",
"sku": "5ENTR",
"price": "5.60",
"currency": "USD",
"quantity": "2"
},
{
"name": "French Onion Soup",
"sku": "5ENTR",
"price": "5.60",
"currency": "USD",
"quantity": "2"
},
{
"name": "French Onion Soup",
"sku": "5ENTR",
"price": "5.60",
"currency": "USD",
"quantity": "2"
}
]
}
}
],
"redirect_urls": {
"return_url": "https://localhost:49652/paypal/success",
"cancel_url": "https://localhost:49652/paypal/cancel"
}
}
Here the total
and subtotal
value is wrong with respect to the line item_list amounts.
It should be subtotal
: "33.6" and total
: "34.75". Can you check at your code that, what making these values as a wrong one?
Thanks!
from paypal-node-sdk.
Related Issues (20)
- is it possible to use masPay (payouts) behalf third party? HOT 1
- PayPal Auth - Adaptative Payments HOT 2
- Currency amount must be non-negative number, may optionally ... HOT 2
- Error 500- paypal.billingPlan.get HOT 7
- Setup fee not showing when paying HOT 2
- Cancel thousands of agreements at the same time HOT 1
- AUTHORIZATION_ERROR HOT 8
- Is PayPal "Sync" Supported? /v1/reporting/transactions HOT 3
- This library seriously needs maintaining, billing plans do not work as per the docs. HOT 1
- PayPal SDK
- Rest API issue HOT 1
- Cannot construct instance of `com.paypal.platform.payments.model.rest.common.Amount`, problem: INVALID_CURRENCY_AMOUNT_FORMAT HOT 1
- problem with request: unable to verify the first certificate
- Can this sdk be used for subscriptions. HOT 3
- disable user subscription from the database if he didn't pay HOT 1
- RFC: Ability to Skip Customer Approval in Sandbox needed to run integration tests
- Paypal transaction API returns `Data for the given start date is not available.` HOT 4
- OrdersGetRequest bug HOT 1
- MISSING_PAYLOAD when using AgreementSuspendRequest
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from paypal-node-sdk.