Methods
Modal()
We should not ever really use the Modal. Modals are like popups, but the key difference is that the customer can't actually verify it's app domain and thus secure/valid. Old PP sdk (./src/paypal) uses this to get info from webviews (e.g. facebook).
hasReturned(urlopt) → {Promise.<boolean>}
Checks whether the current page load is the result of returning from an app switch (or other full-page redirect) flow.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
url |
string |
<optional> |
window.location.href |
URL to check for resume parameters. |
injectQrCode(base64Data, container) → {HTMLImageElement}
Injects a QR code image into a specified container element.
Parameters:
| Name | Type | Description |
|---|---|---|
base64Data |
string |
The base64 encoded QR code image data. |
container |
string | HTMLElement |
A CSS selector string or HTML element to inject the QR code into. |
Throws:
-
Throws an error if the container is invalid or base64 data is invalid.
- Type
- BraintreeError
resume(urlOrQueryItemsopt) → {Promise}
Resumes a payment session after returning from an app switch (or other
full-page redirect) flow. Should only be called when hasReturned()
resolves with true.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
urlOrQueryItems |
string | object |
<optional> |
window.location.href |
URL, or an object of query parameters, containing the resume parameters. |
start(presentationOptionsopt) → {Promise}
Starts the PayPal payment flow.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
presentationOptions |
object |
<optional> |
Options for how to present PayPal. Properties
|
start(presentationOptionsopt) → {Promise}
Starts the Edit Saved Payment flow.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
presentationOptions |
object |
<optional> |
Options for how to present PayPal. Properties
|
Type Definitions
callback(erropt, nullable, dataopt, nullable) → {void}
The Node.js-style callback pattern used throughout the SDK.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
err |
BraintreeError |
<optional> <nullable> |
|
data |
any |
<optional> <nullable> |
The successful result of the asynchronous function call (if data exists). |