如何实现IPay88支付网关SDK?

时间:2018-01-24 10:52:56

标签: android payment-gateway

我正在为马来西亚开发一个应用程序,我想在我的代码中实现IPay88 sdk所以请为我提供一个指导,这将是我的日子,我有MERCHANT CODE和MERCHANT KEY,我从下载jar文件this link

1 个答案:

答案 0 :(得分:1)

让我们从一步一步的解决方案或指南开始

  1. 将jar导入您的代码follow this link

  2. 然后在需要实施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");
    }}
    
  3. 现在拨打ipay88的意图并传递付款明细

    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("xyz@xyz.com");
    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支付网关的文档。

  4. 希望你满意答案。