Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Page Properties

...

externalUrlhttps://gini.atlassian.net/wiki/spaces/IBSV/pages/10092874/Receive+Payment+Requests
color#C5FFEF
filterSpacefalse
destinationexternalUrl
textColorPaletteDefault
titleReceive Payment Requests
bodyReceiving and handling payment requests.
textColor#000000
targettrue
layoutSimple
selectedUrlhttps://gini.atlassian.net/wiki/spaces/IBSV/pages/10092874/Receive+Payment+Requests
idbwpdzofvtf6
backgroundColorPaletteDefault
Cfm card
externalUrlhttps://gini.atlassian.net/wiki/spaces/IBSV/pages/21954901/Fetch+Payment+Information
color#C5FFEF
filterSpacefalse
destinationexternalUrl
textColorPaletteDefault
titleFetch Payment Information
bodyReturning the recipient, IBAN, amount and purpose fields.
textColor#000000
targettrue
layoutSimple
selectedUrlhttps://gini.atlassian.net/wiki/spaces/IBSV/pages/21954901/Fetch+Payment+Information
idmpczp517hh
backgroundColorPaletteDefault
Cfm card
externalUrlhttps://gini.atlassian.net/wiki/spaces/IBSV/pages/10125728/Resolve+Payment+Requests
color#C5FFEF
filterSpacefalse
destinationexternalUrl
textColorPaletteDefault
titleResolve Payment Requests
bodyEnabling your app to redirect.
textColor#000000
targettrue
layoutSimple
selectedUrlhttps://gini.atlassian.net/wiki/spaces/IBSV/pages/10125728/Resolve+Payment+Requests
id8d0m9dvajw3
backgroundColorPaletteDefault

...

hiddentrue

Status

Status
colourGreen
titleapproved

Approver

Nadzeya Karaban

  1. After initializing GiniBankAPI and GiniBank, get the paymentRequestID in AppDelegate. For handling incoming URLs, use the code snippet:

Code Block
languageswift
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
titlereceivePaymentRequestId(url:completion:)

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

Code Block
languageswift
public func receivePaymentRequestId(url: URL, completion: @escaping (Result<String, GiniBankError>) -> Void)

url

The incoming url from the business app

completion

An action for processing asynchronous data received from the service with Result type as a paramater. Result is a value that represents either a success or a failure, including an associated value in each case. In success case it includes payment request ID. In case of failure error that there is no requestID in incoming url from the business app.

  1. After receiving the payment request ID, you can get fetch the payment information:

    Code Block
    languageswift
    bankSDK.receivePaymentRequest(paymentRequestId: appDelegate.paymentRequestId)

    The method above returns the completion block with the struct PaymentRequest, which includes recipient, IBAN, amount, and purpose fields.

  2. The following method returns the completion block with the struct ResolvedPaymentRequest, which includes requesterUri for redirecting back to the payment requester’s app.

    Code Block
    languageswift
    bankSDK.resolvePaymentRequest(paymentRequesId: appDelegate.paymentRequestId,
                                     paymentInfo: paymentInfo)
  3. If the payment request is successfully resolved, let the user redirect back to the payment requester app:

    Code Block
    languageswift
    bankSDK.returnBackToBusinessAppHandler(resolvedPaymentRequest: resolvedPayment)