From 0509cc02891181abffb897a63428e464ba3296f3 Mon Sep 17 00:00:00 2001 From: barakamwakisha Date: Wed, 7 Feb 2024 22:36:04 +0300 Subject: [PATCH] update readme --- README.md | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8098214..3f71caf 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,40 @@ Accept Mpesa payments on your Vendure store. -🚀 **WORK IN PROGRESS** +## Installation + +```bash +yarn add vendure-mpesa-plugin +``` + +## Usage + +1. Add the MpesaPlugin to your `VendureConfig` plugins array. + +```ts +import { MpesaPlugin } from "vendure-mpesa-plugin" + +export const config: VendureConfig = { + // ... + plugins: [ + // ... + MpesaPlugin.init({ + consumerKey: "YOUR_CONSUMER_KEY", + consumerSecret: "YOUR_CONSUMER_SECRET", + shortCode: "YOUR_SHORT_CODE", + shortCodeType: "SHORTCODE_TYPE", + passkey: "YOUR_PASSKEY", + environment: "APP_ENVIRONMENT", + vendureHost: "https://yourvendurestore.com" + }) + ] +} +``` + +2. Start the server and navigate to `Settings > Payment methods`. Add a new payment method, selecting `Lipa na Mpesa Online` as the handler. + +> Note: Select the 'Check whether Mpesa supports the payment' eligibility checker when creating the payment method. + +## Reference + +- [Mpesa Daraja API Docs](https://developer.safaricom.co.ke/Documentation)