Skip to end of banner
Go to start of banner

Work with Payment Requests

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Current »

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:

  1. Extract the payment request ID from the intent with getRequestId():

    val requestId = getRequestId(intent)
  2. Retrieve the payment details set by other Gini SDKs (like the Gini Health SDK) using GiniBank.getPaymentRequest():

    val paymentRequest: PaymentRequest = giniBank.getPaymentRequest(requestId)
  3. Show the payment details to your user:

    showPaymentDetails(
        paymentRequest.recipient,
        paymentRequest.iban,
        paymentRequest.bic,
        paymentRequest.amount,
        paymentRequest.purpose
    )
  4. After the user initiates the payment, mark the payment request as paid, using GiniBank.resolvePaymentRequest():

    // 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)
  5. Let your user return to the app that started the flow using GiniBank.returnToPaymentInitiatorApp():

    giniBank.returnToPaymentInitiatorApp(context, resolvedPayment)
  • No labels