我正在用纯 html 创建一个 eshop,并想创建一个 html 表单,用户可以在其中添加产品信息和图片。我打算使用 paypal 进行支付处理,我想知道是否可以在不访问 paypal 网站的情况下为每个产品创建 paypal 按钮。 paypal 是否允许通过 javascript api 甚至使用 iframe 创建按钮?
最佳答案
立即购买按钮可以通过javascript生成,这里是the documentation
PAYPAL.apps.ButtonFactory.create(business, data, type, parentNode)
Creates and returns an HTML element that contains the button code.
business - A string containing either the business ID or the business email data - A JavaScript object containing the button variables type - The button type, e.g. "buynow", "cart", "qr" parentNode - An HTML element to add the newly created button to (Optional)
关于javascript - 如何从 html 表单创建 paypal 按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21121565/