Skip to content

Commit

Permalink
v0.0.9 introduced payment gateway resource, network resource
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodes committed Oct 7, 2021
1 parent 172ed54 commit 0519c97
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 10 deletions.
2 changes: 1 addition & 1 deletion dist/@fleetbase/storefront.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/@fleetbase/storefront.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cjs/storefront.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cjs/storefront.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/esm/storefront.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/esm/storefront.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@fleetbase/storefront",
"version": "1.0.8",
"version": "1.0.9",
"description": "Fleetbase Storefront JS & Node SDK",
"main": "dist/cjs/storefront.js",
"module": "dist/esm/storefront.js",
Expand Down
6 changes: 5 additions & 1 deletion src/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,24 @@ import Product from './resources/product';
import Category from './resources/category';
import Customer from './resources/customer';
import Cart from './resources/cart';
import Network from './resources/network';
import Store from './resources/store';
import StoreLocation from './resources/store-location';
import StoreHour from './resources/store-hour';
import DeliveryServiceQuote from './resources/delivery-service-quote';
import Checkout from './resources/checkout';
import PaymentGateway from './resources/payment-gateway';

export {
Product,
Category,
Customer,
Cart,
Network,
Store,
StoreLocation,
StoreHour,
DeliveryServiceQuote,
Checkout
Checkout,
PaymentGateway
};
27 changes: 27 additions & 0 deletions src/resources/network.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import Resource from '../resource';
import StoreLocation from './store-location';
import PaymentGateway from './payment-gateway';
import Store from './store';
import { Collection, Place } from '@fleetbase/sdk';

export default class Network extends Resource {
constructor(attributes = {}, adapter, options = {}) {
super(attributes, adapter, 'network', options);
}

getStores(params = {}) {
return this.adapter.get('stores', params).then((stores) => {
return new Collection(stores.map(attributes => {
return new Store(attributes, this.adapter);
}));
});
}

getPaymentGateways() {
return this.adapter.get('gateways').then((gateways) => {
return new Collection(gateways.map(attributes => {
return new PaymentGateway(attributes, this.adapter);
}));
});
}
}
4 changes: 2 additions & 2 deletions src/storefront.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import StorefrontStore from './store';
import { detectAdapter, isKeyValid } from './utils';
import { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout } from './resources';
import { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Network } from './resources';
import { cartActions } from './resources/cart';
import { customerActions } from './resources/customer';
import { checkoutActions } from './resources/checkout';
Expand Down Expand Up @@ -69,4 +69,4 @@ export default class Storefront {
}
}

export { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout };
export { Product, Category, Customer, Cart, Store, StoreLocation, StoreHour, DeliveryServiceQuote, Checkout, PaymentGateway, Network };

0 comments on commit 0519c97

Please sign in to comment.