简体   繁体   English

Paypal 智能按钮 V2 和 IPN - 如何将字段从智能按钮匹配到 IPN

[英]Paypal Smart Buttons V2 and IPN - How to match fields from Smart Buttons to IPN

Problem: I am using the integration from Papal Smart Buttons as Checkout V2 on the client site.问题:我在客户端站点上使用来自 Papal Smart Buttons 的集成作为 Checkout V2。 The Problem is, that Users on the Website are not waiting long enough after payment completed.问题是,网站上的用户在付款完成后等待的时间不够长。 They just click further and my website can not process the transaction right on my database.他们只是进一步点击,我的网站无法在我的数据库上处理交易。

  1. User click on Payment Smart Button用户点击支付智能按钮
  2. Paypal Framework opens贝宝框架打开
  3. User do the Payment用户进行付款
  4. User will go automatically back to the website用户将自动返回网站
  5. Payal need around 2 Second, bevor sending approval of transaction to may website.付款需要大约 2 秒,然后将交易批准发送到可能的网站。
  6. User not waiting and clicking further, so my script can not catching the approval and do not insert any Payment data to my Database.用户没有等待并进一步单击,因此我的脚本无法获得批准,也不会将任何付款数据插入到我的数据库中。
  7. Result: User complaining to my support, the got nothing after his Payment was done.结果:用户向我的支持投诉,付款完成后却一无所获。

I know there are some different Solution like IPN and Webhooks.我知道有一些不同的解决方案,如 IPN 和 Webhooks。 But the documentation and Sandbox from PayPal is so confusing.但是来自 PayPal 的文档和沙箱是如此令人困惑。 I really hate the documentation from PayPal.我真的很讨厌 PayPal 的文档。

Like described - I am using Smart Buttons and trying to send some values thru it and match them on the IPN.就像描述的那样 - 我正在使用智能按钮并尝试通过它发送一些值并在 IPN 上匹配它们。 As a result, I could catch the transaction on ipn, if the user do not wait on the client site.因此,如果用户不在客户端站点上等待,我可以在 ipn 上捕获事务。 But there is a Problem!但有个问题! What references or fields are matching together from the Smart buttons fields to the IPN fields????从智能按钮字段到 IPN 字段,哪些引用或字段匹配在一起???? ... I could not find anything in the documentation, which fields matches and which do not! ...我在文档中找不到任何内容,哪些字段匹配,哪些不匹配!

Smart Button Example智能按钮示例

I tried the fields like: reference_id, invoice_id or sku, but no one of are showing up on the IPN fields?我尝试了以下字段:reference_id、invoice_id 或 sku,但没有一个显示在 IPN 字段中?

      return actions.order.create({
                purchase_units: [{
                    reference_id: 35 ,
                    description: "test", 
                    custom_id: user_id, 
                    invoice_id: 35,
                    amount: {
                        currency_code: "EUR",
                        value: 100,
                        breakdown: {
                            item_total: {
                                currency_code: "EUR",
                                value: 100
                            }
                        } 
                    }, 
                    items: [{
                        name: "test1",
                        description: "test2",
                        sku: 35,
                        unit_amount: {
                            currency_code: "EUR",
                            value: 100
                        },
                        quantity: "1"
                    }],
                }],
            });

IPN Example: IPN 示例:

mc_gross=12.35 &
custom=96494 & 
item_name=test &
transaction_subject=test &

protection_eligibility=Eligible & 
address_status=confirmed & 
payer_id=VY7TCC2&GHJ & 
address_street=Kaiserstraße 14 & 
payment_date=01:05:28 Sep 25, 2020 PDT & 
payment_status=Completed & 
charset=windows-1252 & 
address_zip=79067 & 
first_name=Alex & 
mc_fee=0.63 & 
address_country_code=DE & 
address_name=Alex Boxman & 
notify_version=3.9 & 

payer_status=verified & 
business=paypal@test.de & 
address_country=Germany & 
address_city=Freiburg im Breisgau & 
quantity=1 & 
verify_sign=sqlgasdfs.uUsakasdfasdfbS3YeaE9V5 & 
payer_email=test@gmail.com & 
txn_id=96255345678 & 
payment_type=instant & 
last_name=Boxman & 
address_state= & 
receiver_email=paypal@test.de & 
payment_fee= & 
shipping_discount=0.00 & 
insurance_amount=0.00 & 
receiver_id=M7VC&FGHHJL & 
txn_type=express_checkout & 

discount=0.00 & 
mc_currency=EUR & 
item_number= & 
residence_country=DE & 
shipping_method=Default &  
 
payment_gross= & 
ipn_track_id=24asdfsfsfds

There is no reason to be using a legacy product like IPN with smart payment buttons and v2 APIs.没有理由使用带有智能支付按钮和 v2 API 的 IPN 等传统产品。

Instead, use a proper server integration.相反,使用适当的服务器集成。 You'll need two routes on your server, one for 'Set Up Transaction', and one for 'Capture Transaction', documented here: https://developer.paypal.com/docs/checkout/reference/server-integration/您的服务器上需要两条路线,一条用于“设置交易”,另一条用于“捕获交易”,记录在此处: https : //developer.paypal.com/docs/checkout/reference/server-integration/

Once you have those two routes, the UI to pair with them is https://developer.paypal.com/demo/checkout/#/pattern/server一旦你有了这两条路线,与之配对的 UI 是https://developer.paypal.com/demo/checkout/#/pattern/server

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM