Payment
public final class Payment
Payment API
Note
Domestic instant payments, international payments, and scheduled payments are all accomplished from the same /payments endpoint. The payment type is automatically identified by our system depending whether the debtor and creditor accounts are from different countries (for international payments), or whether a value has been set for the scheduled_for parameter (meaning a scheduled payment).-
Opens bank application or bank website using with
id
andurl (payment_url)
of Payment.Note
This method does not require authentication.
Declaration
Swift
func open(id: String, url: URL, completion: @escaping (Result<PayByBankResult, PayByBankError>) -> Void)
Parameters
id
A system assigned unique identification for the Payment.
completion
It provides to handle
PayByBankResult
orPayByBankError
. -
Opens bank application or bank website using with
id
of Payment.Note
This method requires authentication.
Declaration
Swift
func open(id: String, completion: @escaping (Result<PayByBankResult, PayByBankError>) -> Void)
Parameters
id
A system assigned unique identification for the Payment.
completion
It provides to handle
PayByBankResult
orPayByBankError
. -
Opens bank application or bank website using with request model of Payment.
Note
This method requires authentication.
Declaration
Swift
func initiate(request: PaymentCreateRequest, completion: @escaping (Result<PayByBankResult, PayByBankError>) -> Void)
Parameters
request
Instance’s
PaymentCreateRequest
, which is request model to create Payment.completion
It provides to handle
PayByBankResult
orPayByBankError
. -
Opens bank application or bank website using with request model of refund of Payment.
Note
This method requires authentication.
Declaration
Swift
func initiateRefund(request: PaymentCreateRefundRequest, completion: @escaping (Result<PayByBankResult, PayByBankError>) -> Void)
Parameters
request
Instance’s
PaymentCreateRefundRequest
, which is request model to create refund of Payment.completion
It provides to handle
PayByBankResult
orPayByBankError
. -
Creates Payment.
Note
This method requires authentication.
Declaration
Swift
func createPayment(request: PaymentCreateRequest, completion: @escaping (Result<PaymentCreateResponse, PayByBankError>) -> Void)
Parameters
request
Instance’s
PaymentCreateRequest
, which is request model to create Payment.completion
It provides to handle
PaymentCreateResponse
orPayByBankError
. -
Gets Payments.
Note
This method requires authentication.
Declaration
Swift
func listPayments(request: PaymentListRequest, completion: @escaping (Result<PaymentListResponse, PayByBankError>) -> Void)
Parameters
request
Instance’s
PaymentListRequest
, which is request model to get Payments.completion
It provides to handle
PaymentListResponse
orPayByBankError
. -
Gets Payment detail.
Note
This method requires authentication.
Declaration
Swift
func getPayment(request: PaymentGetRequest, completion: @escaping (Result<PaymentGetResponse, PayByBankError>) -> Void)
Parameters
request
Instance’s
PaymentGetRequest
, which is request model to get details of Payment.completion
It provides to handle
PaymentGetResponse
orPayByBankError
. -
Checks availability of Payment url.
Note
This method requires authentication.‘url-consumed’ endpoint checks whether the bank’s payment url has been visited by the PSU. Return’s true if the PSU has logged in to the banking system for this payment. In such case either wait for the PSU to finish the journey, or create a new payment.
Declaration
Swift
func checkPaymentURL(request: PaymentCheckURLRequest, completion: @escaping (Result<PaymentCheckURLResponse, PayByBankError>) -> Void)
Parameters
request
Instance’s
PaymentCheckURLRequest
, which is request model to check availability of Payment url.completion
It provides to handle
PaymentCheckURLResponse
orPayByBankError
. -
Creates refund for given payment
Note
This method requires authentication.
Declaration
Swift
func createRefund(request: PaymentCreateRefundRequest, completion: @escaping (Result<PaymentCreateRefundResponse, PayByBankError>) -> Void)
Parameters
request
Instance’s
PaymentCreateRefundRequest
, which is request model to create refund for given Payment.completion
It provides to handle
PaymentCreateRefundResponse
orPayByBankError
.