Braintree.Testing.TestTransaction (Braintree v0.13.0)
Create transactions for testing purposes only.
Transition to settled, settlement_confirmed, or settlement_declined states.
Link to this section Summary
Functions
Use a transaction_id
to transition to settled status. This
allows for testing of refunds.
Use a transaction_id
to transition to settled_confirmed status
Use a transaction_id
to transition to settlement_declined status
Link to this section Functions
settle(transaction_id)
@spec settle(String.t()) :: {:ok, any()} | {:error, Braintree.ErrorResponse.t()}
Use a transaction_id
to transition to settled status. This
allows for testing of refunds.
example
Example
= TestTransaction.settle(transaction_id: "123")
transaction.status # "settled"
settlement_confirm(transaction_id)
@spec settlement_confirm(String.t()) :: {:ok, any()} | {:error, Braintree.ErrorResponse.t()}
Use a transaction_id
to transition to settled_confirmed status
example
Example
= TestTransaction.settlement_confirm( transaction_id: "123")
transaction.status # "settlement_confirmed"
settlement_decline(transaction_id)
@spec settlement_decline(String.t()) :: {:ok, any()} | {:error, Braintree.ErrorResponse.t()}
Use a transaction_id
to transition to settlement_declined status
example
Example
= TestTransaction.settlement_decline( transaction_id: "123")
transaction.status # "settlement_declined"