moltin / android-sdk Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Note: I don't believe this is an actual issue with the SDK, but rather with the backend response. And this also might be related to creating Customer
objects.
In the docs for the Cart object, it shows that the contents
field should be an array of products added to the cart. When I use moltin.cart.contents(callback);
the response correctly returns an array when the contents
field is empty. However, when there are any number of items in the cart (tested with 1, 2, and 3 items), the response contains an object of objects with unique keys for each object.
Here is an example:
{
"3a3460afc114c682a3a1e9f66c20e4c4": {
"id": "1378365502061019855",
"quantity": 2,
"limit": 10,
"offset": 0,
"order": null,
"created_at": "2016-11-07 15:53:13",
"updated_at": "2016-11-07 22:07:23",
"sku": "001",
"title": "Boots",
"slug": "booties",
"sale_price": 39.99,
...
},
"b104bcc99d675bb55bed9b4e03baef57": {
"id": "1378783908706910272",
"quantity": 1,
"limit": 10,
"offset": 0,
"order": null,
"created_at": "2016-11-08 05:44:31",
"updated_at": "2016-11-08 05:44:31",
"sku": "003",
"title": "White jacket",
"slug": "white-jacket",
"sale_price": 5.99,
...
}
I'm trying to hold off on collecting customer information until they are ready to checkout.
Any help is appreciated - thanks!
"modifiers":{
"1390253840774726537":{ ... },
"1390255856766944148":{
"id":"1390255856766944148",
"data":{
"type":{
"value":"Variant",
"data":{
"key":"variant",
"value":"Variant"
}
},
"title":"Color",
"product":"1378365502061019855"
},
"var_title":"Black",
"var_price":"+$0.00",
"var_id":"1390255856766944148"
}
}
When getting the variations associated with a specific product (the above json is apart of a specific product variation), the modifiers object (which I believe should actually be an array) contains the correct modifiers as indicated by their id's as the keys. In those objects, there is some data about the variant shown by var_{field}
. Shown above is var_title
, var_price
, and var_id
. The var_id
is returning incorrectly and is actually just the same id as the modifier it is associated with. In my case, the var_id
should actually be 1390263527645643676
.
How to authenticate a customer using username and password?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.