Showing results for 
Search instead for 
Did you mean: 

react.js - paypal integration with react-paypal-js

Posted on



My currently code is :

And on top of file ofc: 

import { PayPalScriptProvider, PayPalButtons } from "@paypal/react-paypal-js";
  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" }}>
                  createOrder={(data, actions) => createOrder(data, actions)}
                  onApprove={(data, actions) => onApprove(data, actions)}

In my console.log there are two errors:
A boolean is being passed as a fourth parameter to This is not used and may cause an exception in a future release.
POST 400 (Bad Request)

And theres alot of text underthat with errors....

Haven't Found your Answer?

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