diff --git a/README.md b/README.md
index 148b67c..e9519d3 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
![expressCart](https://raw.githubusercontent.com/mrvautin/expressCart/master/public/images/logo.png)
-`expressCart` is a fully functional shopping cart built in Node.js (Express, MongoDB) with Stripe, PayPal, Authorize.net and Adyen payments.
+`expressCart` is a fully functional shopping cart built in Node.js (Express, MongoDB) with Stripe, PayPal, Authorize.net, Adyen and Instore payments.
[![Github stars](https://img.shields.io/github/stars/mrvautin/expressCart.svg?style=social&label=Star)](https://github.com/mrvautin/expressCart)
[![Build Status](https://travis-ci.org/mrvautin/expressCart.svg?branch=master)](https://travis-ci.org/mrvautin/expressCart)
@@ -308,6 +308,19 @@ The Adyen config file is located: `/config/adyen.json`. A example Adyen settings
Note: The `publicKey`, `apiKey` and `merchantAccount` is obtained from your Adyen account dashboard.
+##### Instore (Payments)
+
+The Instore config file is located: `/config/instore.json`. A example Instore settings file is provided:
+
+```
+{
+ "orderStatus": "Pending",
+ "buttonText": "Place order, pay instore",
+ "resultMessage": "The order is place. Please pay for your order instore on pickup."
+}
+```
+Note: No payment is actually processed. The order will move to the `orderStatus` set and the payment is completed instore.
+
## Email settings
You will need to configure your SMTP details for expressCart to send email receipts to your customers.
@@ -362,9 +375,7 @@ New static pages are setup via `/admin/settings/pages`.
## TODO
-- Add some tests...
-- Separate API and frontend
-- Modernize the frontend
+- Modernize the frontend of the admin
## Contributing
diff --git a/app.js b/app.js
index d4c56a1..8ef5c3f 100644
--- a/app.js
+++ b/app.js
@@ -66,6 +66,12 @@ switch(config.paymentGateway){
process.exit(2);
}
break;
+ case'instore':
+ if(ajv.validate(require('./config/instoreSchema'), require('./config/instore.json')) === false){
+ console.log(colors.red(`instore config is incorrect: ${ajv.errorsText()}`));
+ process.exit(2);
+ }
+ break;
}
// require the routes
@@ -79,6 +85,7 @@ const paypal = require('./routes/payments/paypal');
const stripe = require('./routes/payments/stripe');
const authorizenet = require('./routes/payments/authorizenet');
const adyen = require('./routes/payments/adyen');
+const instore = require('./routes/payments/instore');
const app = express();
@@ -259,6 +266,25 @@ handlebars = handlebars.create({
return options.fn(this);
}
return options.inverse(this);
+ },
+ paymentMessage: (status) => {
+ if(status === 'Paid'){
+ return'