0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

M-Pesaの開発環境に登録する

Last updated at Posted at 2019-10-14

準備

  • (お好みで)動作確認用に Postman を入れて、サインアップしておく

Get Started

ユーザ登録

アプリ(プロジェクト)の登録

  • 右上の「Add a new App」から、アプリ(プロジェクト)を登録する

  • Add App画面

01_Add-App.png
  • App Name

    • mpesa-test-1 (お好みで)
  • Product

    • Lipa Na Mpesa Sandbox (Under Testing And Will Have Limited Access)
      • チェック入れる
    • MPesa Sandbox (For MPesa Sanbox B2B, B2C And C2B APIs)
      • チェック入れる
  • My Apps画面

    • 上記で入れたAppNameをクリックすると、Consumer Key情報や、Analytics(スループットやエラー数)が表示される

動作確認

トークンの取得

まずはブラウザ上で試す

Postmanから呼び出す

  • Consumer Key + ":" + Consumer Secret をBASE64化する
  • client_credentials の以下のエンドポイントにGETで送信 (httpsにするのを忘れずに)
GET /oauth/v1/generate?grant_type=client_credentials HTTP/1.1
Host: sandbox.safaricom.co.ke
Authorization: Basic U1BMd0xkMnVBM29ub1BSWENKRjZiV3FXR3hOdkE4Qlo6NldPZ2hNQUdUdUVZS2pYMw==
Content-Type:application/json
  • 結果
{
  "access_token": "hsHoclSD53UC3657NAD3d0qBE8cA",
  "expires_in": "3599"
}

01_get-token-postman.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?