Skip to content

Commit

Permalink
feat: methods to fetch structure of cart and address module (#2)
Browse files Browse the repository at this point in the history
Tested and was working

---------

Co-authored-by: Sven Eberth <[email protected]>
  • Loading branch information
KadirBalku and sveneberth authored Apr 26, 2024
1 parent 92a4bfb commit efd52c9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/ViURShopClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export class ViURShopClient {
this.shop_url = `${this.host_url}/${this.shop_module}`;
this.shop_json_url = `${this.host_url}/json/${this.shop_module}`;
this.shop_api_url = `${this.shop_url}/api`;
this.getStructure_url = `${this.host_url}/vi/getStructure`
}


Expand Down Expand Up @@ -194,6 +195,13 @@ export class ViURShopClient {
.then(req => req.json())
}

cart_structure() {
return request(`${this.getStructure_url}/${this.shop_module}.cart`, {
method: 'GET',
})
.then(req => req.json())
}

// --- Address ------------------------------------------------------------

address_list({} = {}) {
Expand Down Expand Up @@ -251,6 +259,13 @@ export class ViURShopClient {
});
}

address_structure() {
return request(`${this.getStructure_url}/${this.shop_module}.address`, {
method: 'GET',
})
.then(req => req.json())
}

// --- Order --------------------------------------------------------------

payment_providers_list({} = {}) {
Expand Down

0 comments on commit efd52c9

Please sign in to comment.