我使用 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/wPH8zeF1oPOfhnSMI8PNrdN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lcnRzMRQwEgYDVQQDFAtzYW5kYm94X2FwaTEcMBoGCSqGSIb3DQEJARYNcmVAcGF5cGFsLmNvbYIBADAMBgNVHRMEBTADAQH/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.....
不幸的是,它不起作用。也许有人有解决方案?