Having a special Braintree form with CB and PayPal

We don't want to use the Braintree eyebrow shape to stick with our UI. So far, our payment form has worked fine with only CC fields. We created the braintree.js file:

braintree.setup(token, "custom", {
  id: "options"
});

      

Then PayPal came along and we added the PayPal container to the setup:

braintree.setup(token, "custom", {
  id: "options",
  paypal: {
    container: "paypal-button"
  }
});

      

Everything worked locally until last Saturday. Digging, I found out that payment_method_nonce was no longer sent to the server when filling in the CC fields: missing nonce server side

although the nonce input is present on the client side in my form !!! enter image description here

And what is there? Is braintree.js interacting with form submission in some way? Why is this payment_method_nonce sometimes retrieved on the server side (when paying with PayPal) and sometimes not (when paying with CC)?

thank

+3


source to share


2 answers


Okay, it turns out that the problem was on Braintree's side.



Using https://js.braintreegateway.com/v2/braintree.js with braintree.js version greater than 2.2.4 solves the problem.

0


source


You're almost there. You need to use "custom" as the integration method when you use your own credit card form with an additional PayPal button:



braintree.setup(token, "custom", {
  id: "options",
  paypal: {
    container: "paypal-button"
  }
});

      

+2


source







All Articles