View Source Hyperswitch.Payments (hyperswitch v0.1.0)

Link to this section Summary

Functions

A Payment could can be cancelled when it is in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_customer_action.

To capture the funds for an uncaptured payment.

This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments Create API.

To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture.

To create the session object or to get session token for wallets.

To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment.

To list the payments.

To update the properties of a PaymentIntent object. This may include attaching a payment method, or attaching customer object or metadata fields after the Payment is created.

Link to this section Types

@type cancel_payment_body() :: %{cancellation_reason: binary()}
Link to this type

cancel_payment_response()

View Source
@type cancel_payment_response() :: Hyperswitch.Client.response()
Link to this type

capture_payment_body()

View Source
@type capture_payment_body() :: %{
  merchant_id: merchant_id(),
  amount_to_capture: integer(),
  refund_uncaptured_amount: boolean(),
  statement_descriptor_suffix: binary(),
  statement_descriptor_prefix: binary()
}
Link to this type

capture_payment_response()

View Source
@type capture_payment_response() :: Hyperswitch.Client.response()
Link to this type

confirm_payment_body()

View Source
@type confirm_payment_body() :: map()
Link to this type

confirm_payment_response()

View Source
@type confirm_payment_response() :: Hyperswitch.Client.response()
Link to this type

create_payment_params()

View Source
@type create_payment_params() :: map()
Link to this type

create_payment_response()

View Source
@type create_payment_response() :: Hyperswitch.Client.response()
Link to this type

create_payment_session_token_body()

View Source
@type create_payment_session_token_body() :: %{
  payment_id: binary(),
  client_secret: binary(),
  wallets: :paypal | :apple_pay | :klarna | :gpay
}
Link to this type

create_payment_session_token_response()

View Source
@type create_payment_session_token_response() :: Hyperswitch.Client.response()
@type get_payment_params() :: map()
Link to this type

get_payment_response()

View Source
@type get_payment_response() :: Hyperswitch.Client.response()
Link to this type

list_payments_params()

View Source
@type list_payments_params() :: keyword()
Link to this type

list_payments_response()

View Source
@type list_payments_response() :: Hyperswitch.Client.response()
@type merchant_id() :: binary()
@type payment_id() :: binary()
@type update_payment_body() :: map()
Link to this type

update_payment_response()

View Source
@type update_payment_response() :: Hyperswitch.Client.response()

Link to this section Functions

Link to this function

cancel_payment(payment_id, body)

View Source
@spec cancel_payment(payment_id(), cancel_payment_body()) :: cancel_payment_response()

A Payment could can be cancelled when it is in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_customer_action.

Link to this function

capture_payment(payment_id, body)

View Source
@spec capture_payment(payment_id(), capture_payment_body()) ::
  capture_payment_response()

To capture the funds for an uncaptured payment.

Link to this function

comfirm_payment(payment_id, body)

View Source
@spec comfirm_payment(payment_id(), confirm_payment_body()) ::
  confirm_payment_response()

This API is to confirm the payment request and forward payment to the payment processor. This API provides more granular control upon when the API is forwarded to the payment processor. Alternatively you can confirm the payment within the Payments Create API.

@spec create_payment(create_payment_params()) :: create_payment_response()

To process a payment you will have to create a payment, attach a payment method and confirm. Depending on the user journey you wish to achieve, you may opt to all the steps in a single request or in a sequence of API request using following APIs: (i) Payments - Update, (ii) Payments - Confirm, and (iii) Payments - Capture.

Link to this function

create_payment_session_token(body)

View Source

To create the session object or to get session token for wallets.

Link to this function

get_payment(payment_id, body)

View Source
@spec get_payment(payment_id(), get_payment_params()) :: get_payment_response()

To retrieve the properties of a Payment. This may be used to get the status of a previously initiated payment or next action for an ongoing payment.

Link to this function

list_payments(params \\ [])

View Source
@spec list_payments(list_payments_params()) :: list_payments_response()

To list the payments.

Link to this function

update_payment(payment_id, body)

View Source
@spec update_payment(payment_id(), update_payment_body()) :: update_payment_response()

To update the properties of a PaymentIntent object. This may include attaching a payment method, or attaching customer object or metadata fields after the Payment is created.