Offline / POS Payment ## Sections • [Introduction/Overview](https://developer.asiapay.com/offline-pos-payment/introduction-overview.md): Offline / POS Payment Integration enables merchants to initiate QR-based payment transactions in scenarios where an online connection may not be available at the time of QR generation or scanning. The integration supports three payment flows: Title Flow Description Typical Device Present QR Merchant generates a QR code. Customer scans it with their wallet app to pay. SoftPOS, SmartPOS, Mobile app Scan QR Customer shows their wallet QR. Merchant scans it with a scanner or camera. POS terminal, handheld device, SoftPOS App-to-App Merchant POS app launches AsiaPay AppPay via Android Intent. AppPay handles the UI and payment. SoftPOS, SmartPOS, Mobile app Server-side Endpoint & Connectivity All server-side requests are sent via HTTPS POST with content type application/x-www-form-urlencoded and UTF-8 encoding. Title Description Environment Endpoint URL Sandbox / Testing https://test.paydollar.com/b2cDemo/eng/directPay/payComp.jsp Encrypted Wrapper (Sandbox) https://test.paydollar.com/b2c2/eng/directPay/payCompEnc.jsp Production Base https://www.paydollar.com/b2c2/eng/directPay/payComp.jsp Encrypted Wrapper Production https://www.paydollar.com/b2c2/eng/directPay/payCompEnc.jsp For encrypted requests (recommended for POS), use the corresponding payCompEnc.jsp endpoint. • [Present QR](https://developer.asiapay.com/offline-pos-payment/present-qr.md): The merchant POS requests a QR payload from the gateway, decodes the base64-encoded string, and displays the QR code on a screen or prints it for the customer to scan. Business Flow Merchant POS / SoftPOS sends a payment request with amount, currency and desired wallet method. Gateway returns successcode=2 together with an encMsg field containing a Base64-encoded QR raw string. Merchant Base64-decodes the encMsg value to obtain the raw QR string, then converts it into a QR image and displays it to the customer. Customer scans the QR with their wallet app and completes the payment. Merchant receives the final result via DataFeed or notifyUrl. • [Integration Parameters](https://developer.asiapay.com/offline-pos-payment/present-qr/integration-parameters.md): Please copy the following PRODUCTION URL for Direct Connect Server Post method: Plain text https://www.paydollar.com/b2c2/eng/directPay/payComp.jsp https://www.paydollar.com/b2c2/eng/directPay/payComp.jsp • [Required Parameters](https://developer.asiapay.com/offline-pos-payment/present-qr/integration-parameters/required-parameters.md): Required Parameter ( with UTF-8 Encoding ) for connect to our payment interface Title Description Title Parameters Data Type Descriptions merchantId Number The merchant ID we provide to you orderRef Text (35) Merchant‘s Order Reference Number amount Number (12,2) Total amount your want to charge the customer [ Up to 2 decimal place ] currCode Text (3) The currency of the payment: “344” – HKD “840” – USD “702” – SGD “156” – CNY (RMB) “392” – JPY “901” – TWD “036” – AUD “978” – EUR “826” – GBP “124” – CAD “446” – MOP “608” – PHP “764” – THB “458” – MYR “360” – IDR “410” – KRW “682” – SAR “554” – NZD “784” – AED “096” – BND “704” – VND “356” – INR lang Text (1) The language of the payment page “E” – English payType Text(1) “N” The payment type: ”N” – Normal Payment (Sales) payMethod Text The payment method: "ALIPAYOFFL" – Alipay QR "ALIPAYHKONL" – Alipay HK QR "WeChat Pay QR" – WeChat Pay QR "PayMeOFFL" – PayMe QR qr_only Text(2) QR Always set to QR • [Optional Parameters](https://developer.asiapay.com/offline-pos-payment/present-qr/integration-parameters/optional-parameters.md): Optional Parameter for connect to our payment interface Title Description Parameters Data Type Descriptions remark Text An additional remark field that will appear in the confirmation email and transaction detail report to help you to refer the order secureHash Text (40) Secure hash is used to authenticate the integrity of the transaction information and the identity of the merchant. It is calculated by hashing the combination of various transaction parameters and the Secure Hash Secret. *Applies to merchants who registered this function only. For more information, please refer to section 4 at normal PayDollar PayGate Integration Guide. profileId Text Required when using the encrypted endpoint • [Return Parameters](https://developer.asiapay.com/offline-pos-payment/present-qr/integration-parameters/return-parameters.md): Title Description Parameters Data Type Descriptions src Number Return bank host status code prc Number Return bank host status code Ord Number Bank Reference Number Holder Text The Holder Name of the Payment Account successcode Number Transaction Status: 0 – Transaction succeeded 1 – Transaction Failure 2 – Transaction Pending (for App–2–App integration) Ref Text Merchant‘s Order Reference Number PayRef Number PayDollar Payment Reference Number Amt Number (12,2) Transaction Amount Cur Number (3) Transaction Currency i.e. “344” - HKD AuthId Text Approval Code TxTime Text (YYYY-MM-DD HH:MI:SS.0) Transaction Time errMsg Text Present QR flow: QR raw data for the payment formatted by Base64Url Merchant should decode the value with Base64Url format and encode the data to the QR image for the payment Response Handling successcode=2 indicates QR generated successfully. encMsg contains the Base64-encoded QR raw string. Decode it and render the QR image. Example decoded: weixin://wxpay/bizpayurl?pr=9iA23aQz1 • [Supported Payment Method](https://developer.asiapay.com/offline-pos-payment/present-qr/supported-payment-method.md): Title Description Payment Method Description WECHATONL WeChat Pay – Online ALIPAYHKOFFL AlipayHK Offline ALIPAYOFFL Alipay Offline FPS Faster Payment System (Hong Kong) – QR ALIPAYCNOFFL Alipay China Offline WECHATOFFL WeChat Pay Offline WECHATHKOFFL WeChat Pay Hong Kong Offline PROMPTPAYOFFL PromptPay (Thailand) Offline QRIS QRIS – Indonesia National QR Standard DuitNow DuitNow – Malaysia QR UNIONPAYOFFL UnionPay Offline PayMe PayMe by HSBC – QR BoCPay Bank of China Pay – QR ALIPAYPLUSOFFL Alipay+ Offline GRABPAYOFFL GrabPay Offline SHOPEEPAYOFFL ShopeePay Offline • [Scan QR](https://developer.asiapay.com/offline-pos-payment/scan-qr.md): The customer presents a dynamic payment QR code generated inside their wallet app. The merchant scans the customer's QR code using an optical barcode/QR scanner or smart POS device, passing the string payload directly to the gateway for immediate authorization. Business Flow Customer opens their wallet app and displays the payment QR code. Merchant scans the QR using a barcode scanner, camera, or SoftPOS device. Merchant sends the scanned data together with the amount and payment method. Gateway processes the payment and returns the result immediately. Merchant POS receives the real-time success response and immediately prints or issues the transaction receipt to the customer. • [Required Parameters](https://developer.asiapay.com/offline-pos-payment/scan-qr/integration-parameters/required-parameters.md): Title Title Description Parameter Data Type Description merchantId Number Your Merchant ID provided by AsiaPay orderRef Text (max 35) Your unique order / invoice reference number amount Number Transaction amount currCode Text (3) Currency code pMethod Text Payment method (e.g. PayMeOFFL, ALIPAYOFFL, WECHATOFFL…) payType Fixed: N Always set to N (Normal sale) cardNo Text Scanned QR / wallet account identifier encryptMode AES256 Encryption mode when using payCompEnc.jsp modeType payment Must be set to payment for payment requests encryptedData Base64 AES-256 encrypted payload containing the clear parameters • [Optional Parameters](https://developer.asiapay.com/offline-pos-payment/scan-qr/integration-parameters/optional-parameters-1.md): Optional Parameter for connect to our payment interface Title Description Parameters Data Type Descriptions remark Text An additional remark field that will appear in the confirmation email and transaction detail report to help you to refer the order secureHash Text (40) Secure hash is used to authenticate the integrity of the transaction information and the identity of the merchant. It is calculated by hashing the combination of various transaction parameters and the Secure Hash Secret. *Applies to merchants who registered this function only. For more information, please refer to section 4 at normal PayDollar PayGate Integration Guide. profileId Text Required when using the encrypted endpoint • [Supported Payment Methods](https://developer.asiapay.com/offline-pos-payment/scan-qr/supported-payment-methods.md): Title Description Payment Method Description PayMeOFFL PayMe Offline (Customer-presented QR) ALIPAYOFFL Alipay Offline ALIPAYHKOFFL AlipayHK Offline ALIPAYCNOFFL Alipay China Offline WECHATOFFL WeChat Pay Offline WECHATHKOFFL WeChat Pay Hong Kong Offline WECHATMYOFFL WeChat Pay Malaysia Offline GRABPAYOFFL GrabPay Offline GRABPAYLATEROFFL GrabPay Later Offline SHOPEEPAYOFFL ShopeePay Offline PROMPTPAYOFFL PromptPay (Thailand) Offline QRIS QRIS – Indonesia National QR Standard DuitNow DuitNow Malaysia BOOSTOFFL Boost Offline (Malaysia) LINEPAYOFFL LINE Pay Offline TRUEMONEYOFFL TrueMoney Offline OEPAYOFFL OE Pay Offline UNIONPAYOFFL UnionPay Offline AIRPAYOFFL AirPay Offline GCASHOFFL GCash Offline MAEOFFL MAE Offline TNGOFFL Touch ’n Go Offline SHOPBACKOFFL ShopBack Offline ALIPAYPLUSOFFL Alipay+ Offline FPS Faster Payment System • [AppPay App-to-App](https://developer.asiapay.com/offline-pos-payment/apppay-app-to-app.md): AppPay provides an API interface via Intent (Android app-to-app) to let your POS app to communicate with AppPay to process payments Below are the steps to show the workflow of payment process. • [Card Payment](https://developer.asiapay.com/offline-pos-payment/apppay-app-to-app/api-list/card-payment.md): Endpoint Plain text https://test-portal.paydollar.com/card https://test-portal.paydollar.com/card • [Required Parameters](https://developer.asiapay.com/offline-pos-payment/apppay-app-to-app/api-list/card-payment/required-parameters.md): Title Description Parameter Data Type Description Sample Data payMethod String Payment method for card payment Cards paymentMethod String Payment method for APM Optional, empty for card payment amount String Total amount of transaction 100.01, 2 decimal points currency String Currency code of transaction, iso code 456,344 • [Optional Parameters](https://developer.asiapay.com/offline-pos-payment/apppay-app-to-app/api-list/card-payment/optional-parameters.md): Title Description Title Description Parameter Data Type Description Sample Data handling_fee String Amount of handling fee 0 is default discount String Amount of discount 0 is default tipAmount String Amount of tips 0 is default • [Response Parameters](https://developer.asiapay.com/offline-pos-payment/apppay-app-to-app/api-list/card-payment/response-parameters.md): Title Description Title Description Parameter Data Type Description Sample Data transactionID String The ID of the transaction A0000001 status String The status of payment process Completed, Rejected finalAmount String The final amount charged for the transaction 100.00, 2 decimal points invoiceNumber String Currency code of transaction, iso code INA0000001 paymentChannel String Amount of handling fee TAP2PHONE • [Sample Code](https://developer.asiapay.com/offline-pos-payment/apppay-app-to-app/api-list/card-payment/sample-code.md): Java String payMethod = "Cards"; String paymentMethod = ""; String amount = "1"; String Currency = "456"; String handling_fee ="0"; String discount = "0"; String tipAmount = "0"; Uri link = Uri.parse("https://test-portal.paydollar.com/card?amount=" + amount + "&currency=" + Currency + "&payMethod=" + payMethod + "&paymentMethod=" + paymentMethod + "&tipAmount=" + tipAmount + "&discount=" + discount + "&handling_fee=" + handling_fee); Intent intent = new Intent(Intent.ACTION_VIEW, link); intent.setPackage("com.asiapay.apppay.uat"); //For Debug release only startActivityForResult(intent, REQUEST_CODE_APP_B); // Any value that is 1 @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == REQUEST_CODE_APP_B) { if (resultCode == RESULT_OK) { String transactionID = data.getStringExtra("transactionID"); String status = data.getStringExtra("status"); String finalAmount = data.getStringExtra("finalAmount"); String invoiceNumber = data.getStringExtra("invoiceNumber"); String paymentChannel = data.getStringExtra("paymentChannel"); Intent paymentResult = new Intent(MainActivity.this, PaymentResultReceiver.class); paymentResult.putExtra("transactionID",transactionID); paymentResult.putExtra("status",status); paymentResult.putExtra("finalAmount",finalAmount); paymentResult.putExtra("invoiceNumber",invoiceNumber); paymentResult.putExtra("paymentChannel",paymentChannel); startActivity(paymentResult); finish(); } else { Toast.makeText(this, "Something went wrong!", Toast.LENGTH_LONG).show(); } } } String paymentChannel = data.getStringExtra("paymentChannel"); Intent paymentResult = new Intent(MainActivity.this, PaymentResultReceiver.class); Remarks PayMethod should be “Cards” and PaymentMethod should be blank for Card Payment. SetPackage as “com.asiapay.apppay” for Production build. • [Scan QR](https://developer.asiapay.com/offline-pos-payment/apppay-app-to-app/api-list/qr-payment/scan-qr.md): Endpoint Plain text https://test-portal.paydollar.com/scan https://test-portal.paydollar.com/scan • [Required Parameters](https://developer.asiapay.com/offline-pos-payment/apppay-app-to-app/api-list/qr-payment/scan-qr/required-parameters.md): Title Description Title Description Parameter Data Type Description Sample Data payMethod String Payment method for card payment Scan QR paymentMethod String Payment method for APM Mandatory, ALIPAYHK amount String Total amount of transaction 100.01, 2 decimal points currency String Currency code of transaction, iso code 456,344 • [Optional Parameters](https://developer.asiapay.com/offline-pos-payment/apppay-app-to-app/api-list/qr-payment/scan-qr/optional-parameters.md): Title Description Title Description Parameter Data Type Description Sample Data handling_fee String Amount of handling fee 0 is default discount String Amount of discount 0 is default tipAmount String Amount of tips 0 is default • [Response Parameters](https://developer.asiapay.com/offline-pos-payment/apppay-app-to-app/api-list/qr-payment/scan-qr/response-parameters.md): Title Description Title Description Parameter Data Type Description Sample Data transactionID String The ID of the transaction A0000001 status String The status of payment process Completed, Rejected finalAmount String The final amount charged for the transaction 100.00, 2 decimal points invoiceNumber String Currency code of transaction, iso code INA0000001 paymentChannel String Amount of handling fee SCAN QR • [Sample Code](https://developer.asiapay.com/offline-pos-payment/apppay-app-to-app/api-list/qr-payment/scan-qr/sample-code.md): Java String payMethod = "Cards"; String paymentMethod = ""; String amount = "1"; String Currency = "456"; String handling_fee ="0"; String discount = "0"; String tipAmount = "0"; Uri link = Uri.parse("https://test-portal.paydollar.com/card?amount=" + amount + "&currency=" + Currency + "&payMethod=" + payMethod + "&paymentMethod=" + paymentMethod + "&tipAmount=" + tipAmount + "&discount=" + discount + "&handling_fee=" + handling_fee); Intent intent = new Intent(Intent.ACTION_VIEW, link); intent.setPackage("com.asiapay.apppay.uat"); //For Debug release only startActivityForResult(intent, REQUEST_CODE_APP_B); // Any value that is 1 @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == REQUEST_CODE_APP_B) { if (resultCode == RESULT_OK) { String transactionID = data.getStringExtra("transactionID"); String status = data.getStringExtra("status"); String finalAmount = data.getStringExtra("finalAmount"); String invoiceNumber = data.getStringExtra("invoiceNumber"); String paymentChannel = data.getStringExtra("paymentChannel"); Intent paymentResult = new Intent(MainActivity.this, PaymentResultReceiver.class); paymentResult.putExtra("transactionID",transactionID); paymentResult.putExtra("status",status); paymentResult.putExtra("finalAmount",finalAmount); paymentResult.putExtra("invoiceNumber",invoiceNumber); paymentResult.putExtra("paymentChannel",paymentChannel); startActivity(paymentResult); finish(); } else { Toast.makeText(this, "Something went wrong!", Toast.LENGTH_LONG).show(); } } } String paymentChannel = data.getStringExtra("paymentChannel"); Intent paymentResult = new Intent(MainActivity.this, PaymentResultReceiver.class); Remarks PayMethod should be “Scan QR” and PaymentMethod should be “ALIPAYHK” or “GRABPAY” for ScanQR Payment. SetPackage as “com.asiapay.apppay” for Production build. • [Present QR](https://developer.asiapay.com/offline-pos-payment/apppay-app-to-app/api-list/qr-payment/present-qr.md): Endpoint CURL https://test-portal.paydollar.com/present • [Required Parameters](https://developer.asiapay.com/offline-pos-payment/apppay-app-to-app/api-list/qr-payment/present-qr/required-parameters.md): Title Description Title Description Parameter Data Type Description Sample Data payMethod String Payment method for card payment Present QR paymentMethod String Payment method for APM Mandatory, ALIPAYHK amount String Total amount of transaction 100.01, 2 decimal points currency String Currency code of transaction, iso code 456,344 • [Optional Parameters](https://developer.asiapay.com/offline-pos-payment/apppay-app-to-app/api-list/qr-payment/present-qr/optional-parameters.md): Title Description Title Description Parameter Data Type Description Sample Data handling_fee String Amount of handling fee 0 is default discount String Amount of discount 0 is default tipAmount String Amount of tips 0 is default • [Response Parameters](https://developer.asiapay.com/offline-pos-payment/apppay-app-to-app/api-list/qr-payment/present-qr/response-parameters.md): Title Description Title Description Parameter Data Type Description Sample Data transactionID String The ID of the transaction A0000001 status String The status of payment process Completed, Rejected finalAmount String The final amount charged for the transaction 100.00, 2 decimal points invoiceNumber String Currency code of transaction, iso code INA0000001 paymentChannel String Amount of handling fee PRESENT QR • [Sample Code](https://developer.asiapay.com/offline-pos-payment/apppay-app-to-app/api-list/qr-payment/present-qr/sample-code.md): Java String payMethod = "Present QR"; String paymentMethod = "ALIPAYHK"; //this value can be dynamically selected by radio buttons from demo app. String amount = "1"; String Currency = "456"; String handling_fee ="0"; String discount = "0"; String tipAmount = "0"; Uri link = Uri.parse("https://test-portal.paydollar.com/present?amount=" + amount + "&currency=" + Currency + "&payMethod=" + payMethod + "&paymentMethod=" + paymentMethod + "&tipAmount=" + tipAmount + "&discount=" + discount + "&handling_fee=" + handling_fee); Intent intent = new Intent(Intent.ACTION_VIEW, link); intent.setPackage("com.asiapay.apppay.uat"); //For Debug release only startActivityForResult(intent, REQUEST_CODE_APP_B); @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == REQUEST_CODE_APP_B) { if (resultCode == RESULT_OK) { String transactionID = data.getStringExtra("transactionID"); String status = data.getStringExtra("status"); String finalAmount = data.getStringExtra("finalAmount"); String invoiceNumber = data.getStringExtra("invoiceNumber"); String paymentChannel = data.getStringExtra("paymentChannel"); Intent paymentResult = new Intent(MainActivity.this, PaymentResultReceiver.class); paymentResult.putExtra("transactionID",transactionID); paymentResult.putExtra("status",status); paymentResult.putExtra("finalAmount",finalAmount); paymentResult.putExtra("invoiceNumber",invoiceNumber); paymentResult.putExtra("paymentChannel",paymentChannel); startActivity(paymentResult); finish(); } else { Toast.makeText(this, "Something went wrong!", Toast.LENGTH_LONG).show(); } } } }} } Remarks PayMethod should be “Present QR” and PaymentMethod should be “ALIPAYHK” or “GRABPAY” for PresentQR Payment. SetPackage as “com.asiapay.apppay” for Production build. • [Security Recommendations](https://developer.asiapay.com/offline-pos-payment/security-recommendations.md): Always use HTTPS for server-side calls. Validate Secure Hash when enabled. Prefer encrypted endpoint (payCompEnc.jsp + AES-256) for server-side POS. For App-to-App use the official AppPay package only.