See also the Braintree::Transaction response object.

Cloning a transaction will create a new transaction by copying all the attributes, except amount, of the original transaction. Instead of cloning transactions, a better practice in most cases is to use the Vault to save and reuse payment method or customer information.

important

You must include an amount and an option flag to submit the transaction for settlement.

Ruby
Copy
Copied
result = Braintree::Transaction.clone_transaction("transaction_id",
  :amount => "10.00",
  :options => {
    :submit_for_settlement => true
  }
)

If the transaction can't be found, it will raise a Braintree::NotFoundError.

Arguments
transaction_id required, String

The unique transaction identifier. You can only clone non-PayPal transactions that have a status of authorized, authorization_expired, voided, submitted_for_settlement, or settled. Processor declined, gateway rejected, and failed transactions can't be cloned.

Additional Parameters
:amount required, BigDecimal or String

The amount of the cloned transaction. This value must be greater than 0, and must match the appropriate currency format.

:options required

Values passed with a request.

:submit_for_settlement required, bool

Whether to submit the transaction for settlement once authorization succeeds.

Still have questions?

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