📜  lipa na mpesa daraja python 代码示例

📅  最后修改于: 2022-03-11 14:46:31.491000             🧑  作者: Mango

代码示例1
import requests
  from requests.auth import HTTPBasicAuth
  
  consumer_key = "YOUR_APP_CONSUMER_KEY"
  consumer_secret = "YOUR_APP_CONSUMER_SECRET"
  api_URL = "https://sandbox.safaricom.co.ke/oauth/v1/generate?grant_type=client_credentials"
  
  r = requests.get(api_URL, auth=HTTPBasicAuth(consumer_key, consumer_secret))
  
  print (r.text)