Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
barakamwakisha committed Feb 7, 2024
1 parent 422bd4e commit 0509cc0
Showing 1 changed file with 37 additions and 1 deletion.
38 changes: 37 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 0509cc0

Please sign in to comment.