6

I've built a Ruby on Rails API that process payments through Braintree. For an specific request, I need to edit the "Order ID" field on braintree but I haven't found how to do so. I'm able to load the transaction by doing a:

bt = Braintree::Transaction.find('transaction_id') 

and then I can print the bt.order_id but I don't know how to update that field. For what is worth, at this point the transaction's status is 'Authorized'.

I hope I made myself clear and you can give me a hand on this.

Thanks in advance!

fabianraf
  • 155
  • 7

1 Answers1

-1

When your create a transaction add custom fields:

Docs: Custom fields

Like that:

result = gateway.transaction.sale(
      amount: "10.00",
      payment_method_nonce: nonce_from_the_client,
      options: {
        submit_for_settlement: true
      },
      custom_fields: {
                order_id: "1221XXX"
      }
)
Boris BRESCIANI
  • 527
  • 7
  • 16