【问题标题】:successful paypal api call is not showing up in the sandbox成功的 paypal api 调用未显示在沙箱中
【发布时间】:2012-07-30 10:20:36
【问题描述】:

您好,我有点困惑。我正在使用沙盒凭据进行贝宝 api 调用。返回 ACK 是:成功。当我转到付款人或企业沙盒帐户时,没有处理任何交易。我进行了调试,看起来我正在填充所有字段,而且我认为如果某些字段丢失,则会引发错误。这是我正在使用的代码。

.....

APIProfile apiProfile = ProfileFactory.createSignatureAPIProfile();
                    apiProfile.setAPIUsername(paypalAccount.getApiLogin());
                    apiProfile.setAPIPassword(paypalAccount.getApiPassword());
                    apiProfile.setSignature(paypalAccount.getApiSignature());
                    apiProfile.setEnvironment(paypalAccount.getApiEnvironment());

                    // caller
                    NVPCallerServices callerServices = new NVPCallerServices();
                    callerServices.setAPIProfile(apiProfile);

                    // encoder
                    NVPEncoder encoder = new NVPEncoder();
                    encoder.add(METHOD, METHOD_VALUE);
                    encoder.add(RETURNURL, paypalAccount.getReturnUrl());
                    encoder.add(CANCELURL, paypalAccount.getCancelUrl());
                    encoder.add(CURRENCYCODE, CURRENCYCODE_VALUE);
                    encoder.add(PAYMENTACTION, PAYMENTACTION_VALUE);
                    encoder.add(AMT, payment.getPaymentOrder().getPrice().toString());
                    encoder.add(L_NAME0, L_NAME0_VALUE);
                    encoder.add(L_AMT0, payment.getPaymentOrder().getPrice().toString());

                    // call
                    String NVPRequest = encoder.encode();
                    String NVPResponse = callerServices.call(NVPRequest);
                    NVPDecoder decoder = new NVPDecoder();
                    decoder.decode(NVPResponse);

                    String ack = decoder.get(ACK);
                    payment.setPaymentTransaction(decoder.get(TOKEN));

......

任何帮助都会很棒!

【问题讨论】:

    标签: api paypal payment sandbox


    【解决方案1】:

    如果您使用快速结帐,则需要拨打 3 次电话:

    • SetExpressCheckout(使用令牌响应)
    • GetExpressCheckout
    • DoExpressCheckout

    “DoExpressCheckout”通过后,您应该能够看到交易记录在您的沙盒买家和商家帐户中。

    看看:https://www.x.com/devzone/excerpts/chapter-2-express-checkout

    【讨论】:

      猜你喜欢
      • 2018-07-31
      • 1970-01-01
      • 2016-12-29
      • 2015-05-23
      • 2017-01-17
      • 2016-05-27
      • 2015-11-16
      • 2013-06-17
      • 1970-01-01
      相关资源
      最近更新 更多