Creating transactions

Include the Android Pay nonce in the Braintree::Transaction.sale() call on your server:

Ruby
Click to copy
Copied
result = Braintree::Transaction.sale(
  :amount => "10.00",
  :payment_method_nonce => params[:payment_method_nonce],
)
if result.success?
  "Success ID: #{result.transaction.id}"
else
  result.message
end
important

We recommend using Android Pay nonces only for creating one-time transactions. Subsequent transactions will fail to process if you add an Android Pay nonce as a customer's payment method for future transactions or subscriptions. If you are interested in using Android Pay for subscriptions, contact our Support team.

Next: Testing and Go Live →

Still have questions?

If you can’t find an answer, contact our Support team.