Samsung Pay
Server-Side Implementation
Creating transactions
Like all Braintree SDK integrations, you will receive a payment method nonce when your user successfully authorizes payment. Pass this nonce to your server, and create a transaction.
Collect device data from the client and include the deviceDataFromTheClient in the transaction.
- Java
TransactionRequest request = new TransactionRequest()
.amount(new BigDecimal("10.00"))
.paymentMethodNonce(nonceFromTheClient)
.deviceData(deviceDataFromTheClient)
.options()
.submitForSettlement(true)
.done()
.billingAddress()
.postalCode(postalCodeFromTheClient)
.done();
Result<Transaction> result = gateway.transaction().sale(request);
The amount you specify in your client-side payment request object should reflect the actual amount you authorize and submit for settlement; transactions will still process in cases where the amount changes during order fulfillment.
Vaulting Samsung Pay
Samsung Pay cards can only be saved to your Vault for specific use cases; see the support article for details.
If your use case is supported, you can store a customer's Samsung Pay card in your Vault in a few different ways:
- In a separate linkToReferenceRequest 'payment-method' 'create' request
- In a separate linkToReferenceRequest 'customer' 'create' or linkToReferenceRequest 'customer' 'update' request
- In your linkToReferenceRequest 'transaction' 'sale' request by using linkToReferenceRequest 'transaction' 'sale' param='options.store_in_vault' or linkToReferenceRequest 'transaction' 'sale' param='options.store_in_vault_on_success'
Next Page: Testing and Go Live →