Introduction
Welcome to our Payment Gateway System

Our powerful web-based online payment services platform, a trusted solution utilized by numerous renowned companies and organizations in the region. Our system offers a secure, multi-channel, multi-lingual, and multi-currency payment experience.
Integration Methods:
Choose the integration method that best suits your needs:
Web Integration | Mobile Integration |
Client Post through Browser (e.g. Shopping Cart) This method is favoured by merchants for its simplicity and speed. It enables swift website integration, ensuring a seamless user experience with a streamlined transaction flow. | This section explains the integration of PaySDK Android SDK in merchant android mobile application. |
Tailored for Online Shopping Carts, this method uses HTML and JavaScript for broad compatibility, ensuring a seamless experience | This section explains integration of PaySDK iOS SDK in merchant iOS mobile application. |
Server Side Direct Connection (e.g. IVR System, Mobile App) Merchants request payment authorization via our gateway, pending bank approval. They integrate their IVR or app, and create a custom payment page | Merchants can seek direct payment authorization from the bank via our gateway, pending acquiring bank approval. They'll set up a custom payment page to collect information like credit card details, which will be sent to a specific URL provided by the acquiring bank. Customers won't encounter a bank payment page in this process. |
Purpose of this Document:
This technical specification document prescribes the constituent parts of specification for integration of an e-commerce web site with PayDollar/SiamPay/PesoPay e-commerce service, the on-line payment service by AsiaPay (HK) Limited, by subscribed merchants of the service. This document has been created to ensure that all technical specifications contain sufficient information to enable a merchant to design and modify the codes of an existing on-line shopping architecture or software to cater for the payment –enabling service. It also provides a checklist to enable the reviewers of specifications to conduct tests on the functionalities of the integration.
Enhanced Security with 3DS 2.0:
There is an extra parameter section under each connection method. That section is especially designed for 3DS 2.0 (Three Domain Secure 2.0). 3DS authentication is an additional security layer for card-not-present transactions. With 3DS 2.0, it is aimed to achieve a better, stronger fraud-detection intelligence.
Merchant API Functions:
In a later section, we'll provide an in-depth description of the various API functions available to subscribed merchants, ensuring a seamless integration process.
Thank you for choosing our payment gateway system. Let's get started.
Web Integration
Following are the three methods of Web Integration
Mobile Integration
PaySDK Android Mobile SDK
This section explains integration of PaySDK Android SDK in merchant android mobile application.
PaySDK iOS Mobile SDK
This section explains integration of PaySDK iOS SDK in merchant iOS mobile application. Merchant have to provide iOS App bundle ID and android application id to AsiaPay to apple PaySDK service. PaySDK will be sharing unique RSA Public key related to merchant.
SDK Integration Steps
SDK requirement
Swift Version: 4.0 and above
iOS Version: 11.0 and above
SDK Configuration
Add AP_PaySDK.framework file into your project by adding the dependencies in Build Phases / Link Binary With Libraries:
add the “AP_PaySDK” framework
OR
CocoaPods is a dependency manager for Cocoa projects. For usage and installation instructions, visit their website. To integrate PaySDK into your Xcode project using CocoaPods, specify it in your Podfile:
pod ‘AP_PaySDK’
SDK Initialization
- Create the paysdk.plist file in the app with the following attributes RSA Public Key(SDK_RSA_Publickey) :- Here you need to specify the RSA Public Key without header and footer. The value will be provided when the merchant apply the SDK service.
e.g
NOTE: Naming of property file and its attributes must be same.
2. Import sdk into the class import AP_PaySDK
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>paydollar.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>xecure3d.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>pesopay.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>siampay.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>alipay.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
<key>alipayobjects.com</key>
<dict>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.0</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
</dict>
OR
merchant can disable ATS by
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key><true/>
</dict>
3. Add implementation of PaySDK protocol – PaySDKDelegate
- Swift Code
import AP_PaySDKclass ViewController: UIViewController , PaySDKDelegate
- Objective C
#import #import @import AP_PaySDK- (void)viewDidLoad { [super viewDidLoad]; . . .
4. Instantiate PaySDK class
- Swift Code
var paySDK = PaySDK.shared
- Objective C
paySDK = [PaySDK shared];
5. Set paySDK delegate
paySDK.delegate = self
WebView Payment Call
1) Setup paySDK Shared Object:
This is to share PaySDK class object using below method.
Code Sample:
- Swift Code
let paySDK = PaySDK.shared
- Objective C
paySDK = [PaySDK shared];
2) Setup Payment Data:
- Swift Code
paySDK.paymentDetails = PayData(channelType: PayChannel.WEBVIEW, payGate: PayGate.PAYDOLLAR, envType: EnvType.SANDBOX, merchantId: "1", payType: payType.NORMAL_PAYMENT, orderRef: "2018102409220001", payMethod: "VISA", lang: Language.ENGLISH, currCode: Currency.HKD, amount: 10, remark: "", extraData: [:])
- Objective C
paySDK.paymentDetails = [[PayData alloc] initWithChannelType: PayChannelWEBVIEW
envType: EnvTypeSANDBOX amount: @"10" payGate: PayGatePAYDOLLAR currCode: CurrencyCodeHKD payType: payTypeNORMAL_PAYMENT orderRef: @"abcde12345" payMethod: @"CC" lang: LanguageENGLISH merchantId: @"1" remark: @"" payRef: @"" resultpage: @"F" showCloseButton: true showToolbar: true webViewClosePrompt: @"Do you really want to close this page?" extraData: nil, merchantCapabilitiesData:nil supportedNetworksData:nil];
Parameters
Name | Mandatory | Data Type | Sample Data | Description |
amount | Yes | String | 20.00 | This Parameter is used to setup transaction amount. |
payGate | Yes | enum | PayGate.PESOPAY | This parameter is used setup the payment gateway fortreansaction. i.e. (PAYDOLLAR, PESOPAY, SIAMPAY) |
envType | Yes | enum | EnvType.SANDBOX | This parameter is used to setup the environment type. i.e. (Sandbox, Production) |
currCode | Yes | enum | CurrencyCode.HKD | This Parameter is used to setup currency for the transaction. |
merchantId | Yes | String | 1254125 | |
payType | Yes | enum | payType.NORMAL_PAYMENT | This Parameter is used setup the payment type for the transaction. i.e (NORMAL_PAYMENT, HOLD_PAYMENT) |
orderRef | Yes | String | 156487515598 | This Parameter is used to setup the order reference number for the transaction. |
payMethod | Yes | String | VISA | This Parameter is used to setup payment method for the transaction. |
channelType | Yes | enum | PayChannel.DIRECT | This Parameter is used to setup payment channel for the transaction. i.e (WEBVIEW, DIRECT) |
lang | Yes | enum | Language.ENGLISH | This Parameter is used to setup payment language for the transaction. |
remark | No | String | remark | This Parameter is used to setup payment remark for the transaction. |
payRef | No | String | payRef | This parameter is used to setup payment reference number transaction. |
resultPage | No | Bool | resultPage | This parameter is used to setup result page transaction |
showCloseButton | No | Bool | F | If not specified, then by default this value is set to false. |
showToolbar | No | Bool | F | This parameter is used to Hide toolbar from Payment Page WebView. If not specified, then by default this value is set to true. |
webViewClosePrompt | No | String | Do you really want to close this page ? | Use below attribute to customise prompt message which user will see when they decide to close Payment Page |
extraData | No | Dictionary | ["deeplink":"3", "installment_service" : "T"] | This parameter is used to setup extraData for the value added service and other services. i.e. (Installment pay, promo pay, member pay, ,Alipay, Union pay) |
3) Setup RootViewController:
This is for giving the merchant app rootviewcontroller to present webview. It's an optional parameter.
- Swift Code
//For giving the merchant app rootviewcontroller to present webview. It's an optional parameter.paysdk.paymentDetails.presentController = PresentViewController(presentViewController:(UIApplication.shared.keyWindow?.rootViewController)!)
- Objective C
//For giving the merchant app rootviewcontroller to present webview. Its an optional parameter.paysdk.paymentDetails.presentController = [[PresentViewController alloc] initWithPresentViewController:[[[UIApplication sharedApplication]keyWindow]rootViewController]];
4) Trigger the Payment:
Call the SDK to trigger the payment process. For WebView flow, it will display a In-App Webview for the payment.
- Swift Code
paySDK.process()
- Objective C
[paySDK process];
Insert line aboveInsert line belowDelete
5) Prepare Response Handler:
Initialize a payment event handler to capture the payment response and result.
- Swift Code
func paymentResult(result: PayResult) {}
- Objective C
- (void)paymentResultWithResult:(PayResult * _Nonnull)result {}
WebView Sample:
6) Setup extra data for specific Payment Services. i.e (Schedule Pay, Promo Pay, Installment Pay, Member Pay)
Note: Follow the same process of direct and web view payment & add the below extra Parameters for specific Payment Services.
Payment Services:
Payment services name | Description | Reference Code |
Installment Pay | Installment Pay is a value added service which can be initiated by setting extra parameters, please refer the sample code link. | |
Schedule Pay | Schedule Pay is a value added service which can be initiated by setting extra parameters, please refer the sample code link. | |
Member Pay | Member Pay is a value added service which can be initiated by setting extra parameters, please refer the sample code link. | |
Promo Pay | Promo Pay is a value added service which can be initiated by setting extra parameters, please refer the sample code link. | |
EVoucher | EVoucher is a value added service which can be used by setting extra parameters, please refer the sample code link. |
Direct Payment Call
1) Setup paySDK Shared Object:
This is to share PaySDK class object using below method.
Code Sample:
- Swift Code
let paySDK = PaySDK.shared
- Objective C
paySDK = [PaySDK shared];
2) Setup Payment Data:
Initialise the PayData class and card details then prepare the payment detail for the transaction.
- Swift Code
paySDK.paymentDetails = PayData(channelType: PayChannel.DIRECT, envType: EnvType.SANDBOX, amount : “10”, payGate: PayGate.PAYDOLLAR, currCode: currencyCode.HKD, payType: payType.NORMAL_PAYMENT, orderRef: "2018102409220001”, payMethod: "VISA", lang: Language.ENGLISH, merchantId: "1", remark: "", extraData :[:])
- Objective C
paySDK.paymentDetails = [[PayData alloc] initWithChannelType:PayChannelDIRECT envType:EnvTypeSANDBOX amount:amountText.text payGate:PayGatePAYDOLLAR currCode:CurrencyCodeHKD payType:payTypeNORMAL_PAYMENT orderRef: orderRef payMethod:@"VISA" lang:LanguageENGLISH merchantId: merchantId remark:@"" payRef:@"" resultpage:resultPage showCloseButton: false showToolbar: false webViewClosePrompt: @"", extraData: nil, merchantCapabilitiesData:nil supportedNetworksData:nil];
Parameters
Name | Mandatory | Data Type | Sample Data | Description |
amount | Yes | String | 20.00 | This Parameter is used to setup transaction amount. |
payGate | Yes | enum | PayGate.PESOPAY | This parameter is used setup the payment gateway fortreansaction. i.e. (PAYDOLLAR, PESOPAY, SIAMPAY) |
envType | Yes | enum | EnvType.SANDBOX | This parameter is used to setup the environment type. i.e. (Sandbox, Production) |
currCode | Yes | enum | CurrencyCode.HKD | This Parameter is used to setup currency for the transaction. |
merchantId | Yes | String | 1254125 | |
payType | Yes | enum | payType.NORMAL_PAYMENT | This Parameter is used setup the payment type for the transaction. i.e (NORMAL_PAYMENT, HOLD_PAYMENT) |
orderRef | Yes | String | 156487515598 | This Parameter is used to setup the order reference number for the transaction. |
payMethod | Yes | String | VISA | This Parameter is used to setup payment method for the transaction. |
channelType | Yes | enum | PayChannel.DIRECT | This Parameter is used to setup payment channel for the transaction. i.e (WEBVIEW, DIRECT) |
lang | Yes | enum | Language.ENGLISH | This Parameter is used to setup payment language for the transaction. |
remark | No | String | remark | This Parameter is used to setup payment remark for the transaction. |
payRef | No | String | payRef | This parameter is used to setup payment reference number transaction. |
resultPage | No | Bool | resultPage | This parameter is used to setup result page transaction |
showCloseButton | No | Bool | F | If not specified, then by default this value is set to false. |
showToolbar | No | Bool | F | This parameter is used to Hide toolbar from Payment Page WebView. If not specified, then by default this value is set to true. |
webViewClosePrompt | No | String | Do you really want to close this page ? | Use below attribute to customise prompt message which user will see when they decide to close Payment Page |
extraData | No | Dictionary | ["deeplink":"3", "installment_service" : "T"] | This parameter is used to setup extraData for the value added service and other services. i.e. (Installment pay, promo pay, member pay, ,Alipay, Union pay) |
3) Setup cardDetails:
- Swift Code
paySDK. paymentDetails.cardDetails = CardDetails(cardHolderName: “abc abc”, cardNo: "4918914107195011”, expMonth: “11”, expYear: “2011”, securityCode: “123”)
- Objective C
paySDK.paymentDetails.cardDetails = [[CardDetails alloc] initWithCardHolderName:@"Test Card" cardNo:@"4918914107195011", expMonth:@"11", expYear:@"2011", securityCode:@"123"];
Card Details Parameters
Parameter Name | Data Type | Sample Data | Description |
cardNo | String | 1234567890123456 | Use to set the card number. |
expMonth | String | 07 | Use to set card expiry month. |
expYear | String | 2023 | Use to set card expiry year. |
securityCode | String | 123 | This method is used to set credit card verification code. |
cardHolderName | String | test | Use to set the card holder name. |
4) Trigger the Payment:
Call the SDK to trigger the payment process. For WebView flow, it will display a In-App Webview for the payment.
paySDK.process()
- Objective C
[paySDK process];
5) Prepare Response Handler:
Initialize a payment event handler to capture the payment response and result.
- Swift Code
func paymentResult(result: PayResult) {}
- Objective C
Objective-C- (void)paymentResultWithResult:(PayResult * _Nonnull)result {}
UI Customization
UiCustomization class is used for customization of the UI according to the app. This class is inherited class of PaySDKUiCustomization. You can customize the ToolbarCustomization
, LabelCustomization, TextBoxCustomization
, ButtonCustomization
- ToolbarCustomization
ToolbarCustomization class is used for customization of the toolbar according to the app toolbar. This class is inherited class of Customization, PaySDKToolbarCustomization. You can customize the text font name, text color, text font size, backgroundtColor, header Text and rightBarButtonText.
- LabelCustomization
LabelCustomization class is used for customization of the label according to the app label. This class is inherited class of Customization, PaySDKLabelCustomization. You can customize the text font name, text color, text font size, headingTextColor, headingTextFontName and headingTextFontSize.
- TextBoxCustomization
TextBoxCustomization class is used for customization of the textbox according to the app. This class is inherited class of Customization, PaySDKTextBoxCustomization. You can customize the text properties of text box like textFontName, textColor, textFontSize and textbox properties like borderWidth, borderColor, cornerRadius .
- ButtonCustomization
ButtonCustomization class is used for customization of the button according to the app. This class is inherited class of Customization, PaySDKButtonCustomization. You can customize the text properties of button like textFontName, textColor, textFontSize and button properties like backgroundColor, cornerRadius.
Code Sample
- Swift Code
let customization = UiCustomization()let submitButtonCustomization = ButtonCustomization("Courier", "#FF0000", 15, "#d3d3d3", 4)let resendButtonCustomization = ButtonCustomization("Courier", "#FF0000", 15, "#d3d3d3", 4)let cancelButtonCustomization = ButtonCustomization("Courier", "#FF0000", 15, "#d3d3d3", 4)let nextButtonCustomization = ButtonCustomization("Courier", "#FF0000", 15, "#d3d3d3", 4)let continueButtonCustomization = ButtonCustomization("Courier", "#FF0000", 15, "#d3d3d3", 4)let labelCustomization = LabelCustomization("Courier", "FF0000", 14, "FF0000", "Courier", 20)let textboxCustomization = TextBoxCustomization("Courier", "#FF0000", 14, 5, "#d3d3d3", 4)let toolBarCustomization = ToolbarCustomization("Courier", "#FFFFFF", 20, "#000000", "Header Text", "Close Button Text")try! customization.setButtonCustomization(submitButtonCustomization, .SUBMIT)try! customization.setButtonCustomization(resendButtonCustomization, .RESEND)try! customization.setButtonCustomization(cancelButtonCustomization, .CANCEL)try! customization.setButtonCustomization(nextButtonCustomization, .NEXT)try! customization.setButtonCustomization(continueButtonCustomization, .CONTINUE)try! customization.setLabelCustomization(labelCustomization)try! customization.setTextBoxCustomization(textboxCustomization)try! customization.setToolbarCustomization(toolBarCustomization)paySDK.uiCustomization = customization
- Objective C
UiCustomization *customization = [[UiCustomization alloc] init];ButtonCustomization *submitButtonCustomization = [[ButtonCustomization alloc] init:@"Courier" :@"#FF0000" :15 :@"#d3d3d3" :4];ButtonCustomization *resendButtonCustomization = [[ButtonCustomization alloc] init:@"Courier" :@"#FF0000" :15 :@"#d3d3d3" :4];ButtonCustomization *cancelButtonCustomization = [[ButtonCustomization alloc] init:@"Courier" :@"#FF0000" :15 :@"#d3d3d3" :4];ButtonCustomization *nextButtonCustomization = [[ButtonCustomization alloc] init:@"Courier" :@"#FF0000" :15 :@"#d3d3d3" :4];ButtonCustomization *continueButtonCustomization = [[ButtonCustomization alloc] init:@"Courier" :@"#FF0000" :15 :@"#d3d3d3" :4];LabelCustomization *labelCustomization = [[LabelCustomization alloc] init:@"Courier" :@"#FF0000" :14 :@"#FF0000":@"Courier" :20];TextBoxCustomization *textBoxCustomization = [[TextBoxCustomization alloc] init:@"Courier" :@"FF0000" :14 :4 :@"FF0000" :4];// ToolbarCustomization *toolbarCustomization = [[ToolbarCustomization alloc] init:@"Courier" :@"#FFFFFF" :20 :@"#000000" :@"Payment Page"];NSError *err;[customization setLabelCustomization:labelCustomization error:&err];[customization setButtonCustomization:submitButtonCustomization : PaySDKButtonTypeSUBMIT error:&err];[customization setButtonCustomization:resendButtonCustomization : PaySDKButtonTypeRESEND error:&err];[customization setButtonCustomization:cancelButtonCustomization : PaySDKButtonTypeCANCEL error:&err];[customization setButtonCustomization:nextButtonCustomization : PaySDKButtonTypeNEXT error:&err];[customization setButtonCustomization:continueButtonCustomization : PaySDKButtonTypeCONTINUE error:&err];[customization setLabelCustomization:labelCustomization error:&err];[customization setTextBoxCustomization:textBoxCustomization error:&err];//[customization setToolbarCustomization:toolbarCustomization error:&err];[paySDK setUiCustomization:customization];
Value Added Services
Alipay Global Payment Call
1)Initialization Step:
a) Add URL Type in info .plist file

b) In AppDelegate file add
var paySDK = PaySDKClass.shared
AND
func application(_ app: UIApplication, open url: URL, options:[UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { paySDK.processOrder(url: url) return true;}
2) Prepare Payment Call:
Initialize the PayData class and prepare the payment detail for the transaction.
paySDK.paymentDetails = PayData(channelType: PayChannel.DIRECT, envType: EnvType.SANDBOX, amount: 0.1, payGate: PayGate.PAYDOLLAR, currCode: currencyCode.HKD, payType: payType.NORMAL_PAYMENT, orderRef: "2018102409220001", payMethod: "ALIPAYAPP", lang: Language.ENGLISH, merchantId: "1", remark: "test", extraData : [:])
3) Trigger the Payment:
Call the SDK to trigger the payment process.
paySDK.process()
If app is installed on device then get response in AppDelegate openurl function
func application(_ app: UIApplication, open url: URL, options:[UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { paySDK.processOrder(url: url) return true;}
4) Prepare Response Handler:
Initialize a payment event handler to capture the payment response and result.
func paymentResult(result: PayResult) {}
Alipay HK Payment Call
1)Initialization Step:
- Add URL Type in info .plist file

2. In AppDelegate file add
var paySDK = PaySDKClass.shared
AND
func application(_ app: UIApplication, open url: URL, options:[UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { paySDK.processOrder(url: url) return true;}
2) Prepare Payment Call:
Call the SDK to trigger the payment process.
paySDK.paymentDetails = PayData(channelType: PayChannel.DIRECT, envType: EnvType.SANDBOX, amount: 0.1, payGate: PayGate.PAYDOLLAR, currCode: currencyCode.HKD, payType: payType.NORMAL_PAYMENT, orderRef: "2018102409220001", payMethod: "ALIPAYHKAPP", lang: Language.ENGLISH, merchantId: "1", remark: "test", extraData : [:])
3) Trigger the Payment:
Call the SDK to trigger the payment process.
paySDK.process()
If app is installed on device then get reponse in AppDelegate openurl function
func application(_ app: UIApplication, open url: URL, options:[UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { paySDK.processOrder(url: url) return true;}
4) Prepare Response Handler:
Initialize a payment event handler to capture the payment response and result.
func paymentResult(result: PayResult) {}
This method returns object of PayResult class.
Alipay China Payment Call
1)Initialization Step:
1. Add URL Type in info .plist file

2. In AppDelegate file add
var paySDK = PaySDKClass.shared
And
func application(_ app: UIApplication, open url: URL, options:[UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { paySDK.processOrder(url: url) return true}
2) Prepare Payment Call:
Initialize the PayData class and prepare the payment detail for the transaction.
paySDK.paymentDetails = PayData(channelType: PayChannel.DIRECT, envType: EnvType.SANDBOX, amount: 0.1, payGate: PayGate.PAYDOLLAR, currCode: currencyCode.HKD, payType: payType.NORMAL_PAYMENT, orderRef: "2018102409220001", payMethod: "ALIPAYCNAPP", lang: Language.ENGLISH, merchantId: "1", remark: "test", extraData : [:])
3) Trigger the Payment:
Call the SDK to trigger the payment process.
paySDK.process()
If app is installed on device then get reponse in AppDelegate openurl function
func application(_ app: UIApplication, open url: URL, options:[UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool { paySDK.processOrder(url: url) return true;}
4) Prepare Response Handler:
Initialize a payment event handler to capture the payment response and result.
func paymentResult(result: PayResult) {}
WeChat Pay Payment Call
Merchant must provide application bundle id and universal link of app (optional) to PayDollar/SiamPay/PesoPay.
PayDollar/SiamPay/PesoPay will provide app key for WeChat Pay services.
1)Initialization Step
- Add URL Type in info .plist file
<key>LSApplicationQueriesSchemes</key>
<array>
<string>weixinULAPI</string>
<string>weixin</string>
</array>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>weixin</string>
<key>CFBundleURLSchemes</key>
<array>
<string>WECHAT-APP-ID</string>
</array>
</dict>
</array>

- In AppDelegate file add
var paySDK = PaySDKClass.shared
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool{
paySDK.processOrder(url: url)
return true;
}
2) Prepare Payment Call:
Initialize the PayData class and prepare the payment detail for the transaction.
- Swift Code
paySDK.paymentDetails = PayData(channelType: PayChannel.DIRECT, envType: EnvType.SANDBOX, amount: 0.1, payGate: PayGate.PAYDOLLAR, currCode: CurrencyCode.HKD, payType: payType.NORMAL_PAYMENT, orderRef: "2018102409220001", payMethod: "WECHATAPP", lang: Language.ENGLISH, merchantId: "1", remark: "test", payRef: "", resultpage: @"F", showCloseButton: false, showToolbar: true, webViewClosePrompt: "", extraData: ["weChatUniversalLink":"https://<domain-name>.com"]) paySDK.process()
- Objective C
NSDictionary *dic = @{@"wechatUniversalLink": @"https://<domain-name>.com"};extraData = [[NSMutableDictionary alloc] initWithDictionary: dic];paySDK.paymentDetails = [[PayData alloc] initWithChannelType: PayChannelDIRECT envType: EnvTypeSANDBOX amount: @"1.0" payGate: PayGatePAYDOLLAR currCode: CurrencyCodeHKD payType: payTypeNORMAL_PAYMENT orderRef: @"2018102409220001" payMethod: @"WECHATAPP" lang: LanguageENGLISH merchantId: @"1" remark: @"" payRef: @"" resultpage: @"F" showCloseButton: false showToolbar: true webViewClosePrompt: @"" extraData: extraData];[paySDK process];
3)Trigger the Payment: Call the SDK to trigger the payment process.
paySDK.process()
4) Prepare Response Handler:
Initialize a payment event handler to capture the payment response and result.
func paymentResult(result: PayResult) {}
3DS 2.0 Payment Call
1)Prepare Payment Call:
Initialize the PayData class and card details then prepare the payment detail for the transaction.
paySDK.paymentDetails = PayData(channelType: PayChannel.DIRECT, envType: EnvType.SANDBOX, amount : “10”, payGate: PayGate.PAYDOLLAR, currCode: CurrencyCode.HKD, payType: payType.NORMAL_PAYMENT, orderRef: "2018102409220001”, payMethod: "THREEDS2", lang: Language.ENGLISH, merchantId: "1", remark: "", payRef: "", resultpage: "F", showCloseButton: false, showToolbar: true, webViewClosePrompt: "", extraData: [:])paySDK.paymentDetails.cardDetails = CardDetails(cardHolderName: “abcabc”, cardNo: "4918914107195011”, expMonth: “11”, expYear: “2011”, securityCode: “123”) var threeDSParams = ThreeDSParams()threeDSParams.threeDSCustomerEmail = "example@example.com"...threeDSParams.threeDSDeliveryEmail = "example1@example.com"paySDK.paymentDetails.threeDSParams = threeDSParamspaySDK.process()
- Objective C
ThreeDSParams *threeDSParams = [[ThreeDSParams alloc] init];threeDSParams.threeDSCustomerEmail = @"example@example.com";...threeDSParams.threeDSDeliveryEmail = @"example@example.com";paySDK.paymentDetails.threeDSParams = threeDSParams;paySDK.paymentDetails = [[PayData alloc] initWithChannelType: PayChannelWEBVIEW envType: EnvTypeSANDBOX amount: @"1" payGate: PayGatePAYDOLLAR currCode: CurrencyCodeHKD payType: payTypeNORMAL_PAYMENT orderRef: orderRef payMethod: @"THREEDS2" lang: LanguageENGLISH merchantId: @"1234" remark: @"123" payRef: @"" resultpage: @"F" showCloseButton: false showToolbar: true webViewClosePrompt: @"Do you really want to close this page?" extraData: nil];//For giving the merchant app rootviewcontroller to present webview. Its an optional parameter.paysdk.paymentDetails.presentController = [[PresentViewController alloc] initWithPresentViewController:[[[UIApplication sharedApplication]keyWindow]rootViewController]]; [paySDK process];
List of Parameters merchant can set
apiUsername | threeDSAcctCreateDate |
apiPassword | threeDSAcctAgeInd |
threeDSCustomerEmail | threeDSAcctLastChangeDate |
threeDSDeliveryEmail | threeDSAcctLastChangeInd |
threeDSMobilePhoneCountryCode | threeDSAcctPwChangeDate |
threeDSMobilePhoneNumber | threeDSAcctPwChangeInd |
threeDSHomePhoneCountryCode | threeDSAcctPurchaseCount |
threeDSHomePhoneNumber | threeDSAcctCardProvisionAttempt |
threeDSWorkPhoneCountryCode | threeDSAcctNumTransDay |
threeDSWorkPhoneNumber | threeDSAcctNumTransYear |
threeDSBillingCountryCode | threeDSAcctPaymentAcctDate |
threeDSBillingState | threeDSAcctPaymentAcctInd |
threeDSBillingCity | threeDSAcctShippingAddrLastChangeDate |
threeDSBillingLine1 | threeDSAcctShippingAddrLastChangeInd |
threeDSBillingLine2 | threeDSAcctIsShippingAcctNameSame |
threeDSBillingLine3 | threeDSAcctIsSuspiciousAcct |
threeDSBillingPostalCode | threeDSAcctAuthMethod |
threeDSShippingDetails | threeDSAcctAuthTimestamp |
threeDSShippingCountryCode | threeDSDeliveryTime |
threeDSShippingState | threeDSPreOrderReason |
threeDSShippingCity | threeDSPreOrderReadyDate |
threeDSShippingLine1 | threeDSGiftCardAmount |
threeDSShippingLine2 | threeDSGiftCardCurr |
threeDSShippingLine3 | threeDSGiftCardCount |
Type of Challenge for Payment via 3DS 2.0
- Challenge Information TextBox
- Single and Multi-select Fields
- Out of Band
- HTML
UI - Customization for Challenge View for Merchant

Pay Method
Swift Code
This method is used to setup the payment configurations like merchantId, environmentType and paymentGateway.
paySDK.paymentDetails = PayData(channelType: PayChannel.DIRECT,
envType: EnvType.SANDBOX,
amount :“1”,
payGate: PayGate.PAYDOLLAR,
currCode: CurrencyCode.HKD,
payType: payType.NORMAL_PAYMENT,
orderRef: "2018102409220001”,
payMethod: "VISA",
lang: Language.ENGLISH,
merchantId: "88146271",
remark: "",
payRef: "",
resultpage: "F",
showCloseButton: false,
showToolbar: true,
webViewClosePrompt: "",
extraData : [])paySDK.query(action: "PAYMENT_METHOD")//NOTE : For allowed Pay Method Response will come in below formatfunc payMethodOptions(method: PaymentOptionsDetail) {
//process the method }}
Objective C Code
paySDK.paymentDetails = [[PayData alloc] initWithChannelType: PayChannelNONE
envType: EnvTypeSANDBOX
amount: @"1"
payGate: PayGatePAYDOLLAR
currCode: CurrencyCodeHKD
payType: payTypeNORMAL_PAYMENT
orderRef: "2018102409220001”,
payMethod: @"ALL"
lang: LanguageENGLISH
merchantId: @"1"
remark: @"123"
payRef: @""
resultpage: resultPage
showCloseButton: false
showToolbar: true
webViewClosePrompt: @""
extraData: nil];[paySDK queryWithAction:@"PAYMENT_METHOD"];//NOTE : For allowed Pay Method Response will come in below format(void)payMethodOptionsWithMethod:(PaymentOptionsDetail * _Nonnull)method {
//process the method
}
Sample Response
{
"methods": {
"card": [
{
"bnk": "CITIBANK",
"mth": "AMEX"
},
{
"bnk": "CITIBANK",
"mth": "JCB"
},
{
"bnk": "CITIBANK",
"mth": "Master"
},
{
"bnk": "SBM",
"mth": "UPOP"
},
{
"bnk": "CITIBANK",
"mth": "VISA"
}
],
"other": [
{
"bnk": "ALIPAY",
"mth": "ALIPAY"
},
{
"bnk": "ALIPAY",
"mth": "ALIPAYAPP"
},
{
"bnk": "ALIPAY",
"mth": "ALIPAYHKAPP"
},
{
"bnk": "ALIPAYHK",
"mth": "ALIPAYHKONL"
},
{
"bnk": "UPSRC-BOCHK",
"mth": "CUP"
},
{
"bnk": "HSBC",
"mth": "FPS"
},
{
"bnk": "GRABPAY",
"mth": "GRABPAY"
},
{
"bnk": "GRABPAY",
"mth": "GRABPAYOFFL"
},
{
"bnk": "OCTOPUS",
"mth": "OCTOPUS"
},
{
"bnk": "PAYPAL",
"mth": "PAYPAL"
},
{
"bnk": "HSBC",
"mth": "PayMe"
},
{
"bnk": "TENPAY",
"mth": "WECHATAPP"
},
{
"bnk": "TENPAY",
"mth": "WECHATONL"
}
]
}
}
Transaction Query
Swift Code
paySDK.paymentDetails = PayData(channelType: PayChannel.DIRECT,
envType: EnvType.SANDBOX,
amount :“1”,
payGate: PayGate.PAYDOLLAR,
currCode: CurrencyCode.HKD,
payType: payType.NORMAL_PAYMENT,
orderRef: "2018102409220001”,
payMethod: "VISA",
lang: Language.ENGLISH,
merchantId: "88146271",
remark: "",
payRef: "",
resultPage: "F"
showCloseButton: false,
showToolbar: true,
webViewClosePrompt: "",
extraData : [:]) paySDK.query(action:"TX_QUERY")//NOTE : For Trans Query Response will come in below format
func transQueryResults(result: TransQueryResults) {
//PROCESS RESPONSE
}
Objective C Code
paySDK.paymentDetails = [[PayData alloc] initWithChannelType: PayChannelDIRECT envType: EnvTypeSANDBOX amount: @"1" payGate: PayGatePAYDOLLAR currCode: CurrencyCodeHKD payType: payTypeNORMAL_PAYMENT orderRef: @"2018102409220001" payMethod: @"ALL" lang: LanguageENGLISH merchantId: merchantId remark: @"123" payRef: @"" resultpage: @"F" showCloseButton: false showToolbar: true webViewClosePrompt: @"" extraData: nil];[paySDK queryWithAction:@"TX_QUERY"];//NOTE : For Trans Query Response will come in below format- (void)transQueryResultsWithResult:(TransQueryResults * _Nonnull)result { //PROCESS RESPONSE}
Sample Response
{
"detail": [
{
"alertCode": "null",
"amt": "10",
"authId": "895033",
"cardIssuingCountry": "RU*",
"channelType": "DPS",
"cur": "344",
"eci": "07",
"errMsg": "Query Successfully",
"holder": "test user",
"ipCountry": "IN",
"MerchantId": "88146271",
"ord": "12345678",
"orderStatus": "Accepted",
"panFirst4": "4012",
"panLast4": "0006",
"payMethod": "VISA",
"payRef": "5895033",
"payerAuth": "U",
"prc": "0",
"ref": "2018102409220001",
"remark": "",
"sourceIp": "202.189.254.46",
"src": "0",
"successcode": "0",
"txTime": "2019-09-09 15:29:16.0"
}
],
"resultCode": "0"
}
Appendix
eWallet Direct Connection
Tokenization Flow
Data Feed Handling
To use data feed function, merchant has to create a data feed page and inform payment gateway system about the location of your page (e.g. http://www.yourdomain.com/datafeed.jsp). Merchant can enable or disable this function in the merchant administration site.
Transaction Security By Secure Hash
Multi-Currency Processing Service
Functions Of Merchant API
Exceptional Transaction Handling
This section explains various scenarios of transactions, other than good and successful transactions that may occur.
Payment Methods by Regions/Countries
Australia
Payment Options | Payment Methods |
Credit and Debit Card | American Express, China UnionPay, Mastercard, Visa |
Internet Banking | PayTo, PayID |
Digital Wallet | Alipay, PayPal, PayID, WechatPay |
Buy Now Pay Later | AfterPay, Humm, Zip |
China
Payment Options | Payment Methods |
Credit and Debit Card | American Express, JCB, Mastercard, Visa |
Digital Wallet | Alipay, WechatPay |
Hong Kong
Payment Options | Payment Methods |
Credit and Debit Card | American Express, China UnionPay, Diners, Discover, JCB, Mastercard, Visa |
Digital Wallet | Alipay, Alipay HK, WeChat Pay, Paypal, BoC Pay, PayMe, Octopus, FPS, PPS, Google Pay, Samsung Pay, Apple Pay |
Bank Account and Net Banking | FPS, PPS |
Global (no grouping) | Apple Pay, Google Pay, Samsung Pay, Click to Pay |
Installment | Visa Instalment |
India
Payment Options | Payment Methods |
Credit and Debit Card | American Express, Mastercard, RuPay, Visa |
Bank Account and Net Banking | NetBanking, UPI |
Digital Wallet | ITZ Cash Card, Mobikwik, PhonePe, Yes Bank Wallet |
Installment | EMI |
Indonesia
Payment Options | Payment Methods |
Credit and Debit Card | American Express, JCB, Mastercard, Visa |
Bank Account and Net Banking | BCA KlikPay, BNI Virtual Account, CIMB Clicks, Danamon Virtual Account, Mandiri Clickpay, Permata Virtual Account |
Over-the-counter | Alfamart Group, Indomaret |
Digital Wallet | Dana |
Buy Now Pay Later | Kredivo, Indodana |
Japan
Payment Options | Payment Methods |
Digital Wallet | Alipay HK |
Korea
Payment Options | Payment Methods |
Credit and Debit Card | MasterCard, Virtual Account, Visa |
Digital Wallet | Naver Pay, Kakao Pay, PayCo |
Others | Toss |
Macau
Payment Options | Payment Methods |
Credit and Debit Card | American Express, JCB, Mastercard, Visa |
Crypto | BNB (Binance), BTC (Bitcoin), ETH (Ethereum), LBTC (Lightning Bitcoin), USDC (USD Coin), USDT (Tether) |
Others | ALIPAYHKONL, WECHATONL |
Malaysia
Payment Options | Payment Methods |
Credit and Debit Card | American Express, China UnionPay, Discover, JCB, Mastercard, Visa |
Bank Account and Net Banking | FPX |
Crypto | BNB (BINANCE), BTC (Bitcoin), ETH (Ethereum), LBTC (Lightning Bitcoin), USDC (USD Coin), USDT (Tether) |
Digital Wallet | Alipay, WechatPay, PayPal , BOOST, TouchnGo, Scan & Pay by MAE, GrabPay, Shopback Pay |
Buy Now Pay Later | Atome, PayLater by Grab |
Philippines
Payment Options | Payment Methods |
Credit and Debit Card | American Express, China UnionPay, Diners, Dicover, JCB, Mastercard, Visa |
Bank Account and Net Banking | BDO (Brankas), BPI, Landbank (Brankas), Metrobank (Brankas), RCBC (Brankas), Unionbank (Brankas) |
Digital Wallet | Gcash, Grabpay, ShopeePay, MAYA, Alipay, Wechatpay |
Over-the-counter | Bayad Center, BDO, Cebuana, ECPay, RCBC |
Others | PayPal |
Buy Now Pay Later | TendoPay |
Singapore
Payment Options | Payment Methods |
Credit and Debit Card | American Express, China UnionPay, Diners, Discover, JCB, Mastercard, Visa |
Bank Account and Net Banking | ENETS, PayNow |
Crypto | BNB (Binance), BTC (Bitcoin), ETH (Ethereum), LBTC (Lightning Bitcoin), USDC (USD Coin), USDT (Tether) |
Digital Wallet | GrabPay, Shopback Pay, ShopeePay, Alipay, Wechatpay, SGQR, PayPal |
Buy Now Pay Later | Atome, PayLater by Grab, Shopee SPayLater |
Taiwan
Payment Options | Payment Methods |
Global (no grouping) | Apple Pay, Google Pay, Samsung Pay |
Credit and Debit Card | JCB, MasterCard, Visa |
Digital Wallet | Linepay, Jkopay, Apple Pay , Google Pay |
Thailand
Payment Options | Payment Methods |
Global (no grouping) | GooglePay |
Credit and Debit Card | American Express, China UnionPay, JCB, Mastercard, Visa |
Bank Account and Net Banking | BAY, BBL, KBANK, SCB, TMB, UOB |
Digital Wallet | Paypal |
Buy Now Pay Later | Atome |
Over-the-counter | BBL, Kbank, KTB, Lotus, Mpay, TTB, UOB |
Vietnam
Payment Options | Payment Methods |
Credit and Debit Card | American Express, JCB, Mastercard, Visa |
Internet Banking | NAPAS (43 banks), OnePay |
Buy Now Pay Later | Kredivo |
Digital Wallet | MoMo |