ExPesa.Mpesa.B2c — ExPesa v0.1.1 (2024)

Business to Customer (B2C) API enables the Business or organization to pay its customers who are the end-users of its products or services. Currently, the B2C API allows the org to perform around 3 types of transactions: SalaryPayments, BusinessPayments or Promotion payments. Salary payments are used by organizations paying their employees via M-Pesa, Business Payments are normal business transactions to customers e.g. bank transfers to mobile, Promotion payments are payments made by organization carrying out promotional services e.g. betting companies paying out winnings to clients

Functions

request(params)

Initiates the Mpesa B2C .

Link to this function

View Source

Initiates the Mpesa B2C .

Configuration

Add below config to dev.exs / prod.exs files

config.exs

 config :ex_pesa, mpesa: [ cert: "", b2c: [ initiator_name: "Safaricom1", password: "Safaricom133", timeout_url: "", result_url: "", security_credential: "" ] ]

To generate security_credential, head over to https://developer.safaricom.co.ke/test_credentials, then Initiator Security Password for your environment.Alternatively, generate security credential using certificate cert - This is the M-Pesa public key certificate used to encrypt your plain password. There are 2 types of certificates.

- sandox - https://developer.safaricom.co.ke/sites/default/files/cert/cert_sandbox/cert.cer .- production - https://developer.safaricom.co.ke/sites/default/files/cert/cert_prod/cert.cer .

password - This is a plain unencrypted password. Environment

- production - set password from the organization portal.- sandbox - use your own custom password

Parameters

attrs: - a map containing:

  • command_id - Unique command for each transaction type, possible values are: BusinessPayBill, MerchantToMerchantTransfer, MerchantTransferFromMerchantToWorking, MerchantServicesMMFAccountTransfer, AgencyFloatAdvance.
  • amount - The amount being transacted.
  • phone_number - Phone number receiving the transaction.
  • remarks - Comments that are sent along with the transaction.
  • occassion - Optional.

Example

iex> ExPesa.Mpesa.B2c.request(%{command_id: "BusinessPayment", amount: 10500, phone_number: "254722000000", remarks: "B2C Request"}){:ok, %{ "ConversationID" => "AG_20201010_00006bd489ffcaf79e91", "OriginatorConversationID" => "27293-71728391-3", "ResponseCode" => "0", "ResponseDescription" => "Accept the service request successfully." }}
ExPesa.Mpesa.B2c — ExPesa v0.1.1 (2024)

FAQs

What is M-PESA B2C? ›

The Bulk Payment (Business to Customer - B2C) service enables an organization to make payments/disbursem*nts from a given M-PESA shortcode to mobile phones of individuals in real-time at the click of a button e.g., Salary payments, Dividend payments, Sacco payments.

What is M-PESA G2? ›

The new M-PESA platform dubbed G2 (for M-PESA 2nd generation platform) offers versatile integration capabilities that our development partners can take advantage of, to create excellent M-PESA journeys across the different industries they serve.

Does M-PESA work in the USA? ›

Can you send M-PESA transfers from the US? Yes. You can send money from the US to be received into an M-PESA wallet.

Is the M-PESA app safe? ›

M-PESA has enabled various measures to ensure that our customers and merchant are not at risk of losing their funds for one reason or the other. Some of the measures are highlighted below. As M-PESA customers, you are required to set a new PIN during activation of your M-PESA account.

How do I use M-PESA on my phone? ›

To send money from the M-PESA SUPPER APP customers will:
  1. Open the M-PESA App.
  2. On the home tab select send and request.
  3. Select send money.
  4. Enter phone number or select the number from your contacts.
  5. Enter amount.
  6. Complete the transaction using M-PESA PIN or biometric authentication.

Why do people use M-PESA? ›

It also provides financial services to millions of people who have mobile phones, but do not have bank accounts, or only have limited access to banking services—with a safe, secure and affordable way to send and receive money, top-up airtime, make bill payments, receive salaries, get short-term loans and much more.

What is M-PESA payment for? ›

M-PESA allows users to deposit, withdraw, transfer money, pay for goods and services (Lipa na M-PESA, Swahili for "Pay with M-PESA"), access credit and savings, all with a mobile device.

What type of business is M-PESA? ›

M-Pesa is a virtual banking system that provides transaction services through a SIM card. Once the SIM has been inserted into the card slot of the mobile device, users can make payments and transfer money to vendors and family members with SMS messages.

How does an M-PESA work? ›

Customers register for the service at authorised agents - often small mobile phone stores or other retailers such as barbers, butchers, bakers, etc. - and then deposit cash in exchange for electronic money. Customers can then send money to their family or friends throughout the country.

What is a B2C payment type? ›

B2C payments are generally a one-time payment for a product and a smaller amount. B2C e-commerce is relatively simple: products are displayed on a website, consumer details are taken, and then payment is made on a secure checkout form with the consumers preferred payment type, such as a digital wallet.

What is the M-PESA transaction? ›

Safaricom. Website. www.vodafone.com/m-pesa. The service allows users to deposit money into an account stored on their cell phones, to send balances using PIN-secured SMS text messages to other users, including sellers of goods and services, and to redeem deposits for regular money.

Top Articles
California lawmakers failed to fix the insurance market. So what comes next?
DeFi Exchange Says It Beats Larger Rivals Binance, Coinbase
Directions To Franklin Mills Mall
Nehemiah 4:1–23
Danatar Gym
Ixl Elmoreco.com
Mr Tire Prince Frederick Md 20678
Google Jobs Denver
Craigslist In South Carolina - Craigslist Near You
Scentsy Dashboard Log In
Florida (FL) Powerball - Winning Numbers & Results
Obituary | Shawn Alexander | Russell Funeral Home, Inc.
Tokioof
All Buttons In Blox Fruits
Void Touched Curio
Restaurants Near Paramount Theater Cedar Rapids
Guilford County | NCpedia
Best Nail Salon Rome Ga
Lake Nockamixon Fishing Report
Dtab Customs
Alfie Liebel
Danforth's Port Jefferson
Beryl forecast to become an 'extremely dangerous' Category 4 hurricane
Icivics The Electoral Process Answer Key
Kcwi Tv Schedule
2013 Ford Fusion Serpentine Belt Diagram
Craigslist Illinois Springfield
480-467-2273
Is Holly Warlick Married To Susan Patton
Ultra Ball Pixelmon
Remnants of Filth: Yuwu (Novel) Vol. 4
Craigslist Cars And Trucks Mcallen
Grays Anatomy Wiki
A Small Traveling Suitcase Figgerits
Craigslist Ludington Michigan
Montrose Colorado Sheriff's Department
Toonily The Carry
Craigslist Free Manhattan
Taylor University Baseball Roster
Www Usps Com Passport Scheduler
Carroll White Remc Outage Map
Emily Tosta Butt
'The Night Agent' Star Luciane Buchanan's Dating Life Is a Mystery
Collision Masters Fairbanks
Embry Riddle Prescott Academic Calendar
Europa Universalis 4: Army Composition Guide
Bismarck Mandan Mugshots
French Linen krijtverf van Annie Sloan
Tyrone Dave Chappelle Show Gif
Vcuapi
Dinargurus
Latest Posts
Article information

Author: Gov. Deandrea McKenzie

Last Updated:

Views: 5709

Rating: 4.6 / 5 (66 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Gov. Deandrea McKenzie

Birthday: 2001-01-17

Address: Suite 769 2454 Marsha Coves, Debbieton, MS 95002

Phone: +813077629322

Job: Real-Estate Executive

Hobby: Archery, Metal detecting, Kitesurfing, Genealogy, Kitesurfing, Calligraphy, Roller skating

Introduction: My name is Gov. Deandrea McKenzie, I am a spotless, clean, glamorous, sparkling, adventurous, nice, brainy person who loves writing and wants to share my knowledge and understanding with you.