Taracque / cordova-plugin-braintree

:credit_card: A Cordova plugin for the Braintree mobile payment processing SDK.
MIT License
27 stars 42 forks source link

Token with Customer ID #37

Closed ktre2017 closed 7 years ago

ktre2017 commented 7 years ago

Can we use this plugin to pass CustomerID and get ClientToken to retrieve saved card details depends on CustomerID?

Please advise.

antkers commented 7 years ago

You should never generate a specific client token on the client app side because you would need to ship out your very personal merchantId, publicKey and privatekey in your client app. Generate it on your server side e.g. web service instead and retrieve it through a secure http get call in your client app. Here's the code and documentation from braintree if you use a node.js (drop down on top for other programming languages) server: https://developers.braintreepayments.com/start/hello-server/node#generate-a-client-token Hope that helps you!