Created
April 30, 2019 17:01
-
-
Save a9kitkumar/7f799b0ebaddb5bbf39f9c0ab9c7f1c6 to your computer and use it in GitHub Desktop.
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
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