...
...
...
...
Page Properties | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
|
After initializing
GiniBankAPI
andGiniBank
, get the paymentrequestID
inAppDelegate
. For handling incoming URLs, use the code snippet:
Code Block | ||
---|---|---|
| ||
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
} |
Expand | |||||||||
---|---|---|---|---|---|---|---|---|---|
| |||||||||
Getting the payment request ID from the incoming URL should be called inside function: func application(_ application: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any] = [:] ) -> Bool
|
After receiving the payment request ID, you can get fetch the payment information:
Code Block language swift 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.Code Block language swift bankSDK.resolvePaymentRequest(paymentRequesId: appDelegate.paymentRequestId, paymentInfo: paymentInfo)
If the payment request is successfully resolved, let the user redirect back to the payment requester app:
Code Block language swift bankSDK.returnBackToBusinessAppHandler(resolvedPaymentRequest: resolvedPayment)