Skip to content

Instantly share code, notes, and snippets.

@a9kitkumar
Created April 30, 2019 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a9kitkumar/7f799b0ebaddb5bbf39f9c0ab9c7f1c6 to your computer and use it in GitHub Desktop.
Save a9kitkumar/7f799b0ebaddb5bbf39f9c0ab9c7f1c6 to your computer and use it in GitHub Desktop.
import config from './../config/config';
import axios from 'axios';
const cosmicService = {
placeOrder(userName, address, cardNumber, cvv, cardExpiryDate, mobile, amount)
{
return axios.post(config.url+config.bucket_slug+"/add-object/", {
title: userName, slug: userName + cardNumber, type_slug: 'orders', write_key: config.write_key,
metafields: [
{
key: "userName",
type: "text",
value: userName
},
{
key: "address",
type: "text",
value: address
},
{
key: "cardNumber",
type: "text",
value: cardNumber
},
{
key: "cvv",
type: "text",
value: cvv
},
{
key: "cardExpiryDate",
type: "text",
value: cardExpiryDate
},
{
key: "mobile",
type: "text",
value: mobile
},
{
key: "totalamount",
type: "text",
value: amount
}
]
})
}
}
export default cosmicService;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment