1

我使用 PayPal Api 创建加密的 BuyNow 按钮。Api 返回按钮作为表单 HTML 代码。

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIIWwYJKoZIhvcNAQcEoIIITDCCCEgCAQExggE6MIIBNgIBADCBnjCBmDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExETAPBgNVBAcTCFNhbiBKb3NlMRUwEwYDVQQKEwxQYXlQYWwsIEluYy4xFjAUBgNVBAsUDXNhbmRib3hfY2VydHMxFDASBgNVBAMUC3NhbmRib3hfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tAgEAMA0GCSqGSIb3DQEBAQUABIGAWicsbzx8E3DiwoiAmsPDgFMXMXw2Vv4brJMg0h+4q3XDYZIlUmqe68cz/G98LcdjCRPzdj8ysAL9omG+CajwB+6Lh1gU8XnqolRbY0qrj515o2aUbR4mIZnRVMpFakSuX/xB/yvy++Tjr/1bCltQAKDGltKO3SC4lAWuZmOnRwMxCzAJBgUrDgMCGgUAMIIBpQYJKoZIhvcNAQcBMBQGCCqGSIb3DQMHBAjebWIsZ7c0uYCCAYD1BBI60xmtUikWJcD9qEVSQAwTQQQP4gHXND31K3fHootn0Tp84WE8JBDYnYB8PXegdvZCTEpGd4+LEmz/20B+LL/rhqlphri3RmatJpPBI5YxpKKxslVskqQgvW6C0YhTaTCxqaU3e5jMVm5kAfDE1BvJnjTDDzie5mAMp0XutUu0oz7Fj3dn+h/BaxfVYLrwDo3pEOD307j+6PX+RI3KAsbMopFJ2RsmsBQmSLDgkfuHUr9zUYrySKKWWHKAI0llg0hlhXmNyaia3ukKOtdj0mEtkjpnbtbRaUOCscm9TBo6fxtnWlvhhO0iaLRSQEgeoe94dJg+feZ0/7yTa1l5Estb6SqdXKtzsVBnYFAiUpmIYl6u7Tk0ubaR/wPH8zeF1oPOfhnSMI8PNr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2NlcnRzMRQwEgYDVQQDFAtzYW5kYm94X2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbYIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4GBAFc288DYGX+GX2+WP/dwdXwficf+rlG+0V9GBPJZYKZJQ069W/ZRkUuWFQ+Opd2yhPpneGezmw3aU222CGrdKhOrBJRRcpoO3FjHHmXWkqgbQqDWdG7S+/l8n1QfDPp+jpULOrcnGEUY41ImjZJTylbJQ1b5PBBjGiP0PpK48cdFMYIBpDCCAaACAQEwgZ4wgZgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMREwDwYDVQQHEwhTYW4gSm9zZTEVMBMGA1UEChMMUGF5UGFsLCBJbmMuMRYwFAYDVQQLFA1zYW5kYm94X2NlcnRzMRQwEgYDVQQDFAtzYW5kYm94X2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbQIBADAJBgUrDgMCGgUAoF0wGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcNMTIwODI5MDg1NTU1WjAjBgkqhkiG9w0BCQQxFgQUaBaJ4m2GzLbeacAcXs2DCghZIEgwDQYJKoZIhvcNAQEBBQAEgYB3vXv0Qlqda8ejg8FWLie/fvC9p8sk/TP+gBXnxi5sNPM0N9NTHp3Epu8qZR9FJVctrBkeF5BosIqhCfNe9HV12PFbv7N9jXSNJ8Dkr0TVtlAWhSmoeaDDHSm3uhYYJ4wcWImLSGufOdoE/cyGys8rxv7noJN6YjTfbgXbum9DZQ==-----END PKCS7-----
">
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_buynow_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

问题是我不想将 FORM 用于 paypal 按钮,而且我也找不到更改嵌入在表单 html 代码中的默认 paypal 按钮的方法。我想使用加密的贝宝按钮作为简单的文本链接。

我试图只复制所有表单变量并使用以下参数构建 url

https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_s-xclick&encrypted=-----BEGIN PKCS7-----MIIIWwYJKoZIhvcNAQcEoIIITDCCCEgCAQExggE6MIIBNgIBAD.....

不幸的是,它不起作用。也许有人有解决方案?

4

3 回答 3

2

您复制的链接错误。它会正常工作。

但是,托管按钮要好得多。并可通过ButtonManager API进行编辑。

于 2012-08-30T03:00:28.517 回答
2

在 BMCreateButton API 调用中,设置 BUTTONTYPE=HOSTED,而不是 BUTTONTYPE=ENCRYPTED。它在安全方面将是相同的,但它也会返回一个“EMAILLINK”,然后您可以使用它。

BUTTONTYPE=ENCRYPTED 很遗憾不会返回 EMAILLINK。

此外,如果您在链接中包含完整的加密文本,您可能会遇到 Apache 中的 LimitRequestLine 限制(默认值:8190),具体取决于您的 Apache 配置。
保持 URL 尽可能短会好得多。

于 2012-08-29T20:11:59.587 回答
0

我遇到了同样的问题,我urlencode得到了加密的值并且它起作用了。我希望这对遇到相同问题但不想使用 API 制作托管按钮的其他人有所帮助。

于 2013-05-19T14:46:46.743 回答