Work with Payment Requests
After initializing
GiniBankAPI
andGiniBank
, get thepaymentRequestID
inAppDelegate
. For handling incoming URLs, use the code snippet:
func application(_ app: UIApplication,
open url: URL,
options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {
receivePaymentRequestId(url: url) { result in
switch result {
case let .success(requestId):
self.paymentRequestId = requestId
case .failure:
break
}
}
return true
}
After receiving the payment request ID, you can get fetch the payment information:
bankSDK.receivePaymentRequest(paymentRequestId: appDelegate.paymentRequestId)
The method above returns the completion block with the struct
PaymentRequest
, which includes recipient, IBAN, amount, and purpose fields.The following method returns the completion block with the struct
ResolvedPaymentRequest
, which includesrequesterUri
for redirecting back to the payment requester’s app.If the payment request is successfully resolved, let the user redirect back to the payment requester app:
Â