Last active
January 27, 2022 10:37
-
-
Save JaniKibichi/4b58e0ff8452ae12858f0efe5091e2e3 to your computer and use it in GitHub Desktop.
Function to Calculate the 1.5% ZawadiPay Discount
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Utilities { | |
public Utilities(){} | |
public static void launchMpesa(String phoneNumber,Float amount){ | |
//Calculate Discount | |
Double newDiscAmt=(1 - 0.015)*amount; | |
//Send Mpesa checkout with sendMpesaCheckout method defined elsewhere based on daraja API | |
//Metadata CAN BE the MerchantID to be returned to the callback | |
sendMpesaCheckout (PRODUCT_NAME, phoneNumber,CURRENCY_CODE, newDiscAmt.floatValue(), metadata); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment