Logo Lanfrica

ettaegbe/Icemix-Mobile-Money-Android-Library

Domaine:

digital infrastructure

Type de record:

software
Créateur:
ett
Hôte:
This a mobile money library for collecting payment through mobile money payment with android particularly for Africa. The aim is that the merchant communicate directly with the main mobile money provider rather than a third party. # Icemix-Mobile-Money-Android-Library This a mobile money library for collecting payment through mobile money payment with android particularly for Africa. The aim is that the merchant communicate directly with the main mobile money provider rather than a third party. This version supports only MTN Uganda and other Countries Under same services of MTN Uganda ## Getting Started ### Prerequisites ### Installing Add it to your build.gradle with: ``` allprojects { repositories { maven { url "jitpack.io" } } } ``` and ``` dependencies { implementation 'com.github.ettaegbe:Icemix-Mobile-Money-Android-Library:1.0.0' } ``` Add Internet Permissions to your Android Manifest file ``` ``` Initialize the library for UGANDA and other countries using the same MTN Mobile Money service as Uganda ``` UGMomoPaymentRequest ugMomoPaymentRequest = new UGMomoPaymentRequest(); ``` And that's it! You now have access to the library functions and can make mobile money payments programatically! ## A Simple Example Have a user receive the mobile money USSD prompt after clicking a button. ``` @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); final String subscription = "2cbd35b7e91tr981629ba5d3a97b6"; final String api_user = "e6fdf72e-6781-11e5-a9g3-1681bejg63dfe"; final String api_key = "c2d87feac94246c3649f116f62971a88"; final EditText amount = findViewById(R.id.editTextAmount); final EditText phone = findViewById(R.id.editTextPhone); final TextView status = findViewById(R.id.textViewStatus); AppCompatButton btn = findViewById(R.id.btnPayNow); btn.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { UGMomoPaymentRequest ugMomoPaymentRequest = new UGMomoPaymentRequest(); ugMomoPaymentRequest.setSubscriptionKey(subscription); ugMomoPaymentRequest.setApiUser(api_user); ugMomoPaymentRequest.setApiKey(api_key); ugMomoPaymentRequest.setAmount(Integer …