Skip to main content

PayPal Community

  • Dashboard
  • Send and Request
  • Wallet
  • Business
  • Help
Log in

Le Forum de la communauté n’est pas disponible pour les nouveaux messages ou les réponses; les articles précédents restent disponibles pour vérification. Afin de connaître les options d’assistance complètes, rendez-vous sur PayPal.com/HelpCenter

Si vous souhaitez signaler du contenu illégal et contraire au Règlement sur les services numériques de l’Union Européenne (DSA), veuillez cliquer ici.

since ‎Oct-01-2023
Country: United States
Type: Personal
perpetualyWeary
perpetualyWeary Contributor
Contributor
1
Post
0
Kudos
0
Solutions
The Return
Active
View all
Latest Contributions by perpetualyWeary
  • Topics perpetualyWeary has Participated In
  • Latest Contributions by perpetualyWeary

Checkout buttons appear twice and popups close as ...

by perpetualyWeary Contributor in PayPal Payments Standard
‎Oct-01-2023 11:20 PM
‎Oct-01-2023 11:20 PM
Right now, for some reason, the buttons to check out are appearing twice for some strange reason. I know its not any of my browser settings or plugins because this also happens on a private window that doesn't load in any of that.   Also, whenever I click on them, they try to open a pop up that closes immediately after opening, even when I open the localhost on a private window.   Here's the code on PayPalCheckout.js   import { useState } from "react"; import { Button } from "reactstrap"; import Paypal from "./PayPal"; const PaypalCheckout = () => { const [checkout, setCheckout] = useState(false); return ( <div> {checkout ? ( <Paypal /> ) : ( <Button onClick={() => { setCheckout(true); }} > Checkout </Button> )} </div> ); }; export default PaypalCheckout;         And here is the code from Paypal.js       import { useEffect, useRef } from "react"; const Paypal = () => { const paypal = useRef(); useEffect(() => { window.paypal.Buttons({ createOrder: (data, actions, error) => { return actions.order.createOrder({ intent: "CAPTURE", purchase_units: [ { description: 'ENTER DESC', //TODO: Order descriptions amount: { currency_code: "USD", value: 650.00 //TODO: Change this number based on charge } } ] }) }, onApprove: async (data, actions) => { const order = await actions.order.capture; console.log(order); }, onError: (err) => { console.log(err); } }).render(paypal.current) }, []) return ( <div> <div ref={paypal}></div> </div> ); }; export default Paypal;             ... View more
Paypal Logo
  • Help
  • Contact Us
  • Security
  • Fees
  • © 1999-2025 PayPal, Inc. All rights reserved.
  • Privacy
  • Legal
  • Cookies
  • Policy Updates

The money in your balance is eligible for pass-through FDIC insurance.

The PayPal Cash Mastercard is issued by The Bancorp Bank pursuant to a license by Mastercard International Incorporated. The Bancorp Bank; Member FDIC.

Powered by Khoros