Skip to main content

Response Handling

After a payment completes, the XDK returns a JSON string with the transaction result. Parse this on your app and verify it on your backend before fulfilling the order.

Standard Payment Result

{
"status_code": "00",
"amount": "1.01",
"chksum": "34a9ec11a5b79f31a15176ffbcac76cd",
"pInstruction": 0,
"msgType": "C6",
"paydate": 1459240430,
"order_id": "3q3rux7dj",
"err_desc": "",
"channel": "Credit",
"app_code": "439187",
"txn_ID": "6936766",
"mp_secured_verified": false
}

Key Fields

FieldDescription
status_code"00" = Success, "11" = Failed, "22" = Pending (cash channels only)
amountTransaction amount
paydateTransaction date (Unix timestamp)
order_idYour order ID
channelPayment channel used
txn_IDTransaction ID generated by Fiuu
chksumChecksum for server-side verification
msgTypeMessage type (used in checksum calculation)
mp_secured_verifiedBuilt-in checksum validation result (see note below)

Google Pay Result

Google Pay returns a slightly different format:

{
"StatCode": "00",
"StatName": "captured",
"TranID": "30959687",
"Amount": "1.10",
"Domain": "",
"VrfKey": "",
"Channel": "credit",
"OrderID": "1741853136969",
"Currency": "MYR",
"ErrorCode": null,
"ErrorDesc": null,
"ProcessorResponseCode": "00",
"3DSVersion": "2.2"
}
FieldDescription
StatCode"00" = Success, "11" = Failed, "22" = Pending
TranIDTransaction ID generated by Fiuu
AmountTransaction amount
OrderIDYour order ID
ChannelCard type used
DomainYour Merchant ID
VrfKeyVerify key: md5(Amount + secret_key + Domain + TranID + StatCode)

Error Results

Communication Error

{"Error": "Communication Error"}

Possible causes:

  1. Internet not available
  2. Invalid API credentials (mp_username, mp_password, mp_merchant_ID, mp_verification_key)
  3. Fiuu server offline

Format Error

{
"status": false,
"error_code": "P03",
"error_desc": "Your payment info format not correct."
}

Possible causes:

  1. Required parameters missing or incorrectly formatted
  2. mp_extended_vcode not set to true when extended Verify Payment is enabled

Google Pay Token Error

{
"error_code": "A01",
"error_desc": "Fail to detokenize Google Pay Token given",
"status": 0
}

Possible causes:

  1. Misconfigured Google Pay setup
  2. Invalid API credentials
  3. Payment server offline

Contact Fiuu support if the error persists.

Checksum Verification

Standard Payment

chksum = MD5(mp_merchant_ID + msgType + txn_ID + amount + status_code + secret_key)
chksum = MD5(mp_merchant_ID + results.msgType + results.txn_ID + results.amount + results.status_code + merchant_private_secret_key)

Your secret_key is available in the Fiuu Merchant Portal.

Built-in Validator Caveat

All XDK builds include a built-in checksum validator that returns the result in mp_secured_verified. If you use the private secret key (recommended), this will always return false. In that case, ignore mp_secured_verified and verify the checksum on your server.

Handling Results by Framework

Flutter

String result = await MobileXDK.start(paymentDetails);
print("Result: $result");
// Parse JSON and verify on your backend

React Native

The fiuu-mobile-xdk-reactnative JavaScript wrapper normalizes native responses to plain objects before invoking your callbacks. Android returns JSON strings internally; iOS returns dictionaries — both are parsed so you can access fields directly (result.StatCode, result.txn_ID, etc.).

Two result formats depending on the payment flow:

FlowStatus fieldVerify with
Standard XDK checkout (mp_channel set)status_codechksum — see Standard Payment Result
Google Pay (omit mp_channel) / Apple PayStatCodeVrfKey — see Google Pay Result

Always provide both successCallback and errorCallback. successCallback fires for StatCode "00". Pending ("22") and failed ("11") backend payloads arrive as objects in errorCallback; pre-flight validation errors (missing credentials, unlinked native module) arrive as plain strings.

import fiuupayment from 'fiuu-mobile-xdk-reactnative';

fiuupayment.startFiuu(
paymentDetails,
(result) => {
// Plain object — status_code/StatCode "00" (success)
const code = result.StatCode ?? result.status_code;
console.log('Success:', code, result.TranID ?? result.txn_ID);
// Verify on your backend
},
(error) => {
if (typeof error === 'object') {
const code = error.StatCode ?? error.status_code;
if (code) {
// Failed backend payload
console.log('Failed:', error.ErrorCode ?? error.err_desc, error.ErrorDesc ?? error.err_desc);
}
} else {
// Pre-flight validation error or user cancellation — plain string
console.log('Error:', error);
}
}
);

Expo

startMolpay(paymentDetails, (result) => {
console.log('Fiuu Payment Result:', result);
// Parse JSON and verify on your backend
});

Android (Java/Kotlin)

ActivityResultLauncher<Intent> paymentActivityResultLauncher = registerForActivityResult(
new ActivityResultContracts.StartActivityForResult(),
result -> {
if (result.getData() != null) {
String transactionResult = result.getData()
.getStringExtra(PaymentActivity.XDKTransactionResult);
Log.d(PaymentActivity.logXDK, "transaction result = " + transactionResult);
}
}
);

Swift

vc.startXDK { result in
switch result {
case .success(let data):
print("RESULTS: \(data)")
case .failure:
print("ERROR!")
}
}

Best Practices

  1. Never trust client-side success alone — always verify the checksum on your backend.
  2. Use unique order IDs for every transaction to prevent duplicates.
  3. Handle all status codes — including pending ("22") for cash channels.
  4. Log errors with the full result JSON for troubleshooting.
  5. Match credentials to environment — Sandbox credentials with mp_core_env = "4", production credentials otherwise.