Braintree - paymentMethodNonceReceived not being invoked

后端 未结 3 2107
甜味超标
甜味超标 2021-01-02 11:30

I have setup dropin UI for braintree. I can see the UI fine. Before that I created the customer and I can see the customer on braintree-sandbox. Now I want to add payment me

3条回答
  •  庸人自扰
    2021-01-02 12:04

    I am using below JavaScript and its working fine:

      braintree.setup(clientToken, "custom", {
        id: "my-sample-form",
        hostedFields: {
          number: {
            selector: "#card-number"
          },
          cvv: {
            selector: "#cvv"
          },
          expirationMonth: {
            selector: "#expiration-month"
          },
          expirationYear: {
            selector: "#expiration-year"
          },
        },onPaymentMethodReceived:function(nonce){
            console.log(JSON.stringify(nonce));
            return false;
    
      }
        }
    
              ); 
    

    Above gives below response and DOES NOT submit the form:

    {"nonce":"ff2662e1-f1fd-42a3-a16f-d8f3213a2406","details":{"lastTwo":"11","cardType":"Visa"},"type":"CreditCard"}
    

    means use onPaymentMethodReceived instead of paymentMethodNonceReceived

    Thanks http://www.web-technology-experts-notes.in/2015/06/braintree-payment-gateway-integration.html

提交回复
热议问题