LogoLogo
Developer Hub
Developer Hub
  • 📍Documentation
    • 🏂Onboarding
  • PayContactless
    • PayContactless Embed
  • 📱MERCHANT EMBED SDK
    • PayContactless Embed SDK
      • Getting Started
      • SDK API Reference
        • Initialize
        • Pay With Card
          • Sale
          • Refund
          • Pre&Post Auth
        • Pay With Link
        • Pay With Account
        • Transactions History
        • Transactions Detail
        • Send Receipt
        • Daily Transactions Summary
        • Error Handling
    • Security Mechanisms
    • Production Preparation
      • Play Integrity Configuration
      • Firebase Crashlytics Configuration
      • Firebase Push Notification Configuration
  • 📱CUSTOMER ACCOUNT BASE EMBED SDK
    • Account Base Embed SDK
      • Getting Started
      • SDK API Reference
  • 💻BACKEND INTEGRATION
    • API Specification
  • 🔐Security
Powered by GitBook
On this page
  • Transaction Listener
  • Transaction Result
  • Transaction Data
  1. MERCHANT EMBED SDK
  2. PayContactless Embed SDK
  3. SDK API Reference

Pay With Account

Utilizing the doPayWithAccount Method in the PayContactless Embed SDK

Overview: The doPayWithAccount method of the PayContactless Embed SDK is a pivotal function for executing Bluetooth based transactions between merchant application and customer application.

Parameters:

  1. Amount:

    • Description: Denotes the transaction's value as specified by the user.

    • Constraints:

      • Should be a whole number, with its length capped at 12 digits.

      • Do not exclude decimal separators.

    • Examples:

      • A payment amount of $1.01 should be passed as 1.01

  2. Description:

    • Description: Provides contextual information detailing the purpose or reason behind the payment. It could relate to the product/service name, a brief summary, or any relevant description the merchant deems necessary.

  3. Currency Code

    • Description: The currecy value of the transaction. It has be numeric code of ISO 4217 format.

    • Examples:

      • 566 for Naira instead of NGN

  4. Activity

    • Description: The current activity. Payment page is started as a new activity. In order to start payment activity Embed SDK needs the current acitivity of the app.

  5. RFU Map

    • Description: RFUMap (Reserved for future use) object is used to transfer key value pairs between backend system and merchant application

  6. TransactionResultListener:

    • Description: This interface is vital as it captures and manages transaction outcomes, be it success or failure scenarios.

Usage: To implement the doPayWithAccount function in your application, ensure you're capturing the correct parameters, especially the format for the "Amount" and supplementing the necessary information in the "Description."

By adhering to these guidelines, you enable a precise and seamless transaction process, elevating the user experience within your application.

PayContactlessEmbed.getInstance().doPayWithAccount(@NonNull Double amount, @Nullable String currencyCode, @NonNull FragmentActivity activity, @Nullable Map<String, String> rfuMap, @NonNull TransactionResultListener listener)

Please set empty map value for rfuMap instead of null on SDK version 3.4.12. This issue will be fixed with the next version.

If currency parameter is set null, the default currency is used for transaction. The default currecny is Naira in SDK.

When a transaction is completed, the TransactionResult class is received on onCompleted method, these class fields can be used for the payment result screens.

Transaction Listener

public interface TransactionResultListener {
   void onCompleted(TransactionResult transaction);
}

Transaction Result

data class TransactionResult(
    var paymentType: String?,
    var status: String,
    var payWithCardResult: Transaction? = null,
    var payWithAccountResult: FinishTrx? = null,
    var payWithLinkResult: PayWithLinkResult? = null
    var error : ErrorData? = null
)

Field Names
Field Descriptions
Values

Payment Type

return the data in which method in use for this transaction

object PaymentType {

const val CARD = "Card"

const val PAY_WITH_CARD = "PayWithCard"

const val ACCOUNT = "PayWithAccount" const val PAY_WITH_LINK = "PayWithLink"

const val QR = "QR"

const val USSD = "USSD"

}

Status

result of the transaction request

object TransactionResult {

const val SUCCESS = "Success"

const val FAIL = "Fail"

const val CANCEL = "Cancel"

const val TIMEOUT = "Timeout"

}

PayWithCardResult

Returns only after completing tap with card payment

PayWithLinkResult

Returns only after completing link payment

Error

Check 6.1 Error Handling section

Transaction Data

data class FinishTrx(
    val transactionCode: String = "",
    val name: String = "",
    val transactionId: Long,
    var finishHash: String? = null,
    var transactionReference: String = "",
    var time: Long
)
Field Names
Descriptions
Sample Values

transactionCode

a unique transaction code

'123456F3'

name

Business Name

'ABC Venture'

transactionId

a unique id of the transaction.

129762

finishHash

Transaction acknowledgment hash value from the customer device paired.

'453FFS393922..'

transactionReference

transaction reference number

'342244DFRE'

time

transaction date “dd-MM-yyyy HH:mm:ss”

'10-11-2023 12:55:30'

There is timeout value which is 30 seconds in bluetooth connection page. When the timeout exceed, SDK will call onComplete callback with Timeout status.

PreviousPay With LinkNextTransactions History

Last updated 8 days ago

📱