View Source ExCashfreeSDK.PaymentGateway.Payments (ExCashfreeSDK v0.1.5)

Payments APIs implementation for Cashfree SDK

Summary

Types

@type otp_action() :: :SUBMIT_OTP | :RESEND_OTP
@type preauth_action() :: :CAPTURE | :VOID

Functions

Link to this function

order_pay(payment_session_id, payment_method, offer_id \\ "")

View Source
@spec order_pay(String.t(), map(), String.t()) :: {:ok, any()}
Link to this function

payment(order_id, cf_payment_id)

View Source
@spec payment(String.t(), String.t()) :: {:ok, any()}
Link to this function

payment_for_order(order_id)

View Source
@spec payment_for_order(String.t()) :: {:ok, any()}
Link to this function

preauthorization(order_id, action, amount)

View Source
@spec preauthorization(String.t(), preauth_action(), float()) ::
  {:ok, any()} | {:error, any()}
Link to this function

submit_or_resend_otp(cf_payment_id, action, otp \\ "")

View Source
@spec submit_or_resend_otp(String.t(), otp_action(), String.t()) ::
  {:ok, any()} | {:error, any()}

If you accept OTP on your own page, you can use the below API to send OTP to Cashfree.

Examples

iex> ExCashfreeSDK.PaymentGateway.submit_or_resend_otp("cf_payment_id", :SUBMIT_OTP, "123456")
{:ok, %{}}