douzhang5984 2018-11-20 11:03
浏览 124
已采纳

PayPal java postback API始终是INVALID

The following question refers only to the "live" configuration, and not to the "sandbox" configuration:

I'm re-writing a php post back endpoint in java. The existing PHP was using this example, without any credentials, and with this url: https://ipnpb.paypal.com/cgi-bin/webscr

This above endpoint seems to return a "VERIFIED" response every time.

On the other hand, the Java Core SDK has this method for making a post back

IPNMessage::validate()

With url https://www.paypal.com/cgi-bin/webscr, and (maybe) with credentials (username, password, token and AppId).

The above API always returns false, due to an "INVALID" response.

My questions are:

  1. Is that the correct way to make a "post back" verification in Java?
  2. Do I need credentials to make this post back verification?
  • 写回答

1条回答 默认 最新

  • drmet46444 2018-11-21 11:53
    关注

    It appears that it's ok to use Java's endpoint (https://www.paypal.com/cgi-bin/webscr).

    No credentials were required.

    The reason I got the "INVALID" IPN, was incorrect encoding of the Post Back request. In order to fix the encoding in PayPal (which sends the IPN), you should go to you PayPal account, and select "Profile and Settings" > "My selling tools" > "PayPal button language encoding" at the bottom of the screen > "More Options" then select the Java Core SDK's encoding ("windows-1252").

    Alternatively, you can fix the postback's encoding, by adding a "charset" key/value on the configuration map (refer to the README, and add the following to get a UTF-8 encoding):

     customConfigurationMap.put("charset","UTF-8");
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统