Search
K
Links

SDK

Initialize

NearPay have two methods for initialization to install the plugin:
  1. 1.
    Add gradle dependency by adding the following code to the your Android App build.gradle
If want to download the plugin from Google Play, use this code
Kotlin and Java
Flutter
React Native
dependencies {
implementation "io.nearpay:nearpay-sdk-store:2.1.64"
}
flutter pub add nearpay_flutter_sdk --git-url=https://github.com/nearpayio/nearpay-flutter-sdk.git --git-ref=v1-google
// after installing the plugin , please import the package
import 'package:nearpay_flutter_sdk/nearpay.dart';
npm install "https://github.com/nearpayio/nearpay-react-native-sdk.git#google" --save
// after installing the plugin , please import the package
import { EmbededNearpay } from '@nearpaydev/react-native-nearpay-sdk';
If you want to download the plugin inside your app
Kotlin and Java
Flutter
React Native
Ionic
dependencies {
implementation "io.nearpay:nearpay-sdk:2.1.64"
}
flutter pub add nearpay_flutter_sdk --git-url=https://github.com/nearpayio/nearpay-flutter-sdk.git --git-ref=v1
// after installing the plugin , please import the package
import 'package:nearpay_flutter_sdk/nearpay.dart';
npm install "https://github.com/nearpayio/nearpay-react-native-sdk.git#main" --save
// after installing the plugin , please import the package
import { EmbededNearpay } from '@nearpaydev/react-native-nearpay-sdk';
npm install @nearpaydev/nearpay-ionic-sdk --save
2.Create single instance of NearPay object with context wherever you need.
Kotlin
Java
Flutter
React Native
Ionic
nearPay = new NearPay.Builder()
.context(this)
.authenticationData(auth)
.environment(Environments.SANDBOX)
.locale(Locale.getDefault())
.networkConfiguration(NetworkConfiguration.SIM_PREFERRED)
.uiPosition(UIPosition.CENTER_BOTTOM)
.paymentText(new PaymentText("يرجى تمرير الطاقة", "please tap your card"))
.loadingUi(true)
.build();
nearPay = new NearPay.Builder()
.context(this)
.authenticationData(auth)
.environment(Environments.SANDBOX)
.locale(Locale.getDefault())
.networkConfiguration(NetworkConfiguration.SIM_PREFERRED)
.uiPosition(UIPosition.CENTER_BOTTOM)
.paymentText(new PaymentText("يرجى تمرير الطاقة", "please tap your card"))
.loadingUi(true)
.build();
final nearpay = Nearpay(
authType: AuthenticationType.email,// [Required] Same as above reference
authValue: "<your email here>",// [Required] Give auth type value
env: Environments.sandbox,// [Required] environment reference
locale: Locale.localeDefault, // [Optional] locale reference
);
nearpay.initialize(onInitializeSuccess: () {
print("nearpay initialized successfully");
}, onInitializeFail: () {
print("nearpay initialize failed");
});
const nearpay = new new EmbededNearpay({
authtype: AuthenticationType.email, //[Required] the user auth type
authvalue: '[email protected]', //[Required] the auth value
environment: Environments.sandbox, // [Required] the payment enviroment
locale: Locale.default, // [Optional]
});
import {
AuthenticationType,
EmbededNearpay,
Environments,
Locale,
} from '@nearpaydev/nearpay-ionic-sdk';
const embededNearpay = new EmbededNearpay({
authtype: AuthenticationType.email, // the Authentication type (Email, mobile, etc)
authvalue: '<Enter Your Email Here>', // the Authentication value
environment: Environments.sandbox, // Transation enviroment
locale: Locale.default, // [Optional] language options
});
// the line bellow is optional, initialization will be done automatically
// only used if you want to add listeners to success and fail
embededNearpay.initialize({
onSuccess: () => {},
onFail: () => {},
});
// (EmbededNearpay) obeject should be created once and served to the wholl application

While creating instance for Nearpay, you need to pass the following:

Context

You need to pass the current context

AuthenticationData (Required)

We have 4 methods for login
1- Login with JWT
AuthenticationData.Jwt("jwt here")
2-Login with existing mobile number
AuthenticationData.Mobile("+966500000000")
3-Login with existing email
AuthenticationData.Email("[email protected]")
4-Let the user enter the mobile number or email to Login
AuthenticationData.UserEnter.INSTANCE
Here is an explanation on how to use client dashboard , you need to add users to terminals so they can use the SDK
User Manual - Client Dashboard.pdf
1MB
PDF
Client Dashboard : https://sandbox.nearpay.io

Locale (Optional)

Locale allows you to select the language to be used.

Environment (Optional)

This will allow you to choose the environments so you need to choose sandbox and we will tell you when it needs to be changed.

UIPosition (Optional)

This will allow you to choose where to show the UI in your screen.

networkConfiguration (Optional)

This will allow you to choose if you wish to choose which network to be used(Sim, Wifi or default).
if the package name of your android project is not registered in NearPay system, you won't be able to communicate with our system.

SDK Flow

Figure 2

Setup (optional)

Setup allows you to install the payment plugin and log in to our app.
if this function is not used, it will be called automatically when you use any other function.
Kotlin
Java
Flutter
React Native
Ionic
nearpay.setup(object : SetupListener{
override fun onSetupCompleted() {
// if you wish to get the receipt in Json format use nearPay.toJson()
TODO("Your Code Here")
}
override fun onSetupFailed(setupFailure: SetupFailure) {
when (setupFailure) {
is SetupFailure.AlreadyInstalled -> {
// when the payment plugin is already installed .
TODO("Your Code Here")
}
is SetupFailure.NotInstalled -> {
// when the installtion failed .
TODO("Your Code Here")
}
is SetupFailure.AuthenticationFailed -> {
// when the authentication failed .
// You can use the following method to update your JWT
nearpay.updateAuthentication(AuthenticationData.Jwt("JWT HERE")
TODO("Your Code Here")
}
is SetupFailure.InvalidStatus -> {
// Please note that you can get the status using setupFailure.status
TODO("Your Code Here")
}
}
}
})
nearPay.setup(new SetupListener() {
@Override
public void onSetupCompleted() {
// when the setup is done successfully
}
@Override
public void onSetupFailed(@NonNull SetupFailure setupFailure) {
if (setupFailure instanceof SetupFailure.AlreadyInstalled) {
// when the payment plugin is already installed .
}
else if (setupFailure instanceof SetupFailure.NotInstalled){
// when the installtion failed .
}
else if (setupFailure instanceof SetupFailure.AuthenticationFailed){
// when the Authentication Failed.
nearPay.updateAuthentication(new AuthenticationData.Jwt("JWT is here"));
}
else if (setupFailure instanceof SetupFailure.InvalidStatus){
// you can get the status using the following code
List<StatusCheckError> status = ((SetupFailure.InvalidStatus) setupFailure).getStatus();
}
}
});
// if you want to install the plugin immediatly after initializing then use the setup method
nearpay.setup()
await nearpay.setup()
embededNearpay.setup()
Find Setup Errors here.

Purchase

Please note the amount should be entered like this 100 which means 1.00 SAR so 1455 will be 14.55 SAR & max length is 12 digits include exponent ( 123456789012 ) which will result in 1,234,567,890.12
You may pass Reference ID in customerReferenceNumber field to be attached to this transaction. or null otherwise.
enableReceiptUi is Boolean so you can set it true or false.
Kotlin
Java
Flutter
React Native
Ionic
val amount : Long = 100 // [Required] ammount you want to set .
val customerReferenceNumber = "9ace70b7-977d-4094-b7f4-4ecb17de6753" //[optional] any number you want to add as a refrence
val enableReceiptUi = true// [optional] true will enable the ui and false will disable
val enableReversal = true // it will allow you to enable or disable the reverse button
val finishTimeOut : Long = 10 // Add the number of seconds
val transactionId = UUID.randomUUID(); // [optional] You can add your UUID here which allows you to ask about the transaction again using the same UUID
val enableUiDismiss = true // [optional] it will allow you to control dismissing the UI
nearpay.purchase(amount, customerReferenceNumber, enableReceiptUi, enableReversal, finishTimeOut, transactionId, enableUiDismiss, object : PurchaseListener{
override fun onPurchaseApproved(transactionData: TransactionData) {
TODO("Your Code Here")
}
override fun onPurchaseFailed(purchaseFailure: PurchaseFailure) {
when (purchaseFailure) {
is PurchaseFailure.PurchaseDeclined -> {
// when the payment declined.
TODO("Your Code Here")
}
is PurchaseFailure.PurchaseRejected -> {
// when the payment is rejected .
TODO("Your Code Here")
}
is PurchaseFailure.AuthenticationFailed -> {
// when the authentication failed .
// You can use the following method to update your JWT
nearpay.updateAuthentication(AuthenticationData.Jwt("JWT HERE")
TODO("Your Code Here")
}
is PurchaseFailure.InvalidStatus -> {
// Please note that you can get the status using purchaseFailure.status
TODO("Your Code Here")
}
is PurchaseFailure.GeneralFailure -> {
// when there is General error .
}
}
}
})
Long amount = 100L; // [Required] ammount you want to set .
String customerReferenceNumber = "9ace70b7-977d-4094-b7f4-4ecb17de6753"; // [optional] any number you want to add as a refrence
Boolean enableReceiptUi = true; // [optional] true will enable the ui and false will disable
Boolean enableReversal = true; // it will allow you to enable or disable the reverse button
Long finishTimeOut = 10L; // Add the number of seconds
UUID transactionId = java.util.UUID.randomUUID(); // You can add your UUID here which allows you to ask about the transaction again using the same UUID
Boolean enableUiDismiss = true ;// [optional] it will allow you to control dismissing the UI
nearPay.purchase(amount, customerReferenceNumber, enableReceiptUi, enableReversal, finishTimeOut,transactionId,enableUiDismiss, new PurchaseListener() {
@Override
public void onPurchaseApproved(@NonNull TransactionData transactionData) {
// if you wish to get the receipt in Json format use ReceiptUtilsKt.toJson(list.get(0))
//write your code here.
}
@Override
public void onPurchaseFailed(@NonNull PurchaseFailure purchaseFailure) {
if (purchaseFailure instanceof PurchaseFailure.GeneralFailure) {
// when there is General error .
}
else if (purchaseFailure instanceof PurchaseFailure.PurchaseDeclined){
// when the payment declined.
}
else if (purchaseFailure instanceof PurchaseFailure.PurchaseRejected){
// when the payment rejected.
}
else if (purchaseFailure instanceof PurchaseFailure.AuthenticationFailed){
// when the authentication failed .
// You can use the following method to update your JWT
nearPay.updateAuthentication(new AuthenticationData.Jwt("JWT is here"));
}
else if (purchaseFailure instanceof PurchaseFailure.InvalidStatus){
// you can get the status using the following code
List<StatusCheckError> status = ((PurchaseFailure.InvalidStatus) purchaseFailure).getStatus();
}
}
});
final transactionData = await nearpay.purchase(
amount: 0001,// [Required] ammount you want to set .
transactionUUID: uuid.v4(), // [Optional] specefy the transaction uuid for later referance
customerReferenceNumber: '123',// [Optional] any number you want to add as a refrence Any string as a reference number
enableReceiptUi: true, // [Optional] show the reciept in ui
enableReversalUi: true, // [Optional] it will allow you to enable or disable the reverse button
enableUiDismiss: true, // [Optional] the ui is dimissible
finishTimeout: 60, // [Optional] finish timeout in seconds
);
await nearpay.purchase({
amount: amount, // Required
transactionId: uuidv4(), //[Optional] speacify the transaction uuid for later retreval
customerReferenceNumber: '', // [Optional] referance nuber for customer use only
enableReceiptUi: true, // [Optional] show the reciept in ui
enableReversalUi: true, //[Optional] enable reversal of transaction from ui
finishTimeout: 60, //[Optional] finish timeout in seconds
enableUiDismiss: true, //[Optional] the ui is dimissible
}).then((response) => {
console.log(response.receipts)
});
embededNearpay.purchase({
amount: 1000, // Required, maens 10.00
transactionUUID: uuidv4(), //[Optional] speacify the transaction uuid
customerReferenceNumber: '', // [Optional] referance number for customer use only
enableReceiptUi: true, // [Optional] show the reciept in ui
enableReversalUi: true, //[Optional] enable reversal of transaction from ui
enableUiDismiss: true, //[Optional] the ui is dimissible
finishTimeout: 60, //[Optional] finish timeout in seconds
onPurchaseSuccess: receipts => console.log(receipts), //[Optional] callback on suceess
onPurchaseFailed: err => console.log(err), //[Optional] callback on error
});
Find TransactionReceipt model here.
Find Purchase errors here.

Refund

pass the transactionUuid of the transaction you want to refund
enableReceiptUi is Boolean so you can set it true or false.
Kotlin
Java
Flutter
React Native
Ionic
val amount : Long = 100 // [Required] ammount you want to set .
val transactionUuid = "9ace70b7-977d-4094-b7f4-4ecb17de6753" // [Required] add Transaction UUID
val customerReferenceNumber = "9ace70b7-977d-4094-b7f4-4ecb17de6751"; // [optional] any number you want to add as a refrence
val enableReceiptUi = true // [optional] true will enable the ui and false will disable
val enableReversal = true // it will allow you to enable or disable the reverse button
val enableEditableRefundAmountUi = true // [optional] true will enable the ui and false will disable
val finishTimeOut : Long = 10 // Add the number of seconds
val transactionId = UUID.randomUUID(); // [optional] You can add your UUID here which allows you to ask about the transaction again using the same UUID
val enableUiDismiss = true // [optional] it will allow you to control dismissing the UI
val adminPin = "0000"; //[optional] when you add the admin pin here , the UI for admin pin won't be shown.
nearpay.refund(amount, transactionUuid, customerReferenceNumber, enableReceiptUi, enableReversal, enableEditableRefundAmountUi, finishTimeOut, transactionId, adminPin, enableUiDismiss, object : RefundListener{
override fun onRefundApproved(transactionData: TransactionData) {
// if you wish to get the receipt in Json format use nearPay.toJson()
TODO("Your Code Here")
}
override fun onRefundFailed(refundFailure: RefundFailure) {
when (refundFailure) {
is RefundFailure.RefundDeclined -> {
// when the refund is declined
TODO("Your Code Here")
}
is RefundFailure.RefundRejected -> {
// when the refund is rejected
TODO("Your Code Here")
}
is RefundFailure.AuthenticationFailed -> {
// when the Authentication is failed
// You can use the following method to update your JWT
nearpay.updateAuthentication(AuthenticationData.Jwt("JWT HERE")
}
is RefundFailure.InvalidStatus -> {
// you can get the status using refundFailure.status .
TODO("Your Code Here")
}
is RefundFailure.GeneralFailure -> {
// when there is general error .
TODO("Your Code Here")
}
}
}
})
Long amount = 100L; // [Required] ammount you want to set .
String transactionUuid = "9ace70b7-977d-4094-b7f4-4ecb17de6753"; // [Required] add Transaction UUID
String customerReferenceNumber = "9ace70b7-977d-4094-b7f4-4ecb17de6751"; // [optional] any number you want to add as a refrence
Boolean enableReceiptUi = true; // [optional] true will enable the ui and false will disable
Boolean enableReversal = true; // it will allow you to enable or disable the reverse button
Boolean enableEditableRefundAmountUi = true; // [optional] true will enable the ui and false will disable
Long finishTimeOut = 10L; // Add the number of seconds
UUID transactionId = java.util.UUID.randomUUID(); // [optional] You can add your UUID here which allows you to ask about the transaction again using the same UUID
Boolean enableUiDismiss = true ;// [optional] it will allow you to control dismissing the UI
String adminPin = "0000"; //[optional] when you add the admin pin here , the UI for admin pin won't be shown.
nearPay.refund(amount, transactionUuid, customerReferenceNumber, enableReceiptUi, enableReversal, enableEditableRefundAmountUi, finishTimeOut, transactionId, adminpin, enableUiDismiss, new RefundListener() {
@Override
public void onRefundApproved(@NonNull TransactionData transactionData) {
// write your code here
// if you wish to get the receipt in Json format use ReceiptUtilsKt.toJson(list.get(0))
}
@Override
public void onRefundFailed(@NonNull RefundFailure refundFailure) {
if (refundFailure instanceof RefundFailure.RefundDeclined) {
// when the refund is declined
}
else if (refundFailure instanceof RefundFailure.RefundRejected){
// when the refund is rejected
}
else if (refundFailure instanceof RefundFailure.AuthenticationFailed){
// when the Authentication is failed
// You can use the following method to update your JWT
nearPay.updateAuthentication(new AuthenticationData.Jwt("JWT is here"));
}
else if (refundFailure instanceof RefundFailure.GeneralFailure){
// when there is general error .
}
else if (refundFailure instanceof RefundFailure.InvalidStatus){
// you can get the status using the following code
List<StatusCheckError> status = ((RefundFailure.InvalidStatus) refundFailure).getStatus();
}
}
});
final transactionData = await nearpay.refund(
amount: 1000, // [Required], means 10.00
originalTransactionUUID: "f5079b9d-b61c-4180-8a4d-9780f7a9cd8f", // [Required] the orginal trnasaction uuid that you want to refund
transactionUUID: uuidv4(), //[Optional] speacify the transaction uuid
customerReferenceNumber: '', //[Optional]
enableReceiptUi: true, // [Optional] show the reciept in ui
enableReversalUi: true, //[Optional] enable reversal of transaction from ui
editableRefundUI: true, // [Optional] edit the reversal amount from uid
enableUiDismiss: true, //[Optional] the ui is dimissible
finishTimeout: 60, //[Optional] finish timeout in seconds
adminPin: '0000', // [Optional] when you add the admin pin here , the UI for admin pin won't be shown.
);
await nearpay.refund({
amount: amount, // [Required]
originalTransactionUUID: uuid, // [Required] the orginal trnasaction uuid that you want to reverse
transactionId: uuidv4(), //[Optional] speacify the transaction uuid for later retreval
customerReferenceNumber: 'rerretest123333333', //[Optional]
enableReceiptUi: true, // [Optional] show the reciept in ui
enableReversalUi: true, //[Optional] enable reversal of transaction from ui
editableReversalAmountUI: true, // [Optional] edit the reversal amount from uid
finishTimeout: 60, //[Optional] finish timeout in seconds
enableUiDismiss: true, //[Optional] the ui is dimissible
adminpin : '0000' //[optional] when you add the admin pin here , the UI for admin pin won't be shown.
}).then((response) => {
console.log(response.receipts)
});
embededNearpay.refund({
amount: 1000, // [Required], means 10.00
originalTransactionUUID: 'f5079b9d-b61c-4180-8a4d-9780f7a9cd8f', // [Required] the orginal trnasaction uuid that you want to refund
transactionUUID: uuidv4(), //[Optional] speacify the transaction uuid
customerReferenceNumber: '', //[Optional]
enableReceiptUi: true, // [Optional] show the reciept in ui
enableReversalUi: true, //[Optional] enable reversal of transaction from ui
editableReversalAmountUI: true, // [Optional] edit the reversal amount from uid
enableUiDismiss: true, //[Optional] the ui is dimissible
finishTimeout: 60, //[Optional] finish timeout in seconds
adminPin: '0000', // [Optional] when you add the admin pin here , the UI for admin pin won't be shown.
onRefundSuccess: receipts => console.log(receipts), //[Optional] callback on suceess
onRefundFailed: err => console.log(err), //[Optional] callback on error
});
Find TransactionReceipt model here.
Find Refund errors here.

Reconcile

To perform a reconciliation, Payment reconciliation is an accounting process that verifies account balances to ensure all sets of records are true, consistent, and up-to-date. Businesses can reconcile their accounts daily, weekly, or monthly.
enableReceiptUi is Boolean so you can set it true or false.
Kotlin
Java
Flutter
React Native
Ionic
val enableReceiptUi = true //[optional] true will enable the ui and false will disable.
val finishTimeOut : Long = 10 //[optional] Add the number of seconds.
val enableUiDismiss = true // [optional] it will allow you to control dismissing the UI
val adminPin = "0000"; //[optional] when you add the admin pin here , the UI for admin pin won't be shown.
val transactionId = UUID.randomUUID(); // [optional] You can add your UUID here which allows you to ask about the transaction again using the same UUID
nearpay.reconcile(transactionId, enableReceiptUi, adminpin, finishTimeOut, enableUiDismiss, object : ReconcileListener {
override fun onReconcileFinished(receipt: ReconciliationReceipt?) {
// you can use the object to get the reconciliationReceipt data .
// if you wish to get the receipt in Json format use nearPay.toJson()
TODO("Your Code Here")
}
override fun onReconcileFailed(reconcileFailure: ReconcileFailure) {
when (reconcileFailure) {
is ReconcileFailure.FailureMessage -> {
// when there is FailureMessage
TODO("Your Code Here")
}
is ReconcileFailure.AuthenticationFailed -> {
// when the Authentication is failed
// You can use the following method to update your JWT
nearpay.updateAuthentication(AuthenticationData.Jwt("JWT HERE")
}
is ReconcileFailure.InvalidStatus -> {
// you can get the status using reconcileFailure.status
TODO("Your Code Here")
}
is ReconcileFailure.GeneralFailure -> {
// when there is unexpected error .
TODO("Your Code Here")
}
}
}
})
Boolean enableReceiptUi = true; //[optional] true will enable the ui and false will disable
Long finishTimeOut = 10L; // Add the number of seconds
Boolean enableUiDismiss = true ;// [optional] it will allow you to control dismissing the UI
String adminPin = "0000"; //[optional] when you add the admin pin here , the UI for admin pin won't be shown.
UUID reconcileId = java.util.UUID.randomUUID(); // [optional] You can add your UUID here which allows you to ask about the transaction again using the same UUID;
nearPay.reconcile( reconcileId, enableReceiptUi, adminPin, finishTimeOut,enableUiDismiss, new ReconcileListener() {
@Override
public void onReconcileFinished(@Nullable ReconciliationReceipt reconciliationReceipt) {
// you can use the object to get the reconciliationReceipt data .
// if you wish to get the receipt in Json format use nearPay.toJson()
}
@Override
public void onReconcileFailed(@NonNull ReconcileFailure reconcileFailure) {
if (reconcileFailure instanceof ReconcileFailure.AuthenticationFailed) {
// when the Authentication is failed
// You can use the following method to update your JWT
nearPay.updateAuthentication(new AuthenticationData.Jwt("JWT is here"));
}
else if (reconcileFailure instanceof ReconcileFailure.GeneralFailure){
// when there is general error .
}
else if (reconcileFailure instanceof ReconcileFailure.FailureMessage){
// when there is FailureMessage
}
else if (reconcileFailure instanceof ReconcileFailure.InvalidStatus){
List<StatusCheckError> status = ((ReconcileFailure.InvalidStatus) reconcileFailure).getStatus();
}
}
});
final receipt = await nearpay.reconcile(
enableReceiptUi: true, // [Optional] show the reciept in ui
enableUiDismiss: true, //[Optional] the ui is dimissible
finishTimeout: 60, //[Optional] finish timeout in seconds
adminPin: '0000', // [optional] when you add the admin pin here , the UI for admin pin won't be shown.
);
await nearpay.reconcile({
enableReceiptUi: true, // [Optional] show the reciept in ui
finishTimeout: 60, //[Optional] finish timeout in seconds
enableUiDismiss: true, //[Optional] the ui is dimissible
adminPin: '0000', // [optional] when you add the admin pin here , the UI for admin pin won't be shown.
}).then((response) => {
console.log(response.receipts)
});
embededNearpay.reconcile({
enableReceiptUi: true, // [Optional] show the reciept in ui
enableUiDismiss: true, //[Optional] the ui is dimissible
finishTimeout: 60, //[Optional] finish timeout in seconds
adminPin: '0000', // [optional] when you add the admin pin here , the UI for admin pin won't be shown.
onReconcileSuccess: receipts => console.log(receipts), //[Optional] callback on suceess
onReconcileFailed: err => console.log(err), //[Optional] callback on error
});
Find Reconcile Data here.
Find Reconcile Error here.

Get Reconcile by id

To retrieve a specific reconciliation by UUID.
Kotlin
Java
Flutter
React Native
Ionic
val uid = "5cca70b7-347d-4456-b7f4-4ecb17de6753";
nearPay.getReconciliationByUuid(uid, object : GetReconcileListener {
override fun onSuccess(receipt: ReconciliationReceipt?) {
TODO("Your Code Here")
}
override fun onFailure(getDataFailure: GetDataFailure) {
when (getDataFailure) {
is GetDataFailure.AuthenticationFailed -> {
// when the Authentication is failed
// You can use the following method to update your JWT
nearpay.updateAuthentication(AuthenticationData.Jwt("JWT HERE")
}
is GetDataFailure.FailureMessage -> {
// when there is FailureMessage
}
is GetDataFailure.GeneralFailure -> {
// when there is general error
}
is GetDataFailure.InvalidStatus -> {
// you can get the status using reconcileFailure.status
}
}
}
})
String uid = "5cca70b7-347d-4456-b7f4-4ecb17de6753";
nearPay.getReconciliationByUuid(uid, new GetReconcileListener() {
@Override
public void onSuccess(@Nullable ReconciliationReceipt reconciliationReceipt) {
// write your code here
}
@Override
public void onFailure(@NonNull GetDataFailure getDataFailure) {
if ( getDataFailure instanceof GetDataFailure.GeneralFailure){
// when there is general error
}
else if ( getDataFailure instanceof GetDataFailure.AuthenticationFailed ){
// when the Authentication is failed
// You can use the following method to update your JWT
nearPay.updateAuthentication(new AuthenticationData.Jwt("JWT is here"));
}
else if ( getDataFailure instanceof GetDataFailure.FailureMessage ){
// when there is FailureMessage
}
else if ( getDataFailure instanceof GetDataFailure.InvalidStatus ){
// you can get the status using following code
List<StatusCheckError> status = ((GetDataFailure.InvalidStatus) getDataFailure).getStatus();
}
}
});
final receipt = await nearpay.getReconciliation(
reconciliationUUID: "6d4a48b8-d194-4aad-92c9-a77606758799",
);
embededNearpay
.getReconciliation({
reconciliationUUID: '6d4a48b8-d194-4aad-92c9-a77606758799' // [Required] reconciliation uuid to fetch
})
.then((res) => {
console.log(`=-=-=-= get Reconciliation success =-=-=-=`);
console.log(res);
});
embededNearpay.getReconciliation({
reconciliationUUID: '6d4a48b8-d194-4aad-92c9-a77606758799', // Required, reconciliation uuid to fetch
onResult: receipt => {},
onFail: error => {},
});
Find Reconcile Data here
Find Reconcile Error here

Get List of Reconcile

To retrieve all the reconciliation.
Kotlin
Java
Flutter
React Native
Ionic
val pages = 1;
val page_size = 20;
nearPay.getReconciliationListPage( pages, page_size object : GetReconciliationPageListener {
override fun onSuccess(receipt: ReconciliationReceipt?) {
TODO("Your Code Here")
}
override fun onFailure(getDataFailure: GetDataFailure) {
when (getDataFailure) {
is GetDataFailure.AuthenticationFailed -> {
// when the Authentication is failed
// You can use the following method to update your JWT
nearpay.updateAuthentication(AuthenticationData.Jwt("JWT HERE")
}
is GetDataFailure.FailureMessage -> {
// when there is FailureMessage
}
is GetDataFailure.GeneralFailure -> {
// when there is general error
}
is GetDataFailure.InvalidStatus -> {
// you can get the status using reconcileFailure.status
}
}
}
})
int pages = 1;
int page_size = 20;
nearPay.getReconciliationListPage(pages, page_size, new GetReconciliationPageListener() {
@Override
public void onSuccess(@Nullable ReconciliationList reconciliationList) {
// write your code here
}
@Override
public void onFailure(@NonNull GetDataFailure getDataFailure) {
if (getDataFailure instanceof GetDataFailure.GeneralFailure) {
// when there is general error .
}
else if(getDataFailure instanceof GetDataFailure.FailureMessage){
// when there is FailureMessage
}
else if(getDataFailure instanceof GetDataFailure.InvalidStatus){
// you can get the status using following code
List<StatusCheckError> status = ((GetDataFailure.InvalidStatus) getDataFailure).getStatus();