This guide provides step-by-step instructions to integrate the Bohudur payment gateway into your Android application.
First add Bohudur library on your Android Studio project.
First, initialize the Bohudur object with your API key.
This code is enough for making a successful payment request.
bohudur.setFullName("Jane Doe"); bohudur.setEmail("[email protected]"); bohudur.setAmount(10); bohudur.setReturnType(Bohudur.Type.GET());
bohudur.request(new PaymentResponse(){ @Override public void onPaymentSuccess(SuccessResponse response) { // handle success } @Override public void onPaymentCancelled(FailureResponse response) { // handle cancellation } });
bohudur.verify("YOUR_PAYMENT_KEY", new VerifyResponse() { @Override public void onPaymentVerified(SuccessResponse arg0) { // handle verified payment } @Override public void onPaymentError(FailureResponse arg0) { // handle error } });
If you need to use webhook or metadata you can use in this way.
bohudur.addMetadata("data1", "value1"); bohudur.addMetadata("data2", "value2"); bohudur.setWebhookCancelUrl("https://example.com/cancel.php"); bohudur.setWebhookSuccessUrl("https://example.com/success.php");