...
Page Properties |
---|
...
externalUrl | https://gini.atlassian.net/wiki/spaces/GBSV/pages/10092860/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/GBSV/pages/10092860/Receive+Payment+Requests |
id | 4z31lisx0kq |
backgroundColorPalette | Default |
Cfm card | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Cfm card | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
...
| ||||||||||
|
Find an example implementation in the example app’s pay package.
When your activity is launched with intent, follow these steps to receive and handle the payment request:
Extract the payment request ID from the intent with
getRequestId()
:Code Block language kotlin val requestId = getRequestId(intent)
Retrieve the payment details set by other Gini SDKs (like the Gini Health SDK) using
GiniBank.getPaymentRequest()
:Code Block language kotlin val paymentRequest: PaymentRequest = GiniBank.getPaymentRequest(requestId)
Show the payment details to your user:
Code Block language kotlin showPaymentDetails( paymentRequest.recipient, paymentRequest.iban, paymentRequest.bic, paymentRequest.amount, paymentRequest.purpose )
After the user initiates the payment, mark the payment request as paid, using
GiniBank.resolvePaymentRequest()
:Code Block language kotlin // The actual payment details used for the payment (as corrected and accepted by the user). val usedPaymentDetails = ResolvePaymentInput( recipient = "...", iban = "...", bic = "...", amount = "...", purpose = "..." ) val resolvedPayment: ResolvedPayment = GiniBank.resolvePaymentRequest(requestId, usedPaymentDetails)
Let your user return to the app that started the flow using
GiniBank.returnToPaymentInitiatorApp()
:Code Block language kotlin GiniBank.returnToPaymentInitiatorApp(context, resolvedPayment)