Mollie.Payments (mollie v0.7.2)
Payment creation is elemental to the Mollie API: this is where most payment implementations start off.
Once you have created a payment, you should redirect your customer to the URL in the _links.checkout
property from the response.
Link to this section Summary
Functions
Cancels a payment.
Creates a single payment.
Retrieve a single payment object by its payment token.
Retrieve all payments created with the current website profile, ordered from newest to oldest. Results are paginated.
Link to this section Functions
cancel(client, id, params \\ %{})
Specs
cancel(Mollie.Client.t(), binary(), map()) :: Mollie.response()
Cancels a payment.
example
Example
Mollie.Payments.cancel client, "tr_7UhSN1zuXS"
More info at: https://docs.mollie.com/reference/v2/payments-api/cancel-payment
create(client, body)
Specs
create(Mollie.Client.t(), map() | list()) :: Mollie.response()
Creates a single payment.
Payment body example
%{
"amount" => %{
"currency" => "USD",
"value" => "100.00"
},
"description" => "Blue suede shows",
"redirectUrl" => "https://shop.example.com/checkout"
}
example
Example
Mollie.Payments.create client, payment_body
More info at: https://docs.mollie.com/reference/v2/payments-api/create-payment
find(client, id, params \\ %{})
Specs
find(Mollie.Client.t(), binary(), map()) :: Mollie.response()
Retrieve a single payment object by its payment token.
example
Example
Mollie.Payments.find client, "tr_7UhSN1zuXS"
More info at https://docs.mollie.com/reference/v2/payments-api/get-payment
list(client, params \\ %{})
Specs
list(Mollie.Client.t(), map()) :: Mollie.response()
Retrieve all payments created with the current website profile, ordered from newest to oldest. Results are paginated.
examples
Examples
Mollie.Payments.list client
Mollie.Payments.list client, %{limit: 100, from: "tr_7UhSN1zuXS"}
More info at: https://docs.mollie.com/reference/v2/payments-api/list-payments