Update Order Id of a Braintree transaction
Asked Answered
U

1

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!

Uel answered 11/6, 2018 at 17:0 Comment(3)
What have you tried do far? I presume the regular methods for updating aren't working?Counterblow
I've tried the regular methods and yes, they don't work because there are no set methods for order_id.Uel
@fabianraf, did you find anything? I have the same issue.Fatma
M
0

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"
      }
)
Manx answered 12/6, 2018 at 14:8 Comment(1)
This doesn't solve my problem. I need to update a transaction after it has been created.Uel

© 2022 - 2024 — McMap. All rights reserved.