|
5 | 5 | token = ""
|
6 | 6 |
|
7 | 7 |
|
8 |
| -def initiate_payment(tx_ref: str, amount: float, currency: Optional[str], redirect_url: str, customer_name: str, |
9 |
| - payment_options: Optional[str], title: Optional[str], customer_email: str, |
10 |
| - customer_phone_number: Optional[str], description: Optional[str]) -> str: |
| 8 | +def initiate_payment(tx_ref: str, amount: float, redirect_url: str, customer_name: str, |
| 9 | + customer_email: str, currency: Optional[str] = None, payment_options: Optional[str] = None, |
| 10 | + title: Optional[str] = None, description: Optional[str] = None, |
| 11 | + customer_phone_number: Optional[str] = None, |
| 12 | + ) -> str: |
11 | 13 | """This is used to initiate standard payments. It takes in the arguments and returns the url to redirect users for
|
12 | 14 | payments """
|
13 | 15 | payment_url = "https://api.flutterwave.com/v3/payments"
|
@@ -53,8 +55,8 @@ def get_payment_details(trans_id: str) -> dict:
|
53 | 55 | return dict(response.json())
|
54 | 56 |
|
55 | 57 |
|
56 |
| -def trigger_mpesa_payment(tx_ref: str, amount: float, currency: str, email: Optional[str], phone_number: str, |
57 |
| - full_name: str) -> dict: |
| 58 | +def trigger_mpesa_payment(tx_ref: str, amount: float, currency: str, phone_number: str, full_name: str, |
| 59 | + email: Optional[str] = None) -> dict: |
58 | 60 | """
|
59 | 61 | This will automatically trigger an MPESA payment in form of an STK Push from your customer. It will return a
|
60 | 62 | dictionary with details regarding the transaction. Flutterwave will also send the status to your webhook configured
|
|
0 commit comments