Image 1 of 1

M-Pesa Payments

Product information

By Vendure Community

Accept Mpesa payments on your Vendure store.

npm install vendure-mpesa-plugin
Integration type
Community
Category
Payment & Tax
Latest version
0.0.12
Last published
Feb 7, 2024
Downloads in past month
103

Vendure Mpesa Plugin

Vendure Mpesa Plugin

GitHub Actions Workflow Status   NPM Version

Accept Mpesa payments on your Vendure store.

Installation

yarn add vendure-mpesa-plugin

Usage

  1. Add the MpesaPlugin to your VendureConfig plugins array.
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"
        })
    ]
}
  1. 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.

  1. Calling the addPaymentToOrder mutation on the storefront with the corresponing payment method code will initiate an STK push to the customer’s phone.

  2. Call the verifyMpesaTransaction mutation periodically on the storefront to verify the transaction status.

Reference

Vendure
Get started

Create your first commerce experience with Vendure in less than 2 minutes

Vendure is a registered trademark. Our trademark policy ensures that our brand and products are protected. Feel free to reach out if you have any questions about our trademarks.

Newsletter

Get the latest product news and announcements delivered directly to your inbox.

© Copyright 2022 - 2024, Vendure GmbH. All rights reserved.