什么是 android 中 paytm 支付网关集成中的客户端证书?

Posted

技术标签:

【中文标题】什么是 android 中 paytm 支付网关集成中的客户端证书?【英文标题】:what is Client side certificate in paytm payment gateway integration in android? 【发布时间】:2017-06-28 14:37:20 【问题描述】:

我几乎与以下this link集成了paytm支付网关

paytm 支付网关集成中的客户端证书是什么?他们提到它应该包含在原始文件夹中。我在哪里可以获得客户端证书

仅供参考:即使在the sample paytm integration app 中也不包含客户端证书

【问题讨论】:

【参考方案1】:

您可以将其作为 null 传递。文档中也提到了

inCertificate 是持有证书信息的对象。 如果商家没有使用客户端证书(如 上面的先决条件部分中给出)

【讨论】:

如果我使用 null,它会显示 找不到客户端证书 并在交易过程中停止为 Cannot POST / 你能发布完整的错误日志吗?开发人员在集成 paytm 网关时遇到的主要问题是哈希问题 你说的完全正确。我犯了一个错误,发送了错误的手机号码(不是 10 位数字)。就我而言,这就是错误。任何方式谢谢你:)【参考方案2】:

我建议您使用 PGSDK 2.0 而不是不需要任何客户端证书

的旧版本
----------
protected void onCreate(Bundle savedInstanceState) 

        super.onCreate( savedInstanceState );

 PaytmButton.setOnClickListener( new OnClickListener() 

            @Override
            public void onClick(View v) 
                 getPaytmWindow() ;
            
         );





private void getPaytmWindow(String checksum) 
//use PaytmPGService Service = PaytmPGService.getProductionService();in production//

  PaytmPGService Service = PaytmPGService.getStagingService();


        //Kindly create complete Map and checksum on your server side and then put it here in paramMap.

        Map<String, String> paramMap = new HashMap<String, String>();
        paramMap.put( "MID", abc14146028455452" );
        paramMap.put( "ORDER_ID", "GTR6079" );
        paramMap.put( "CUST_ID", "1132" );
        paramMap.put( "INDUSTRY_TYPE_ID", "Retail" );
        paramMap.put( "CHANNEL_ID", "WAP" );
        paramMap.put( "TXN_AMOUNT", "76" );
        paramMap.put( "WEBSITE", "APP_STAGING" );
        paramMap.put( "EMAIL", "test@gmail.com" );
        paramMap.put( "MOBILE_NO", "7777777777" );
        paramMap.put( "CALLBACK_URL", "https://pguat.paytm.com/paytmchecksum/paytmCallback.jsp" );
        paramMap.put( "CHECKSUMHASH", "DkrZCCNCKS0h4IbLEk8HWqTClr6PCK/+Zh3xyW7fXfOsfHsmhmt3/wGx5pxgWrCSNCObPHyYFE3VJob0v7QQdkBFNyNAO7CR2+e2BiVgQpM=" );
        PaytmOrder Order = new PaytmOrder( paramMap );


        Service.initialize( Order, null );

        Service.startPaymentTransaction( this, true, true,
                new PaytmPaymentTransactionCallback() 

                    @Override
                    public void someUIErrorOccurred(String inErrorMessage) 
                        // Some UI Error Occurred in Payment Gateway Activity.
                        // // This may be due to initialization of views in
                        // Payment Gateway Activity or may be due to //
                        // initialization of webview. // Error Message details
                        // the error occurred.
                        Log.d( "LOG123444", "someUIErrorOccurred : " + inErrorMessage );
                    

                    @Override
                    public void onTransactionResponse(Bundle inResponse) 
                        Log.d( "LOG123444", "Payment Transaction : " + inResponse );

                        if (inResponse.getString( "STATUS" ).contains( "TXN_SUCCESS" ))
                        

                            Toast.makeText(getApplicationContext(),"Transaction completed",Toast.LENGTH_LONG).show();
                        


                            Log.i( "LOG123444", inResponse.getString( "STATUS" )  );

//                        Toast.makeText( getApplicationContext(), "Payment Transaction response " + inResponse.toString(), Toast.LENGTH_LONG ).show();
                    

                    @Override
                    public void networkNotAvailable() 
                        // If network is not
                        // available, then this
                        // method gets called.
                    

                    @Override
                    public void clientAuthenticationFailed(String inErrorMessage) 
                        // This method gets called if client authentication
                        // failed. // Failure may be due to following reasons //
                        // 1. Server error or downtime. // 2. Server unable to
                        // generate checksum or checksum response is not in
                        // proper format. // 3. Server failed to authenticate
                        // that client. That is value of payt_STATUS is 2. //
                        // Error Message describes the reason for failure.
                        Log.i( "LOG123444", "clientAuthenticationFailed " + inErrorMessage );
                    

                    @Override
                    public void onErrorLoadingWebPage(int iniErrorCode,
                                                      String inErrorMessage, String inFailingUrl) 
                        Log.i( "LOG", "inErrorMessage " + inErrorMessage );
                        Log.i( "LOG", "inFailingUrl " + inFailingUrl );

                    

                    // had to be added: NOTE
                    @Override
                    public void onBackPressedCancelTransaction() 
                        // TODO Auto-generated method stub
                    

                    @Override
                    public void onTransactionCancel(String inErrorMessage, Bundle inResponse) 
                        Log.d( "LOG", "Payment Transaction Failed " + inErrorMessage );
                        Toast.makeText( getBaseContext(), "Payment Transaction Failed ", Toast.LENGTH_LONG ).show();
                    



                 );


【讨论】:

在哪里可以获得这个SDK2.0

以上是关于什么是 android 中 paytm 支付网关集成中的客户端证书?的主要内容,如果未能解决你的问题,请参考以下文章

如何在 android studio 中集成 Paytm 订阅支付(定期支付)?

(Flutter) Paytm 支付网关集成

如何在 Swift 中集成 Paytm 支付网关

Paytm 支付网关 java web 集成 - servlet 调用中的 jsp 示例有时由于提交中的 javascript 而无法正常工作

在 iOS 中集成 PayTm 支付

校验和不匹配错误 paytm 支付集成