PayPal

PayPal

This class represents a PayPal component. Instances of this class have methods for launching auth dialogs and other programmatic interactions with the PayPal component.

Constructor

new PayPal(options)

Parameters:
Name Type Description
options module:braintree-web/paypal~createOptions

see paypal.create

Source:

Methods

teardown(callbackopt) → {void}

Cleanly tear down anything set up by create

Parameters:
Name Type Attributes Description
callback errback <optional>

Called once teardown is complete. No data is returned if teardown completes successfully.

Source:

tokenize(callback) → {PayPal~tokenizeReturn}

Launch the PayPal login flow, returning a nonce payload

Parameters:
Name Type Description
callback errback

The second argument, data, is a tokenizePayload

Source:

Type Definitions

tokenizePayload :object

Properties:
Name Type Description
nonce string

The payment method nonce

details object

Additional PayPal account details

Properties
Name Type Attributes Description
email string

User's email address

firstName string

User's given name

lastName string

User's surname

countryCode string <nullable>

User's 2 character country code

phone string <nullable>

User's phone number (e.g. 555-867-5309)

shippingAddress object <nullable>

User's shipping address details, only available if shipping address is enabled

Properties
Name Type Description
recipientName string

Recipient of postage

line1 string

Street number and name

line2 string

Extended address

city string

City or locality

state string

State or region

postalCode string

Postal code

countryCode string

2 character country code (e.g. US)

Source:

tokenizeReturn :object

Properties:
Name Type Description
close function

A handle to close the PayPal checkout flow

Source: