Braintree. Testing. TestTransaction
(Braintree v0.17.0)
Create transactions for testing purposes only.
Transition to settled, settlement_confirmed, or settlement_declined states.
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
Functions
@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
{:ok, transaction} = TestTransaction.settle(transaction_id: "123")
transaction.status # "settled"
@spec settlement_confirm(String.t()) :: {:ok, any()} | {:error, Braintree.ErrorResponse.t()}
Use a transaction_id to transition to settled_confirmed status
Example
{:ok, transaction} = TestTransaction.settlement_confirm(
transaction_id: "123")
transaction.status # "settlement_confirmed"
@spec settlement_decline(String.t()) :: {:ok, any()} | {:error, Braintree.ErrorResponse.t()}
Use a transaction_id to transition to settlement_declined status
Example
{:ok, transaction} = TestTransaction.settlement_decline(
transaction_id: "123")
transaction.status # "settlement_declined"