PayDollar is a global payment gateway that accepts payments from more than 200 countries.The PaySDK ensures payment is authorised by 3DS 2.0
- Direct Client Side Connection
- Client Post through Browser Side Connection
- Payment via Alipay
- minSdkVersion 19
Merchant need to integrate certificate. This certificate will be provided when merchant apply for the SDK service from PayDollar Dashboard.
Add paysdk.properties
file in project Assests folder and set value of certificate.
e.g merchant_rsa_publickey=GDJDFGHJHFGJHGJAQEF6H57F6JKNP489TFNKGH9874HNFDKLH98YHJVH78E67JNJVH98DFJJKDH099FDJKF
domain=Third Level Domain
Add paydollarsdk-release.aar
in project lib folder and add below code in grade file
repositories {
flatDir {
dirs 'libs'
}
}
Add below line in the dependencies to project’s gradle file
implementation(name: 'PaySDK-2.7.69', ext: 'aar')
implementation 'com.google.code.gson:gson:2.3.1'
implementation 'com.google.android.gms:play-services-ads:11.8.0'
implementation 'com.google.android.gms:play-services-location:11.8.0'
implementation 'com.google.android.material:material:1.2.0-alpha04'
implementation 'com.android.volley:volley:1.1.1'
implementation 'org.bouncycastle:bcprov-jdk15on:1.60'
implementation 'com.squareup.retrofit2:converter-gson:2.2.0'
implementation 'com.fasterxml.jackson.core:jackson-core:2.7.3'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.7.3'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.7.3'
implementation 'org.greenrobot:eventbus:3.0.0'
Instantiate PaySDK class with context.
PaySDK paySDK = new PaySDK(getApplicationContext());
OR
You can also pass the SDK public key at the initialize process
PaySDK paySDK = new PaySDK(getApplicationContext(),sdkPublicKey)
Creating PayData for payment and process.
PayData payData = new PayData();
payData.setChannel(EnvBase.PayChannel.WEBVIEW);
payData.setEnvType(EnvBase.EnvType.SANDBOX);
payData.setAmount("10");
payData.setPayGate(EnvBase.PayGate.PAYDOLLAR);
payData.setCurrCode(EnvBase.Currency.HKD);
payData.setPayType(EnvBase.PayType.NORMAL_PAYMENT);
payData.setOrderRef("abcde12345");
payData.setPayMethod("CC");
payData.setLang(EnvBase.Language.ENGLISH);
payData.setMerchantId("1");
payData.setRemark("additional remark");
payData.setShowCloseButton(true);//If not specified, then by default this value is set to false
paySDK.setRequestData(payData);
paySDK.process();
PayData payData = new PayData();
payData.setChannel(EnvBase.PayChannel.DIRECT);
payData.setEnvType(EnvBase.EnvType.SANDBOX);
payData.setAmount("10");
payData.setPayGate(EnvBase.PayGate.PAYDOLLAR);
payData.setCurrCode(EnvBase.Currency.HKD);
payData.setPayType(EnvBase.PayType.NORMAL_PAYMENT);
payData.setOrderRef("abcde12345");
payData.setPayMethod("VISA");
payData.setLang(EnvBase.Language.ENGLISH);
payData.setMerchantId("1");
CardDetails cardDetails=new CardDetails();
cardDetails.setCardNo("1234567890123456");
cardDetails.setEpMonth("01");
cardDetails.setEpYear("2020");
cardDetails.setSecurityCode("123");
cardDetails.setCardHolder("abc abc");
payData.setCardDetails(cardDetails);
payData.setRemark("additional remark");
paySDK.setRequestData(payData);
paySDK.process();
paySDK.responseHandler(new PaymentResponse() {
@Override
public void getResponse(PayResult payResult) {
}
@Override
public void onError(Data data) {
}
});
successCode | prc | Error Code | Error Type | Error Message |
---|---|---|---|---|
1 | -10 | EI01 | Invalid Payment Method | Invalid Payment Method Exception |
1 | -10 | ET01 | System Timeout | Timeout Exception |
For detailed parameters description kindly follow PayDollar Guide.
For PaySDK Demo App follow https://github.com/asiapay-lib/paysdk-android-demo