我正在为马来西亚开发一个应用程序,我想在我的代码中实现IPay88 sdk,所以请为此提供一个指南,这将节省我的时间,我有MERCHANT CODE和MERCHANT KEY,并且我从this link下载jar文件
最佳答案
让我们从逐步解决方案或指南开始
将jar导入您的代码follow this link
然后在需要实现IpayResultDelegate
之后,它可以获取付款结果,例如付款成功或失败。
public class ResultDelegatePaymentMethod implements IpayResultDelegate, Serializable {
@Override
public void onPaymentSucceeded(String transId, String refNo, String amount, String remarks, String auth) {
Log.e("tag", "onPaymentSucceeded");
}
@Override
public void onPaymentFailed(String transId, String refNo, String amount, String remarks, String err) {
Log.e("tag", "onPaymentFailed");
}
@Override
public void onPaymentCanceled(String transId, String refNo, String amount, String remarks, String err) {
Log.e("tag", "onPaymentCanceled");
}
@Override
public void onRequeryResult(String MerchantCode, String RefNo, String Amount, String Result) {
Log.e("tag", "onRequeryResult");
}}
现在调用ipay88的Intent并通过付款细节
IpayPayment payment = new IpayPayment();
payment.setMerchantKey(CommonKeyword.MERCHANT_KEY);
payment.setMerchantCode(CommonKeyword.MERCHANT_CODE);
payment.setPaymentId("16");//there are many payment id i attach image for it
payment.setCurrency("MYR");
payment.setRefNo("refno010"); //pass string value as a reference
payment.setAmount("1.00"); //amount in MYR
payment.setProdDesc("product desc");//product description
payment.setUserName("username");
payment.setUserEmail("[email protected]");
payment.setUserContact("06010101011");
payment.setRemark("test");
payment.setCountry("MY");
payment.setBackendPostURL("payment url of backend ex. http://xyz.payment.php");
Intent checkoutIntent = Ipay.getInstance().checkout(payment, MyActivity.this, new ResultDelegatePaymentMethod());
startActivityForResult(checkoutIntent, 1);
finish();
4.参数混乱? -需要参考Ipay88付款网关的文档。
希望您对答案感到满意。
关于android - 如何实现IPay88支付网关SDK?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/48420680/