-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ecfa07a
commit e2071f7
Showing
2 changed files
with
31 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,35 +75,40 @@ Loads an instance of the SDK in iframe on the client website. It takes all the n | |
|
||
All parameters can be considered optional unless otherwise stated. | ||
|
||
| Option | Type | Description | | ||
| :---------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| `productId` | string (required) | Product ID for the product to be ordered from SDK | | ||
| `refId` | string (required) | Reference ID set up by the client for their convenience and tracking | | ||
| `photo` | string (optional) | This can be passed if client wants the user to upload images on their own website instead of the FlamSDK | | ||
| `video` | string (optional) | This can be passed if client wants the user to upload video on their own website instead of the FlamSDK | | ||
| `prefill` | object (optional) | This is an object which contains the following options: `name: string` `email: string` `phone: string` for the user to contact the client in case of any errors | | ||
| `animation` | string (optional) | This is the animation to be added on the experience which would be received from the `/products` API. In case not provided default one is used for the particular product | | ||
| `theme` | object (optional) | This is an object which contains `color : string` in the form of **HEX**, which can be passed by the client to customise the primary colour of the SDK UI according to their needs. | | ||
| `logo` | string (optional) | This is the logo of the client's organisation to be shown on the SDK. In case not provided a default logo would be used | | ||
| `callback` | function (required) | This is a custom function which the client can pass to handle success and error states that occur in SDK. | | ||
| Option | Type | Description | | ||
| :---------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| `productId` | string (required) | Product ID for the product to be ordered from SDK | | ||
| `variantId` | string (required) | Variant ID for the product to be ordered from SDK | | ||
| `refId` | string (required) | Reference ID set up by the client for their convenience and tracking | | ||
| `allowVideoLater` | boolean (optional) | Allow users to upload the video later (default: false) | | ||
| `photo` | string (optional) | This can be passed if client wants the user to upload images on their own website instead of the FlamSDK | | ||
| `video` | string (optional) | This can be passed if client wants the user to upload video on their own website instead of the FlamSDK | | ||
| `prefill` | object (optional) | This is an object which contains the following options: `name: string` `email: string` `phone: string` for the user to contact the client in case of any errors | | ||
| `animation` | string (optional) | This is the animation to be added on the experience which would be received from the `/products` API. In case not provided default one is used for the particular product | | ||
| `theme` | object (optional) | This is an object which contains `color : string` in the form of **HEX**, which can be passed by the client to customise the primary colour of the SDK UI according to their needs. | | ||
| `logo` | string (optional) | This is the logo of the client's organisation to be shown on the SDK. In case not provided a default logo would be used | | ||
| `callback` | function (required) | This is a custom function which the client can pass to handle success and error states that occur in SDK. | | ||
|
||
```js | ||
sdk.placeOrder( | ||
{ | ||
productId: '96f0d15e-63cd-485b-8f37-bb474d287129', | ||
refId: '04607c6a-9964-47de-a0c2-853b3f89bd88', | ||
photo: 'https://images.pexels.com/photos/2274725/pexels-photo-2274725.jpeg', | ||
video:'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4', | ||
animation: 'CONFETTI', | ||
theme: { | ||
color : '#234f55', | ||
}, | ||
prefill: { | ||
name: 'John Doe Prints', | ||
email: '[email protected]', | ||
phone: '+91 98765 43210' | ||
}, | ||
logo: 'https://upload.wikimedia.org/wikipedia/commons/thumb/5/51/Facebook_f_logo_%282019%29.svg/2048px-Facebook_f_logo_%282019%29.svg.png | ||
productId: '96f0d15e-63cd-485b-8f37-bb474d287129', | ||
variantId: 'VARIANT-1', | ||
refId: '04607c6a-9964-47de-a0c2-853b3f89bd88', | ||
allowVideoLater: true, | ||
photo: 'https://images.pexels.com/photos/2274725/pexels-photo-2274725.jpeg', | ||
video: | ||
'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4', | ||
animation: 'CONFETTI', | ||
theme: { | ||
color: '#234f55' | ||
}, | ||
prefill: { | ||
name: 'John Doe Prints', | ||
email: '[email protected]', | ||
phone: '+91 98765 43210' | ||
}, | ||
logo: 'https://upload.wikimedia.org/wikipedia/commons/thumb/5/51/Facebook_f_logo_%282019%29.svg/2048px-Facebook_f_logo_%282019%29.svg.png' | ||
}, | ||
function (err, result) { | ||
// Order pacement result or error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters