A component to integrate with the Payment Request API.
Note: This component is currently in beta and the API may include breaking changes when upgrading. Please review the Changelog for upgrade steps whenever you upgrade the version of braintree-web.
- Source:
Members
(static) VERSION :string
The current version of the SDK, i.e. 3.36.0
.
- Source:
Methods
(static) create(options, callbackopt) → {Promise|void}
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
Creation options: Properties
|
||||||||||||||||||||||||||||
callback |
callback |
<optional> |
The second argument, |
- Source:
Examples
if (window.PaymentRequest) {
braintree.paymentRequest.create({
client: clientInstance
}, cb);
} else {
// fall back to Hosted Fields if browser does not support Payment Request API
braintree.hostedFields.create(hostedFieldsOptions, cb);
}
braintree.paymentRequest.create({
client: clientInstance,
enabledPaymentMethods: {
googlePay: true,
basicCard: false
}
}, cb);