-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
66c2def
commit 196a06e
Showing
27 changed files
with
181 additions
and
151 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
export default class AppSettings { | ||
constructor(client) { | ||
this.client = client; | ||
this.resourceUrl = '/apps'; | ||
} | ||
|
||
retrieve(appKey) { | ||
return this.client.get(`/apps/${appKey}/settings`); | ||
return this.client.get(`${this.resourceUrl}/${appKey}/settings`); | ||
} | ||
|
||
update(appKey, data) { | ||
return this.client.put(`/apps/${appKey}/settings`, data); | ||
return this.client.put(`${this.resourceUrl}/${appKey}/settings`, data); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
export default class CheckoutFields { | ||
constructor(client) { | ||
this.client = client; | ||
this.resourceUrl = '/settings/checkout/fields'; | ||
} | ||
|
||
list() { | ||
return this.client.get('/settings/checkout/fields'); | ||
return this.client.get(this.resourceUrl); | ||
} | ||
|
||
retrieve(name) { | ||
return this.client.get(`/settings/checkout/fields/${name}`); | ||
return this.client.get(`${this.resourceUrl}/${name}`); | ||
} | ||
|
||
update(name, data) { | ||
return this.client.put(`/settings/checkout/fields/${name}`, data); | ||
return this.client.put(`${this.resourceUrl}/${name}`, data); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,4 @@ export default class Countries { | |
list() { | ||
return this.client.get('/countries'); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
export default class CustomerGroups { | ||
constructor(client) { | ||
this.client = client; | ||
this.resourceUrl = '/customer_groups'; | ||
} | ||
|
||
list(filter) { | ||
return this.client.get('/customer_groups', filter); | ||
return this.client.get(this.resourceUrl, filter); | ||
} | ||
|
||
retrieve(id, filter) { | ||
return this.client.get(`/customer_groups/${id}`, filter); | ||
return this.client.get(`${this.resourceUrl}/${id}`, filter); | ||
} | ||
|
||
create(data) { | ||
return this.client.post(`/customer_groups`, data); | ||
return this.client.post(`${this.resourceUrl}`, data); | ||
} | ||
|
||
update(id, data) { | ||
return this.client.put(`/customer_groups/${id}`, data); | ||
return this.client.put(`${this.resourceUrl}/${id}`, data); | ||
} | ||
|
||
delete(id) { | ||
return this.client.delete(`/customer_groups/${id}`); | ||
return this.client.delete(`${this.resourceUrl}/${id}`); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,57 @@ | ||
export default class Customers { | ||
constructor(client) { | ||
this.client = client; | ||
this.resourceUrl = '/customers'; | ||
} | ||
|
||
list(filter) { | ||
return this.client.get('/customers', filter); | ||
return this.client.get(this.resourceUrl, filter); | ||
} | ||
|
||
retrieve(id, filter) { | ||
return this.client.get(`/customers/${id}`, filter); | ||
return this.client.get(`${this.resourceUrl}/${id}`, filter); | ||
} | ||
|
||
create(data) { | ||
return this.client.post(`/customers`, data); | ||
return this.client.post(this.resourceUrl, data); | ||
} | ||
|
||
update(id, data) { | ||
return this.client.put(`/customers/${id}`, data); | ||
return this.client.put(`${this.resourceUrl}/${id}`, data); | ||
} | ||
|
||
delete(id) { | ||
return this.client.delete(`/customers/${id}`); | ||
return this.client.delete(`${this.resourceUrl}/${id}`); | ||
} | ||
|
||
createAddress(customer_id, data) { | ||
return this.client.post(`/customers/${customer_id}`, data); | ||
createAddress(customerId, data) { | ||
return this.client.post(`${this.resourceUrl}/${customerId}`, data); | ||
} | ||
|
||
updateAddress(customer_id, address_id, data) { | ||
updateAddress(customerId, addressId, data) { | ||
return this.client.put( | ||
`/customers/${customer_id}/addresses/${address_id}`, | ||
`${this.resourceUrl}/${customerId}/addresses/${addressId}`, | ||
data | ||
); | ||
} | ||
|
||
deleteAddress(customer_id, address_id) { | ||
deleteAddress(customerId, addressId) { | ||
return this.client.delete( | ||
`/customers/${customer_id}/addresses/${address_id}` | ||
`${this.resourceUrl}/${customerId}/addresses/${addressId}` | ||
); | ||
} | ||
|
||
setDefaultBillingAddress(customer_id, address_id) { | ||
setDefaultBillingAddress(customerId, addressId) { | ||
return this.client.post( | ||
`/customers/${customer_id}/addresses/${address_id}/default_billing` | ||
`${this.resourceUrl}/${customerId}/addresses/${addressId}/default_billing` | ||
); | ||
} | ||
setDefaultShippingAddress(customer_id, address_id) { | ||
|
||
setDefaultShippingAddress(customerId, addressId) { | ||
return this.client.post( | ||
`/customers/${customer_id}/addresses/${address_id}/default_shipping` | ||
`${ | ||
this.resourceUrl | ||
}/${customerId}/addresses/${addressId}/default_shipping` | ||
); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
export default class Files { | ||
constructor(client) { | ||
this.client = client; | ||
this.resourceUrl = '/files'; | ||
} | ||
|
||
list(filter) { | ||
return this.client.get('/files', filter); | ||
return this.client.get(this.resourceUrl, filter); | ||
} | ||
|
||
upload(formData) { | ||
return this.client.postFormData('/files', formData); | ||
return this.client.postFormData(this.resourceUrl, formData); | ||
} | ||
|
||
delete(fileName) { | ||
return this.client.delete(`/files/${fileName}`); | ||
return this.client.delete(`${this.resourceUrl}/${fileName}`); | ||
} | ||
} |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,62 @@ | ||
export default class Orders { | ||
constructor(client) { | ||
this.client = client; | ||
this.resourceUrl = '/orders'; | ||
} | ||
|
||
list(filter) { | ||
return this.client.get('/orders', filter); | ||
return this.client.get(this.resourceUrl, filter); | ||
} | ||
|
||
retrieve(order_id, filter) { | ||
return this.client.get(`/orders/${order_id}`, filter); | ||
retrieve(orderId, filter) { | ||
return this.client.get(`${this.resourceUrl}/${orderId}`, filter); | ||
} | ||
|
||
create(data) { | ||
return this.client.post(`/orders`, data); | ||
return this.client.post(this.resourceUrl, data); | ||
} | ||
|
||
update(order_id, data) { | ||
return this.client.put(`/orders/${order_id}`, data); | ||
update(orderId, data) { | ||
return this.client.put(`${this.resourceUrl}/${orderId}`, data); | ||
} | ||
|
||
delete(order_id) { | ||
return this.client.delete(`/orders/${order_id}`); | ||
delete(orderId) { | ||
return this.client.delete(`${this.resourceUrl}/${orderId}`); | ||
} | ||
|
||
recalculate(order_id) { | ||
return this.client.put(`/orders/${order_id}/recalculate`); | ||
recalculate(orderId) { | ||
return this.client.put(`${this.resourceUrl}/${orderId}/recalculate`); | ||
} | ||
|
||
checkout(order_id) { | ||
return this.client.put(`/orders/${order_id}/checkout`); | ||
checkout(orderId) { | ||
return this.client.put(`${this.resourceUrl}/${orderId}/checkout`); | ||
} | ||
|
||
cancel(order_id) { | ||
return this.client.put(`/orders/${order_id}/cancel`); | ||
cancel(orderId) { | ||
return this.client.put(`${this.resourceUrl}/${orderId}/cancel`); | ||
} | ||
|
||
close(order_id) { | ||
return this.client.put(`/orders/${order_id}/close`); | ||
close(orderId) { | ||
return this.client.put(`${this.resourceUrl}/${orderId}/close`); | ||
} | ||
|
||
updateBillingAddress(order_id, address) { | ||
return this.client.put(`/orders/${order_id}/billing_address`, address); | ||
updateBillingAddress(orderId, address) { | ||
return this.client.put( | ||
`${this.resourceUrl}/${orderId}/billing_address`, | ||
address | ||
); | ||
} | ||
|
||
updateShippingAddress(order_id, address) { | ||
return this.client.put(`/orders/${order_id}/shipping_address`, address); | ||
updateShippingAddress(orderId, address) { | ||
return this.client.put( | ||
`${this.resourceUrl}/${orderId}/shipping_address`, | ||
address | ||
); | ||
} | ||
|
||
getPaymentFormSettings(order_id) { | ||
return this.client.get(`/orders/${order_id}/payment_form_settings`); | ||
getPaymentFormSettings(orderId) { | ||
return this.client.get( | ||
`${this.resourceUrl}/${orderId}/payment_form_settings` | ||
); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,26 @@ | ||
export default class OrderStatuses { | ||
constructor(client) { | ||
this.client = client; | ||
this.resourceUrl = '/order_statuses'; | ||
} | ||
|
||
list(filter) { | ||
return this.client.get('/order_statuses', filter); | ||
return this.client.get(this.resourceUrl, filter); | ||
} | ||
|
||
retrieve(id, filter) { | ||
return this.client.get(`/order_statuses/${id}`, filter); | ||
return this.client.get(`${this.resourceUrl}/${id}`, filter); | ||
} | ||
|
||
create(data) { | ||
return this.client.post(`/order_statuses`, data); | ||
return this.client.post(this.resourceUrl, data); | ||
} | ||
|
||
update(id, data) { | ||
return this.client.put(`/order_statuses/${id}`, data); | ||
return this.client.put(`${this.resourceUrl}/${id}`, data); | ||
} | ||
|
||
delete(id) { | ||
return this.client.delete(`/order_statuses/${id}`); | ||
return this.client.delete(`${this.resourceUrl}/${id}`); | ||
} | ||
} |
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
Oops, something went wrong.