Make Purchase Request

To make one time purchase request in your Android app, follow these simple instructions:

  • Import our library into your project

  • Create PurchaseRequest specifying a APIKEY your service ID

  • Additionally you can set reference parameter on PurchaseRequest by calling setReference(String id) method

  • Create PurchaseManager and attach a new instance of PurchaseListener

  • Start payment by calling PurchaseManager.startPurchase(PurchaseRequest pr, Context context) method.


public class LibExample extends Activity {
    public void onCreate(Bundle savedInstanceState) {

    OnClickListener mPurchaseClick = new OnClickListener() {
    public void onClick(View v) {
    PurchaseManager.attachPurchaseListener(new PurchaseListener() {
      public void onPurchaseSuccess(PurchaseResponse paramPurchaseResponse) {
      // handle purchase success
      public void onPurchaseFailed(PurchaseResponse paramPurchaseResponse) {
      // purchase fail
      public void onPurchaseCanceled(PurchaseResponse paramPurchaseResponse) {
      // purchase canceled by user
      public void onPurchaseDialogClosed() {
      // purchase dialog closed


    PurchaseRequest pr = new PurchaseRequest(<API-KEY>);
    pr.setReference(<YOUR-REFERENCE>); // optional
    pr.setPrice(<PRICE>); // optional
    pr.setLanguage(<ISO-639-1 code>); // optional
    pr.setMsisdn(<MSISDN>); // optional
        pr.setOperator(<ISO-639-1 code>); // optional
        pr.setCountry(<ISO 3166-1 Alpha 2 code>); // optional
        pr.setUserId(<YOUR-USERID>); // optional
    pr.setSignature(<GENERATED-SIGNATURE>); // optional
    pr.setParam(“mccmnc”,”20102”); // optional

    PurchaseManager.startPurchase(pr, LibExample.this);

Next step...

Updated 19 days ago

Make Purchase Request

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.