Skip to content

Commit

Permalink
Update default logo
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuvrajhere committed Sep 2, 2022
1 parent d61ade0 commit 828c5d5
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 26 deletions.
25 changes: 17 additions & 8 deletions dist/FlamSaasSDK.js

Large diffs are not rendered by default.

21 changes: 11 additions & 10 deletions examples/vanilla-js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,19 @@ function buyCard(id) {
key: key
});

// photo: 'https://images.pexels.com/photos/2274725/pexels-photo-2274725.jpeg',
// video: '',
// animation: 'CONFETTI',
// 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'

let orderDetails = {
productId: id,
refId: random,
photo: 'https://images.pexels.com/photos/2274725/pexels-photo-2274725.jpeg',
video: '',
animation: 'CONFETTI',
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'
refId: random
};

flam.placeOrder(orderDetails, (err, res) => {
Expand Down
9 changes: 4 additions & 5 deletions src/placeOrder.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ import assert from './helper/assert';

export default function placeOrder(order_details, callback) {
this.order_details = order_details;

try {
assert.check(
this.clientData,
{ type: 'object', message: 'clientData parameter is not valid object' },
{ type: 'object', message: 'init data is invalid' },
{
key: { type: 'string', message: 'key is required' },
key: { type: 'string', message: 'key is required in init data' },
environment: {
optional: true,
type: 'string',
message: 'environment is required'
message: 'environment must be a string in init data'
}
}
);
Expand All @@ -22,7 +21,7 @@ export default function placeOrder(order_details, callback) {
order_details,
{
type: 'object',
message: 'order_details parameter is not valid object'
message: 'options parameter is invalid'
},
{
productId: { type: 'string', message: 'productId is required!' }
Expand Down
14 changes: 12 additions & 2 deletions src/receiveMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,18 @@ export default function receiveMessage(event) {
{
type: 'INITIAL_DATA_ERR',
payload: {
email: this.order_details.prefill.name || '',
phone: this.order_details.prefill.phone || ''
email:
this.order_details &&
this.order_details.prefill &&
this.order_details.prefill.email
? this.order_details.prefill.email
: '',
phone:
this.order_details &&
this.order_details.prefill &&
this.order_details.prefill.phone
? this.order_details.prefill.phone
: ''
}
},
'*'
Expand Down
2 changes: 1 addition & 1 deletion ui/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ const Home = ({ theme }: { theme: string }) => {
'SmartPhotos',
logoUrl:
dataFromClient?.order_details?.logo ||
'https://upload.wikimedia.org/wikipedia/commons/thumb/5/51/Facebook_f_logo_%282019%29.svg/2048px-Facebook_f_logo_%282019%29.svg.png'
'https://flam-videoshop-assets.s3.ap-south-1.amazonaws.com/flam/web/flam_logo.png'
}}
existingPhoto={dataFromClient?.order_details?.photo || ''}
title={productData?.productHeader || ''}
Expand Down

0 comments on commit 828c5d5

Please sign in to comment.