Affirm v0.1.2 Affirm.API
Affirm provides several API endpoints… this module defines functions to interact with the transactional endpoints authorize, capture, void and refund.
For api reference, please visit: https://docs.affirm.com/Integrate_Affirm/Direct_API
Link to this section Summary
Functions
Affirm’s Authorize endpoint requires post data containing a checkout_token
and takes an optional order_id
. If the token is valid, the request will return
a charge_id
that should be saved for future transactions
Capture takes a charge_id
and optional map of post data. Will return a Affirm.Response
struct containing details of the successful capture transaction
Refund takes an optional charge_id
.
Will return an Affirm.Response
struct containing current charge status.
Used to prevent duplicate charge attempts
Refund takes a charge_id
and a map containing a refund amount
.
Will return a Affirm.Response
struct containing details of the successful return transaction
Capture takes a charge_id
. Will return a Affirm.Response
struct containing details of the successful void transaction
Link to this section Functions
authorize(map()) :: {:ok, Affirm.Response.t()} | {:error, String.t()}
Affirm’s Authorize endpoint requires post data containing a checkout_token
and takes an optional order_id
. If the token is valid, the request will return
a charge_id
that should be saved for future transactions.
capture(String.t(), map()) :: {:ok, Affirm.Response.t()} | {:error, String.t()}
Capture takes a charge_id
and optional map of post data. Will return a Affirm.Response
struct containing details of the successful capture transaction.
read(String.t()) :: {:ok, Affirm.Response.t()} | {:error, String.t()}
Refund takes an optional charge_id
.
Will return an Affirm.Response
struct containing current charge status.
Used to prevent duplicate charge attempts.
refund(String.t(), map()) :: {:ok, Affirm.Response.t()} | {:error, String.t()}
Refund takes a charge_id
and a map containing a refund amount
.
Will return a Affirm.Response
struct containing details of the successful return transaction.
void(String.t()) :: {:ok, Affirm.Response.t()} | {:error, String.t()}
Capture takes a charge_id
. Will return a Affirm.Response
struct containing details of the successful void transaction.