Skip to content
This repository was archived by the owner on Oct 16, 2019. It is now read-only.

Commit 2355717

Browse files
Merge pull request #139 from zalando-incubator/revert-137-136-xuid-cart-ops
fix(Cart): degrade version, docs update
2 parents c8ad739 + 532ace3 commit 2355717

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

README.md

+41
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,9 @@ AtlasSDK instance returned from AtlasSDK configure method.
301301
* [.createGuestCheckout(json)](#AtlasSDKClient+createGuestCheckout)[<code>CreateOrderRedirectResponse</code>](#CreateOrderRedirectResponse)
302302
* [.getCheckoutCustomer(token)](#AtlasSDKClient+getCheckoutCustomer)[<code>CheckoutCustomer</code>](#CheckoutCustomer)
303303
* [.getCheckoutAddresses(token)](#AtlasSDKClient+getCheckoutAddresses) ⇒ <code>CheckoutAddress</code>
304+
* [.createCheckoutCart(json, token)](#AtlasSDKClient+createCheckoutCart)[<code>CartResponse</code>](#CartResponse)
305+
* [.getCheckoutCart(cartId)](#AtlasSDKClient+getCheckoutCart)[<code>CartResponse</code>](#CartResponse)
306+
* [.putCheckoutcart(json, cartId)](#AtlasSDKClient+putCheckoutcart)[<code>CartResponse</code>](#CartResponse)
304307

305308
<a name="new_AtlasSDKClient_new"></a>
306309

@@ -468,6 +471,44 @@ Parameters customer <strong>token</strong> needed to fetch customer object.
468471
| --- | --- | --- |
469472
| token | <code>String</code> | customer OAuth2 token |
470473

474+
<a name="AtlasSDKClient+createCheckoutCart"></a>
475+
476+
### atlasSDKClient.createCheckoutCart(json, token) ⇒ [<code>CartResponse</code>](#CartResponse)
477+
Creates Zalando customer cart
478+
479+
**Kind**: instance method of [<code>AtlasSDKClient</code>](#AtlasSDKClient)
480+
**Returns**: [<code>CartResponse</code>](#CartResponse) - - customer cart
481+
482+
| Param | Type | Description |
483+
| --- | --- | --- |
484+
| json | [<code>CreateCartRequest</code>](#CreateCartRequest) | cart to create |
485+
| token | <code>String</code> | customer OAuth2 token |
486+
487+
<a name="AtlasSDKClient+getCheckoutCart"></a>
488+
489+
### atlasSDKClient.getCheckoutCart(cartId) ⇒ [<code>CartResponse</code>](#CartResponse)
490+
Returns a cart by id
491+
492+
**Kind**: instance method of [<code>AtlasSDKClient</code>](#AtlasSDKClient)
493+
**Returns**: [<code>CartResponse</code>](#CartResponse) - - cart
494+
495+
| Param | Type | Description |
496+
| --- | --- | --- |
497+
| cartId | <code>String</code> | cart ID to get |
498+
499+
<a name="AtlasSDKClient+putCheckoutcart"></a>
500+
501+
### atlasSDKClient.putCheckoutcart(json, cartId) ⇒ [<code>CartResponse</code>](#CartResponse)
502+
Updates existing cart by id
503+
504+
**Kind**: instance method of [<code>AtlasSDKClient</code>](#AtlasSDKClient)
505+
**Returns**: [<code>CartResponse</code>](#CartResponse) - - updated cart
506+
507+
| Param | Type | Description |
508+
| --- | --- | --- |
509+
| json | [<code>CreateCartRequest</code>](#CreateCartRequest) | cart object to update a cart with |
510+
| cartId | <code>String</code> | id of the cart to be updated |
511+
471512
<a name="PickupPoint"></a>
472513

473514
## PickupPoint

src/api/atlas_sdk_client.js

+23
Original file line numberDiff line numberDiff line change
@@ -528,8 +528,16 @@ class AtlasSDKClient {
528528
return fetchEndpoint(CheckoutEndpoint).then(res => res);
529529
}
530530

531+
/**
532+
* Creates Zalando customer cart
533+
*
534+
* @param {CreateCartRequest} json - cart to create
535+
* @param {String} token - customer OAuth2 token
536+
* @return {CartResponse} - customer cart
537+
*/
531538
createCheckoutCart(json, token) {
532539
const url = `${this.config.atlasCheckoutApi.url}/carts`;
540+
533541
const CheckoutEndpoint = {
534542
url: url,
535543
method: 'POST',
@@ -546,8 +554,15 @@ class AtlasSDKClient {
546554
return fetchEndpoint(CheckoutEndpoint).then(res => res);
547555
}
548556

557+
/**
558+
* Returns a cart by id
559+
*
560+
* @param {String} cartId - cart ID to get
561+
* @return {CartResponse} - cart
562+
*/
549563
getCheckoutCart(cartId) {
550564
const url = `${this.config.atlasCheckoutApi.url}/carts/${cartId}`;
565+
551566
const CheckoutEndpoint = {
552567
url: url,
553568
method: 'GET',
@@ -561,8 +576,16 @@ class AtlasSDKClient {
561576
return fetchEndpoint(CheckoutEndpoint).then(res => res);
562577
}
563578

579+
/**
580+
* Updates existing cart by id
581+
*
582+
* @param {CreateCartRequest} json - cart object to update a cart with
583+
* @param {String} cartId - id of the cart to be updated
584+
* @return {CartResponse} - updated cart
585+
*/
564586
putCheckoutcart(json, cartId) {
565587
const url = `${this.config.atlasCheckoutApi.url}/carts/${cartId}`;
588+
566589
const CheckoutEndpoint = {
567590
url: url,
568591
method: 'PUT',

0 commit comments

Comments
 (0)