【问题标题】:Paypal Recurring Payment API - workflowPaypal 定期付款 API - 工作流程
【发布时间】:2023-04-02 09:42:01
【问题描述】:

我正在尝试弄清楚如何使用 paypal API 来实现定期付款。我正在关注本指南:

https://devtools-paypal.com/guide/recurring_payment_ec?interactive=OFF&env=sandbox

但我不明白。这怎么能行。在第 1 步中,付款详细信息已构建,但未填充诸如间隔或付款价值之类的值。然后我得到一个令牌,用户必须在第 2 步中确认付款。

在他确认付款后。我在步骤 3 中设置了间隔的价值和付款?这对我来说真的没有意义。是什么阻止我在第 3 步中收取我想要的任何金额?

【问题讨论】:

    标签: java api paypal


    【解决方案1】:

    迟到总比没有好?

    我第一次设置定期结算时遇到的主要问题是,定期结算是一项付费的“附加”服务,商家帐户持有人必须在他们的 PayPal 上初始化它 目前,PayPal 抛出此错误的方式是使用其通用的RESULT=1 响应;然而,信息是关键。 RESPMSG=User authentication failed: Recurring Billing" 几乎可以肯定意味着商家的帐户尚未设置定期结算。

    在帐户上设置定期结算后,以下步骤应该会起作用。

    1. 使用以下命令调用 PayPal Pro(PayFlowPro 等)iFrame:
        'USER'                  => [[[Payflow User]]],
        'VENDOR'                => [[[Payflow Vendor]]],
        'PARTNER'               => [[[Payflow Partner]]],
        'PWD'                   => [[[Payflow Password]]],
        'TRXTYPE'               => 'A', // to authorize a billing profile
        'TENDER'                => 'C', // even if the user uses PayPal to pay
        'BILLINGTYPE'           => 'MerchantInitiatedBilling',
        'CURRENCY'              => 'USD',
        'RETURNURL'             => [[[Return URL]]],
        'CANCELURL'             => [[[Cancel URL]]],
        'ERRORURL'              => [[[Cancel URL]]],
        'BA_DESC'               => 'A Fitting Description of the Profile',
        'CREATESECURETOKEN'     => 'Y',
        'SECURETOKENID'         => [[[Your generated ID]]],
        'AMT'                   => '5.49' // a string, can not be zero
    

    注意:BILLINGTYPEBA_DESC 帮助您创建 PayPal 账单协议。 尽管 PayPal 具有零身份验证功能,但您不得使用 0.00 作为您的身份验证金额。

    当订阅者成功填写 PayPal 付款表格后,信息将发送到您的RETURNURL。解析并使用此 POST 数据并执行以下 PayPal API 调用之一来创建定期计费配置文件。

    如果订阅者使用 PayPal 设置他们的帐户,则 POST 将包含名称/值 BAID=########################。您应该使用 BAID(“账单协议 ID”)作为参考来创建 PayPal 账单协议

        'USER'                  => [[[Payflow User]]],
        'VENDOR'                => [[[Payflow Vendor]]],
        'PARTNER'               => [[[Payflow Partner]]],
        'PWD'                   => [[[Payflow Password]]],
        'TRXTYPE'               => 'R', // recurring billing profile
        'ACTION'                => 'A', // add/create recurring billing profile
        'TENDER'                => 'P', // PayPal
        'PROFILENAME'           => 'A name for your subscription',
        'BAID'                  => '##################', // The BAID POSTed from PayPal
        'START'                 => '190721', // a starting date in mdY format
        'PAYPERIOD'             => 'MONT', // or YEAR or etc, see manual
        'TERM'                  => '0', // # of payments (0 is until subscriber cancels)
        'AMT'                   => '5.49' // same amount as your auth in previous step
    

    如果订阅者使用信用卡来设置他们的帐户,那么 POST 将不会包含名称/值 BAID,并且您应该将定期计费配置文件创建为标准的定期信用卡配置文件:

        'USER'                  => [[[Payflow User]]],
        'VENDOR'                => [[[Payflow Vendor]]],
        'PARTNER'               => [[[Payflow Partner]]],
        'PWD'                   => [[[Payflow Password]]],
        'TRXTYPE'               => 'R', // recurring billing profile
        'ACTION'                => 'A', // add/create recurring billing profile
        'TENDER'                => 'C', // credit card
        'PROFILENAME'           => 'A name for your subscription',
        'ORIGID'                => 'PN##########', // PNREF value POSTed from PayPal
        'START'                 => '190721', // a starting date in mdY format
        'PAYPERIOD'             => 'MONT', // or YEAR or etc, see manual
        'TERM'                  => '0', // # of payments (0 is until subscriber cancels)
        'AMT'                   => '5.49' // same amount as your auth in previous step
    

    请注意,PayPal 发送给我的最后一个相关文档是 2013 年的,并且已经过时了。它包含一个繁琐的四步过程,但根本行不通。希望在您阅读本文时已更新。

    希望这对您有所帮助。如果您有任何问题,请告诉我。

    【讨论】:

      猜你喜欢
      • 2012-04-05
      • 2012-03-13
      • 2011-09-16
      • 2012-06-21
      • 2016-07-16
      • 2013-09-14
      • 2013-05-29
      • 2020-01-03
      • 2015-10-20
      相关资源
      最近更新 更多