Add it to your build.gradle with:
allprojects {
repositories {
maven { url "https://jitpack.io" }
}
}
and:
dependencies {
compile 'com.github.RevenueMonster:RM-Android:{latest version}'
}
try {
new Checkout(MainActivity.this).getInstance().
setEnv(<<Environment Parameter>>). // set environment
setWeChatAppID("<< WeChat Open Platform AppID >>"). // only use for wechatpay
setCardInfo("<<Card Holder Name>>","<<Card No>>","<<Cvc No>>","<<Exp Month>>","<<Exp Year>>","<<Country Code>>","<<Card Save>>"). // only use for new card
setToken("<<Card Token>>","<<Cvc No>>"). // only use if use existing card token
setBankCode("<<Set Bank Code>>"). // only use for fpx, get the bank code from open api
pay(<<Method Parameter>>,"<<Get Checkout Id from API>>", new Result());
} catch(Exception e) {
e.printStackTrace();
}
// Callback Result
static public class Result implements PaymentResult {
public void onPaymentSuccess(Transaction transaction) {
Log.d("SUCCESS", transaction.getStatus());
}
public void onPaymentFailed(Error error) {
Log.d("FAILED", error.getCode());
}
public void onPaymentCancelled() {
Log.d("CANCELLED", "User cancelled payment");
}
}
- SANDBOX
- PRODUCTION
- WECHATPAY_MY
- TNG_MY
- BOOST_MY
- ALIPAY_CN
- GRABPAY_MY
- MCASH_MY
- RAZERPAY_MY
- PRESTO_MY
- GOBIZ_MY
- FPX_MY
- Go to https://open.weixin.qq.com/ and click Log In.
- Navigate to Admin Center > Mobile Application > Create Mobile Application, and input name, short introduction, official website, and package name.
try {
new Checkout(MainActivity.this).getInstance().
setEnv(<<Environment Parameter>>). // set environment
setWeChatAppID("<< WeChat Open Platform AppID >>"). // only use for wechatpay
pay(<<Method Parameter>>,"<<Get Checkout Id from API>>", new Result());
} catch(Exception e) {
e.printStackTrace();
}