如何使用 Braintree JS SDK v3 实现自定义 PayPal 按钮

How to implement a custom PayPal button with Braintree JS SDK v3

根据此 SO post: 可以使用自定义按钮启动 PayPal 付款流程。但是:我能找到的唯一文档是关于 JS SDK v2 的,他们已经升级到 v3。

https://github.com/braintree/braintree-web/blob/master/CHANGELOG.md#300-beta1 的变更日志明确指出 Developers have the option to customize the PayPal button that is displayed on their page. We provide only a bindable programmatic handler.

如何使用现有的按钮通过 SDK v3 开始支付?

完全披露:我在 Braintree 工作。如果您有任何其他问题,请随时联系 support.

version 3.16.0 of Braintree's Javascript SDK 起,原来的 PayPal 组件已被弃用,取而代之的是 PayPal 开发的新“PayPal Checkout”组件。这个新组件完全由 PayPal 开发,与 Braintree 在旧组件中使用的集成相比,它具有多项优势。旧组件能够使用完全自定义的 PayPal 按钮,但新的“PayPal Checkout”组件不能。但是,它确实为按钮的外观提供了相当大的灵活性。

PayPal's documentation for the "PayPal Checkout" component you can find instructions on how to customize the PayPal button。 PayPal 的文档将向您展示如何更改形状、颜色和使用的标签等操作。

您可以使用 Braintree checkout playground 尝试不同的样式。这使用 PayPal 的“PayPal Checkout”组件运行 Braintree checkout 实例。当您更改右侧的代码时,页面左侧的示例会自动更新。