...
Page Properties |
---|
...
externalUrl | https://gini.atlassian.net/wiki/spaces/IBSV/pages/10092874/Receive+Payment+Requests |
---|---|
color | #C5FFEF |
filterSpace | false |
destination | externalUrl |
textColorPalette | Default |
title | Receive Payment Requests |
body | Receiving and handling payment requests. |
textColor | #000000 |
target | true |
layout | Simple |
selectedUrl | https://gini.atlassian.net/wiki/spaces/IBSV/pages/10092874/Receive+Payment+Requests |
id | bwpdzofvtf6 |
backgroundColorPalette | Default |
Cfm card | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
| ||||||||||
|
After initializing
GiniBankAPI
andGiniBank
, get thepaymentRequestID
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)