SwedbankpayCheckout.Client.Psp.PaymentOrders (swedbankpay_checkout v0.2.0) View Source

payment order methods, require a Tesla.Env.client(), see SwedbankpayCheckout.create_client/4.

Link to this section Summary

Functions

Perform a cancellation, takes as input the response from SwedbankpayCheckout.Client.Psp.PaymentOrders.get_payment_order/2, and the actual request body.

Perform a capture, takes as input the response from SwedbankpayCheckout.Client.Psp.PaymentOrders.get_payment_order/2, and the actual request body.

Create a payment order, for displaying the payment menu view.

Get a payment order, the payment_order_id should be the full id, with paths, not truncated to the UUID

Perform a reversal, takes as input the response from SwedbankpayCheckout.Client.Psp.PaymentOrders.get_payment_order/2, and the actual request body.

Link to this section Functions

Link to this function

cancel_payment_order(client, order_response, request_body)

View Source

Specs

Perform a cancellation, takes as input the response from SwedbankpayCheckout.Client.Psp.PaymentOrders.get_payment_order/2, and the actual request body.

Swedbank does no recommend assuming any structure for these urls, as such we require the both the operations and payment_order fields of PaymentOrders.PostResponse.t()

This function will return an error if the action is invalid, for example if :capture is called on a payment type that isn't two-step (Vipps or Swish) or if the action to operation translation in this function is out of date

Link to this function

capture_payment_order(client, order_response, request_body)

View Source

Specs

Perform a capture, takes as input the response from SwedbankpayCheckout.Client.Psp.PaymentOrders.get_payment_order/2, and the actual request body.

Swedbank does no recommend assuming any structure for these urls, as such we require the both the operations and payment_order fields of PaymentOrders.PostResponse.t()

This function will return an error if the action is invalid, for example if :capture is called on a payment type that isn't two-step (Vipps or Swish) or if the action to operation translation in this function is out of date

Link to this function

create_payment_order(client, request_body)

View Source

Specs

Create a payment order, for displaying the payment menu view.

Link to this function

get_payment_order(client, payment_order_id)

View Source

Specs

get_payment_order(Tesla.Env.client(), String.t()) ::
  {:ok, SwedbankpayCheckout.Client.Psp.PaymentOrders.OrderResponse.t()}
  | {:error, Tesla.Env.t()}
  | {:error, {String.t(), Tesla.Env.t()}}

Get a payment order, the payment_order_id should be the full id, with paths, not truncated to the UUID

Link to this function

reverse_payment_order(client, order_response, request_body)

View Source

Specs

Perform a reversal, takes as input the response from SwedbankpayCheckout.Client.Psp.PaymentOrders.get_payment_order/2, and the actual request body.

Swedbank does no recommend assuming any structure for these urls, as such we require the both the operations and payment_order fields of PaymentOrders.PostResponse.t()

This function will return an error if the action is invalid, for example if :capture is called on a payment type that isn't two-step (Vipps or Swish) or if the action to operation translation in this function is out of date