我在使用 BMCreateButton 时遇到问题的 Button Manager API 以获取上传的多项目购物车。 paypal里面documentation for the cart upload command ,关于“保护你的按钮”的段落暗示应该可以获得上面列出的所有功能的加密按钮,包括购物车上传表单。而在 this SO thread ,有人说他们已经用 PHP 解决了这个问题,但是经过查找,他们使用简单的 HTTP Post 并不明显,因为它与 PHP 类的内部工作有关。
到目前为止,我只能查看一项,并且在尝试使用多项语法(item_name_1
、item_name_2
...)时显示没有项目,总计 0.00
。
这是我的请求代码:
string requestContent =
"METHOD=BMCreateButton" +
"&VERSION=85.0" +
"&USER=<user>" +
"&PWD=<pwd>" +
"&SIGNATURE=<sig>" +
"&BUTTONCODE=ENCRYPTED" +
"&BUTTONTYPE=BUYNOW" +
"&BUTTONIMAGE=reg" +
"&BUTTONCOUNTRY=US" +
"&BUTTONSUBTYPE=PRODUCTS" +
//"&L_BUTTONVAR1=cmd%3D_cart" + //having this in here definitely causes an error message to display
"&L_BUTTONVAR1=button_subtype%3DPRODUCTS" +
"&L_BUTTONVAR2=business%3Dbiz%40biz.com" +
"&L_BUTTONVAR3=item_name_1%3DToaster" +
"&L_BUTTONVAR4=amount_1%3D45.00" +
"&L_BUTTONVAR5=quantity_1%3D1" +
"&L_BUTTONVAR6=upload%3D1";
它不起作用 - 我已经询问了 PayPal 技术支持,如果我从他们那里听到关于这个主题的任何回复,我会回复这里。
最佳答案
我遇到了同样的问题,但由于没有任何进展,我联系了 PayPal 支持。 There is the answer :
如果链接失效,有引用回复:
It's not only with ENCRYPTED. If you try CLEARTEXT, the same error is thrown.
Upload cart is a slightly different kind of button, that was never intended to be pre-built, and that's why this functionality doesn't exist in BMCreateButton. If you compare the Button Manager in the account and the API functionality - they have the same capabilities and, in both cases, the upload cart isn't there.
Looking at the documentation, you will also notice the BUTTONTYPE=CART refers to Add to cart.
It makes perfect sense to try to secure the upload cart code, but the best way will always be post-transaction consistency verification (with IPN).
所以综上所述,不可能对其进行加密,我们只能检测篡改,例如使用 IPN。
在对我的问题的回应中,PayPal 版主提出了一个问题以在文档中澄清这一点。
关于encryption - HTTP 发布 : getting encrypted Paypal multiple-item cart upload button,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42302423/