PayOrc
SDKs

SDK - Payment with Token

Process payments using saved card tokens with the PayOrc Flutter SDK — no card re-entry required.

SDK - Payment with Token

1. Overview

The Payment with Token flow allows merchants to charge a customer using a previously saved card token (m_payment_token) without requiring the customer to re-enter card details.

This enables:

  • Faster checkout experience
  • Secure transactions (no card data handling)
  • Seamless repeat payments

2. Prerequisites

Before initiating a token-based payment:

  1. Card must be tokenized using the Add Card flow
  2. A valid m_payment_token must be stored securely on the merchant backend

3. Payment Flow

  1. Customer selects a saved card
  2. Merchant retrieves stored m_payment_token
  3. SDK is invoked with transaction details
  4. Payment is processed using the token

4. PaymentRequest.submitOrder

PayOrc.submitOrder(
  context,
  card: card,
  paymentRequest: _p.request,
  addCardPaymentRequest: _p.addCardPaymentRequest,
  onNewCardAdded: _onCardAdded,
  onSuccessPayment: (_) {
    /// Show order details to user
  },
  onPaymentFailed: (
    BuildContext submitModalContext,
    String message, {
    String? code,
  }) {
    /// Handle failure (e.g., analytics)
  },
  onRetryPayment: () {
    /// Handle retry (e.g., analytics)
  },
);

paymentRequest = PaymentRequest.submitOrder({
  required this.paymentToken,
  required this.orderDetails,
  required this.customerDetails,
  required this.billingDetails,
  required this.shippingDetails,
  required this.urls,
  this.parameters = const [],
  this.customData = const [],
  this.viewType = PaymentViewType.bottomsheet,
});

Parameters

FieldTypeDescription
payment_tokenStringUnique token generated for the card. Must be stored securely and used for future transactions.
customer_detailsObjectCustomer name, email, phone
  m_customer_idStringUnique Identifier of the customer. Should match with add card token. Maxlength: 50
  nameStringCustomer first name and last name. Maxlength: 50
  emailStringCustomer email. Maxlength: 50
  mobileStringCustomer mobile number. Length: According to country code
  codeStringISO Phone Codes, Check reference table. Minlength: 1, Maxlength: 9
order_detailsObjectOrder ID, amount, currency
  m_order_id (optional)StringUnique Identifier of the order
  amountNumberOrder amount
  convenience_fee (optional)NumberConvenience Fee
  quantity (optional)NumberOrder quantity
  currencyStringCurrency code. ISO-3 currency code 3 Characters
  description (optional)StringThis field contains description. Maxlength: 200
billings_detailsObjectBilling address information
  address_line1StringCustomer billing address. Maxlength: 50
  address_line2 (optional)StringCustomer billing address. Maxlength: 50
  city (optional)StringCustomer city. Maxlength: 50
  province (optional)StringCustomer province/state. Maxlength: 50
  countryStringCustomer ISO Country Codes, Check reference table. 2 Characters
  pin (optional)StringCustomer area zip-code. Minlength: 3, Maxlength: 13
shipping_detailsObjectShipping address information
  shipping_name (optional)StringCustomer Name
  shipping_mobile (optional)StringCustomer Mobile Number
  shipping_code (optional)StringCustomer ISO Country Codes, Check reference table. 2 Characters
  shipping_email (optional)StringCustomer email.
  address_line1 (optional)StringCustomer shipping address. Maxlength: 50
  address_line2 (optional)StringCustomer shipping address. Maxlength: 50
  city (optional)StringCustomer city. Maxlength: 50
  province (optional)StringCustomer province/state. Maxlength: 50
  country (optional)StringCustomer ISO Country Codes, Check reference table. 2 Characters
  pin (optional)StringCustomer area zip-code. Minlength: 3, Maxlength: 13
  location_pin (optional)UrlCustomer location pin should be a url
  shipping_currency (optional)StringCustomer Currency code. ISO-3 currency code 3 Characters
  shipping_amount (optional)NumberShipping amount
parametersObjectAny additional set of data merchant wants to add in the request.
  alphaStringMerchant defined data
  betaStringMerchant defined data
  gammaStringMerchant defined data
  deltaStringMerchant defined data
  epsilonStringMerchant defined data
custom_dataObjectReserved for PayOrc special features like MID Group and Split payments. After enabling merchant can pass the custom data in the request.
  alphaStringCustom data
  betaStringCustom data
  gammaStringCustom data
  deltaStringCustom data
  epsilonStringCustom data

5. Response Format

{
  "action": "AUTH",
  "status": "SUCCESS",
  "order_status": "AUTHORISED",
  "m_order_id": "",
  "p_order_id": "1000010139",
  "p_request_id": "1000015740",
  "psp_ref_id": "030079987119",
  "transaction_id": "1000011980",
  "is_live": false,
  "terminal_label": "",
  "remark": "",
  "reason": "",
  "currency": "AED",
  "amount": "199.00",
  "channel": "SDK/PLUGINS",
  "channel_id": "",
  "shipping_fee": "0.00",
  "convenience_fee": "0.00",
  "customer_details": {
    "name": "John Doe",
    "email": "[email protected]",
    "code": "971",
    "mobile": "555555555",
    "m_customer_id": "customer_12345"
  },
  "billing_address": {
    "address_line_1": "Event Venue",
    "address_line_2": "",
    "city": "",
    "state": "",
    "country": "AE",
    "pincode": ""
  },
  "shipping_address": {
    "address_line_1": "",
    "address_line_2": "",
    "city": "",
    "state": "",
    "country": "",
    "pincode": ""
  },
  "ip_country": "",
  "psp": "TELR",
  "payment_method": "DEBIT CARD",
  "m_payment_token": "WVNnWlBoVEZRsOWhIZndPUT09",
  "transaction_time": "30-03-2026 16:39:01",
  "payment_method_data": {
    "scheme": "VISA",
    "card_country": "POLAND",
    "card_type": "DEBIT",
    "mask_card_number": "4111****1111",
    "expiry_month": "12",
    "expiry_year": "2045"
  },
  "apm_name": "",
  "apm_identifier": "",
  "sub_merchant_identifier": "0000001181",
  "parameters": [
    { "alpha": "" },
    { "beta": "" },
    { "gamma": "" },
    { "delta": "" },
    { "epsilon": "" }
  ],
  "custom_data": [
    { "alpha": "" },
    { "beta": "" },
    { "gamma": "" },
    { "delta": "" },
    { "epsilon": "" }
  ]
}

Response Parameters

FieldTypeDescription
actionStringTransaction action type AUTH or SALE
statusStringOverall transaction execution status. Will be "SUCCESS" only when order_status is "FAILED" will status be "FAILED".
order_statusStringDetailed order status from the system. Possible values: AUTHORISED, FAILED, CAPTURED.
m_order_idStringOrder ID provided by the merchant.
p_order_idStringOrder ID generated by the PayOrc platform.
p_request_idStringUnique PayOrc ID for the transaction event.
psp_ref_idStringReference ID received from the PSP.
transaction_idStringUnique PayOrc transaction identifier for follow-up actions.
is_liveBooleanIndicates whether the transaction was processed in live mode.
terminal_labelStringTerminal label or identifier used for processing the transaction.
currencyStringTransaction currency (ISO 4217).
amountStringTransaction amount.
shipping_feeStringShipping charges applied to the transaction.
convenience_feeStringConvenience or service fee applied to the transaction.
channelStringPayment initiation channel.
channel_idStringUnique identifier of the channel (e.g., payment link ID).
customer_detailsObjectCustomer information provided during order creation.
  nameStringCustomer full name.
  emailStringCustomer email address.
  codeStringCountry calling code of the customer.
  mobileStringCustomer mobile number.
  m_customer_idStringMerchant-side customer identifier.
billing_addressObjectBilling address of the customer.
shipping_addressObjectShipping address of the customer.
ip_countryStringCountry detected from the customers IP address.
remarkStringAdditional remarks related to the transaction.
reasonStringFailure or informational reason code.
pspStringPayment service provider name.
payment_methodStringPayment method used by the customer.
m_payment_tokenStringPayment token generated for the transaction.
transaction_timeStringDate and time when the transaction was processed.
payment_method_dataObjectCard or payment instrument details.
apm_nameStringName of the alternative payment method.
apm_identifierStringIdentifier for the alternative payment method.
sub_merchant_identifierStringSub-merchant identifier mapped with the PSP.
parametersObjectSystem-defined key-value parameters.
custom_dataObjectMerchant-defined custom key-value data.

6. Handling 3D Secure

The SDK automatically handles 3D Secure challenges. When 3DS is required:

  1. SDK displays the 3DS challenge screen
  2. Customer completes authentication
  3. SDK returns the payment result

No additional code is needed — the SDK manages the entire 3DS flow.

7. Best Practices

  • Handle all statuses — Always implement onSuccessPayment, onPaymentFailed, and onRetryPayment callbacks.
  • Unique order IDs — Use unique order IDs to prevent duplicate charges.
  • Secure token storage — Store m_payment_token encrypted on your backend.
  • Network resilience — Handle timeout scenarios with retry logic.

On this page