Skip to content

Commit

Permalink
v1.0.6 dev to main
Browse files Browse the repository at this point in the history
  • Loading branch information
bucharitesh authored Oct 18, 2022
2 parents a1fc9a0 + 8e375ff commit e3db003
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 37 deletions.
Binary file modified .DS_Store
Binary file not shown.
13 changes: 11 additions & 2 deletions dist/FlamSaasSDK.js

Large diffs are not rendered by default.

10 changes: 0 additions & 10 deletions dist/FlamSaasSDK.min.esm.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/FlamSaasSDK.min.esm.js.map

This file was deleted.

9 changes: 0 additions & 9 deletions dist/FlamSaasSDK.min.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/FlamSaasSDK.min.js.map

This file was deleted.

51 changes: 39 additions & 12 deletions examples/vanilla-js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,16 @@ async function getProducts() {
'x-api-key': key
}
},
`https://api.flamapp.com/saas/api/v1/products`
// `https://api.flamapp.com/saas/api/v1/products`
`https://dev.flamapp.com/saas/api/v2/products`
);

const x = data.data.filter(
w => w.productMetaData.photo.isActive && w.productMetaData.video.isActive
);

x.forEach((item, index) => {
const card = `<div class='col-sm-6 col-md-4 col-12'>
const card1 = `<div class='col-sm-6 col-md-4 col-12'>
<div class="card">
<img
style="height: 14rem; object-fit: cover"
Expand All @@ -95,37 +96,62 @@ async function getProducts() {
<div class="card-body">
<h5 class="card-title">${item.productHeader}</h5>
<p class="card-text">
${item.productSubHeader}
</p>
${item.productSubHeader} Varient 1
</p>
<button id="placeorder-${index}" onclick="buyCard('${item.productServiceId}')" class="placeorder btn btn-primary">
<button id="placeorder-${index}" onclick="buyCard('${item.productServiceId}', 'VARIANT-1')" class="placeorder btn btn-primary">
Buy
</button>
</div>
</div>
</div>
`;
document.getElementById('product_list').innerHTML += card;
document.getElementById('product_list').innerHTML += card1;

const card2 = `<div class='col-sm-6 col-md-4 col-12'>
<div class="card">
<img
style="height: 14rem; object-fit: cover"
src="${item.productImage}"
class="card-img-top"
alt="product ${index}"
/>
<div class="card-body">
<h5 class="card-title">${item.productHeader}</h5>
<p class="card-text">
${item.productSubHeader} Varient 2
</p>
<button id="placeorder-${index}" onclick="buyCard('${item.productServiceId}', 'VARIANT-2')" class="placeorder btn btn-primary">
Buy
</button>
</div>
</div>
</div>
`;
document.getElementById('product_list').innerHTML += card2;
});
} catch (error) {
if (error) console.log(error);
}
}

function buyCard(id) {
function buyCard(productId, variantId) {
const flam = new FlamSaasSDK.init({
environment: 'sandbox',
key: key
});

// const sample = {
// productId: id,
// productId: productId,
// varientId: varientId,
// refId: random,
// photo: 'https://images.pexels.com/photos/2274725/pexels-photo-2274725.jpeg',
// video: '',
// animation: 'CONFETTI',
// animation: 'airplane',
// photo: 'https://images.pexels.com/photos/2274725/pexels-photo-2274725.jpeg',
// video:'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4',
// allowVideoLater: true,
// theme: {
// color: '#234f55'
// },
Expand All @@ -138,9 +164,10 @@ function buyCard(id) {
// };

let orderDetails = {
productId: id,
refId: random
// 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: productId,
refId: random,
variantId: variantId
// allowVideoLater: true
// animation: 'airplane'
};

Expand Down
Loading

0 comments on commit e3db003

Please sign in to comment.