简体   繁体   中英

Braintree - can't generate paymentMethodNonce without braintree.dropin lib

There is a thing, when using braintree php sdk, I saw that there is no server to server integration, there is like you need to use js library - braintree.dropin to generate payment_method_nonce (token) data string. This token is used to perform the other sale operations. Also, there is no clear documentation how to implement the server to server based functionality, without using js libs, just passing all the payment data to backend. Atm, I am just scanning the whole braintree sdk to find the needed things, but maybe you already know a bit of this?

Full disclosure, I work at Braintree. If you have any additional questions, I recommend contacting support

Braintree is a full-stack payments solution that requires utilizing both the client-side and server-side SDKs. Braintree only offers tokenization via the client-side SDKs. In the interest of security, Braintree doesn't offer a server-to-server integration, as it would instantly increase your scope of PCI Compliance .

However, if you are willing to take the burden of PCI compliance, you can perform the server-side API requests without a client-side by sending raw credit card details in the requests. Here's an example of creating a transaction with card details from the testing docs (in Ruby):

result = gateway.transaction.sale(
  :credit_card => {
    :number => "4111111111111111",
    :expiration_date => "02/20",
    :cvv => "123"
  },
  :amount => "10.00"
)

As I mentioned, this will likely instantly increase your PCI Compliance scope and is typically not recommended. It's definitely encouraged to use one of Braintree's client-side SDKs to tokenize the details and send them to your server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM