react.js - paypal integration with react-paypal-js
morph192
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
Mar-16-2021
10:20 AM
Hi,
My currently code is :
And on top of file ofc:
import { PayPalScriptProvider, PayPalButtons } from "@paypal/react-paypal-js";
//paypal
const createOrder = (data, actions) =>{
return actions.order.create({
purchase_units: [
{
amount: {
value: "50",
},
},
],
});
};
const onApprove = (data, actions) => {
return actions.order.capture();
};
return (
<>
<PayPalScriptProvider options={{ "client-id": "AdVF2X5TCOL7vsidbWO8mHa5fhZq9HLLUR9C55zFknSclhwFkhKSrDwfhveUCY_ZHNdGPz_6iG3FnaTk" }}>
<PayPalButtons
createOrder={(data, actions) => createOrder(data, actions)}
onApprove={(data, actions) => onApprove(data, actions)}
/>
</PayPalScriptProvider>
</>
);
In my console.log there are two errors:
A boolean is being passed as a fourth parameter to window.open. This is not used and may cause an exception in a future release.
POST https://www.sandbox.paypal.com/smart/api/order/6BK65346XG818045N/capture 400 (Bad Request)
And theres alot of text underthat with errors....
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.
Related Content
- Paypal 4X credit : translated message & currency error in PayPal Payments Standard
- Need help to integrate PayPal Standard Checkout with Shopify in PayPal Payments Standard
- Platform Marketplace integration approval in Sandbox Environment
- Error: "Unable to change shipping method. Please try again." in PayPal popup in REST APIs
- Question about the ButtonSource field when converting an integration from SOAP/NVP to REST API v1. in REST APIs