PayPal支付REST API网络体验配置文件

4
我正在使用PayPal的rest API,并将其与支付集成。
我用以下代码成功创建了Web体验配置文件,但是我不能运行此代码2次,因为它会提示配置文件已存在。
这是否意味着我需要创建一个配置文件并将其用于所有客户和所有交易?
Web体验配置文件的有效期是多久?
还是我必须更改配置文件名称并为每个交易创建一个新的配置文件?
curl -v POST https://api.sandbox.paypal.com/v1/payment-experience/web-profiles \
  -H 'Content-Type:application/json' \
  -H 'Authorization: Bearer <Access-Token>' \
  -d '{
    "name": "YeowZa! T-Shirt Shop",
    "presentation": {
    "brand_name": "YeowZa! Paypal",
    "logo_image": "site",
    "locale_code": "US"
  },
    "input_fields": {
    "allow_note": true,
    "no_shipping": 0,
    "address_override": 1
  },
    "flow_config": {
    "landing_page_type": "billing",
    "bank_txn_pending_url": "site"
  }
}'
3个回答

5
除了之前的答案外 -
  • 您首先需要使用名称创建一个配置文件
  • 创建后,如果要使用该配置文件,请使用其ID(由Paypal分配)

根据您想要实现的方式,您的流可能是:

  1. 获取现有配置文件(如果有)

  2. 然后评估是否要添加或获取ID

    • 如果名称(或ID)存在,则获取/使用其ID,否则,
    • 如果要添加(创建),则响应将返回ID
希望对您有所帮助...

4

profile 中的 name 变量对于每个商户是唯一的。

通常情况下,您只需要创建一个 profile,然后多次使用这个单一的 profile即可。


4
  • There's no "lifecycle time" defined for a web experience profile, not until you update it or delete the profile
    DELETE /v1/payment-experience/web-profiles/<Profile-Id>

  • Pass the profile ID into the JSON payload for each payment request,

    "experience_profile_id": "XP-CP6S-W9DY-96H8-MVN2"
    

    reuse the profile unless you need different experience settings (allow shipping / note / logo img, etc).

点击此处了解更多关于付款体验概述的详细信息。


1
链接已经失效。就在我以为终于找到了这个“支付体验”是什么的时候。 :/ - musicin3d
请点击此链接查看有关PayPal直接支付体验集成的文档:https://developer.paypal.com/docs/integration/direct/payment-experience/ - golddc

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接