Using the Web Client SDK
Web Client SDK
Initialize, Checkout, and Complete must be used for all payment actions. CanCheckout can be used to facilitate a dynamic presentation of the Paze button or user interface by checking consumer eligibility, however, it is not explicitly required.
Note: All JavaScript (JS) SDK APIs use JS Promises instead of events or callbacks. The Paze SDK will always respond back with a Promise.
Initialize
Initialize Paze with common state, starting the Merchant session. This is required before calling any other methods and is recommended to start with page load, since it will begin running fraud checks against the consumer’s device. Multiple Merchant sessions may run in parallel.
Initialize Request Parameters
| Field Name | Field Type | Field Usage | Description |
|---|---|---|---|
| client | Object(Client) | Required | Details the Client InformationSee Client Data Elements for more information. |
Initialize Promise – Resolve and Reject
| function | Description |
|---|---|
| resolve() | This is the JS Promise (fulfilled) call when the request is successfully processed by the Paze SDK. |
| Reject() | This is the JS Promise call when there is an error. The object passed in is an error object as defined in “Errors” section in this document. |
Initialize Business Errors
| Reason Code | Description |
|---|---|
| CLIENT_ID_MISSING | The identifier for the Client is missing. |
| INVALID_CLIENT_ID | The identifier for the Client is invalid. |
| INVALID_PROFILE_ID | The identifier for the profile is invalid. |
Standard errors are enumerated in their own section and are therefore excluded from API-specific tables.
Initialize Code Examples
initialize ({
required Client client;
})
// Response – empty
Updated about 1 month ago
