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

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

Link to this function

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

Link to this function

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

Link to this function

find(client, id, params \\ %{})

Specs

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

Link to this function

list(client, params \\ %{})

Specs

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