【问题标题】:MPGS IntegrationMPGS 集成
【发布时间】:2017-03-19 20:00:48
【问题描述】:

我正在尝试使用新的 migs getaway (MPGS) 我按照下一个 url 中的代码进行操作

https://ap-gateway.mastercard.com/api/documentation/integrationGuidelines/hostedCheckout/integrationModelHostedCheckout.html

确定我已替换所有必填字段

<html>
<head>
    <script src="https://ap-gateway.mastercard.com/checkout/version/36/checkout.js"
            data-error="errorCallback"
            data-cancel="cancelCallback">
    </script>

    <script type="text/javascript">
        function errorCallback(error) {
              console.log(JSON.stringify(error));
        }
        function cancelCallback() {
              console.log('Payment cancelled');
        }

        Checkout.configure({
            merchant: 'xxxxxx',
            order: {
                amount: function() {
                    //Dynamic calculation of amount
                    return 80 + 20;
                },
                currency: 'USD',
                description: 'Ordered goods',
               id: 'xxxxxx'
            },
            interaction: {
                merchant: {
                    name: 'xxxxxx',
                    address: {
                        line1: '200 Sample St',
                        line2: '1234 Example Town'            
                    }    
                }
            }
        });
    </script>
</head>
<body>
    ...
    <input type="button" value="Pay with Lightbox" onclick="Checkout.showLightbox();" />
    <input type="button" value="Pay with Payment Page" onclick="Checkout.showPaymentPage();" />
    ...
</body>

但我总是把这个错误作为 json 对象得到

{
  "cause":"INVALID_REQUEST",
  "explanation":"Invalid request",
  "supportCode":"6RVIIBKFVR6CG",
  "result":"ERROR"
}

【问题讨论】:

    标签: integration bank


    【解决方案1】:

    1.请使用以下 curl 请求或 API 请求使用服务器到服务器请求创建结帐会话请求

    网址https://cibpaynow.gateway.mastercard.com/api/rest/version/60/merchant/{merchantId}/session HTTP 方法 POST 身份验证 此操作需要通过以下方法之一进行身份验证: 证书认证。 w3.org 中描述的基本 HTTP 身份验证。提供“商家”。在用户 ID 部分和您的 API 密码在密码部分。

    {
        "apiOperation": "CREATE_CHECKOUT_SESSION",
        "interaction": {
            "operation": "PURCHASE"
        },
        "order": {
            "id": "anyorder",
            "currency": "EGP",
            "description": "Order Goods",
            "amount": "10.00"
        }
    }  
    

    2。从响应中获取会话 ID 并将其放在我创建的附加示例 HTML 页面中:

    <html>
        <head>
            <script src="https://cibpaynow.gateway.mastercard.com/checkout/version/57/checkout.js" data-error="errorCallback" data-cancel="cancelCallback"></script>
            <script type="text/javascript">
                function errorCallback(error) {
                      console.log(JSON.stringify(error));
                }
                function cancelCallback() {
                      console.log('Payment cancelled');
                }
                Checkout.configure({
                  session: { 
                    id: '' //session ID generated from the request
                    },
                  interaction: {
                        merchant: {
                            name: '',  //your MID
                            address: {
                                line1: '200 Sample St',
                                line2: '1234 Example Town'            
                            }    
                        }
                   }
                });
            </script>
        </head>
        <body>
           ...
          <input type="button" value="Pay with Lightbox" onclick="Checkout.showLightbox();" />
          <input type="button" value="Pay with Payment Page" onclick="Checkout.showPaymentPage();" />
           ...
        </body>
    </html>

    3.保存页面并在浏览器中打开页面,然后点击“使用灯箱付款”按钮

    【讨论】:

      【解决方案2】:

      重新检查您获取的 SESSIONID 和 MercerId ,来自网关的这些错误意味着您没有为网关提供正确的凭据来执行付款。

      【讨论】:

        【解决方案3】:

        您需要有效的商家 ID 才能请求托管结帐弹出窗口或结帐页面。

        【讨论】:

          【解决方案4】:

          确保以下详细信息正确无误,并且在创建结帐会话和结帐配置时使用相同的详细信息。

          • 商户号
          • 货币
          • 订单 ID(应该是唯一的)

          会话创建 CURl

          curl https://baiduri-bpgs.mtf.gateway.mastercard.com/api/nvp/version/46 -d "apiOperation=CREATE_CHECKOUT_SESSION" -d "apiPassword=ac35b2803b5ddb1b71442d0b3835e4fd" -d "interaction.returnUrl=http://localhost:53540/payment.html" -d "apiUsername=merchant.950028381" -d "merchant=950028381" -d "order.id=1234567892" -d "order.amount=100.00" -d "order.currency=BND"
          

          结帐配置

          Checkout.configure({
                      merchant: '950028381',
                      order: {
                          amount: function () {
                              return 100;
                          },
                          currency: 'USD',
                          description: 'Ordered goods',
                          id: '1000'
                      },
                      interaction: {
                          merchant: {
                              name: 'Hsenid Mobile',
                              address: {
                                  line1: '200 Sample St',
                                  line2: '1234 Example Town'
                              }
                          }
                      },
                      session: {
                          id: "SESSION0002838485787H0046572I02"
                      }
                  });
          

          注意:在结帐配置和会话 ID 生成时应使用相同的商户 ID、货币、订单 ID

          【讨论】:

          • machan,我正在尝试为一个小型网站实现combank mpg。您是否有任何文档/案例研究让我了解有关集成过程的更多信息?我之前没有支付网关方面的经验。
          • @Desper Combank 提供以下文档作为他们的开发者指南。 test-gateway.mastercard.com/api/documentation/…
          猜你喜欢
          • 2019-10-03
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2019-06-16
          • 1970-01-01
          • 2021-07-09
          • 1970-01-01
          相关资源
          最近更新 更多