Quantcast
Channel: Active questions tagged paypal - Stack Overflow
Viewing all articles
Browse latest Browse all 514

PayPal Vaulting: billingToken is null in onApprove response

$
0
0

I am trying to vault a card using PayPal’s PayPalButtons, but I am not receiving the billingToken in the onApprove response.

What I Have Tried:I have enabled Vaulting in the PayPal Developer Dashboard, and my PayPal integration looks like this:

  1. Frontend Code (React, PayPal Buttons)
<PayPalScriptProvider options={{ clientId: "test", components: "buttons", currency: "USD", intent: "capture", vault: true }}><PayPalButtons createOrder={(data, actions) => {   return actions.order.create({     purchase_units: [{ amount: { value: "9.99" } }],   }); }} onApprove={(data, actions) => {   console.log("Order Approved:", data);   if (!data.billingToken) {     console.error("No billingToken received!");   }   return actions.order.capture().then((details) => {     console.log("Capture Details:", details);   }); }}/></PayPalScriptProvider>
  1. Expected Behavior:data.billingToken should contain a vault token that I can send to my backend.

I should be able to store this token and charge the user later.

  1. Actual Behavior (Issue)billingToken is always null.

The onApprove response looks like this:

{"orderID": "3L820413VH915090N","payerID": "E3T6H4CYL8AZ8","paymentID": "3L820413VH915090N","billingToken": null,"facilitatorAccessToken": "XXXXXXXXXXXX",}
  1. Things I Have Checked:

    Vaulting is enabled in my PayPal Developer Dashboard.

    Tried setting { vault: true }, but it's no longer a valid prop in PayPalButtons.

    Verified that my PayPal account supports Vaulting.

  2. Question:

    Why is billingToken always null?

    How do I properly vault a card and get the token in the response?

    Is there a new way to vault payments in the latest PayPal API?

Any help would be greatly appreciated!


Viewing all articles
Browse latest Browse all 514

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>