The eBizCharge Android SDK and payment library bundle offers developers two different options of implementing our payment gateway within their Android apps. The SDK provides complete access to the gateway, giving developers the tools to manage a wide range of features, including transactions, products, and customers. The payment library provides a prebuilt activity that developers can use to obtain payment information from the end-user.
The SDK and payment library both require Android 2.3.3+ (API 10+).
Download the bundle . It contains the SDKebizcharge-payment.zip, the payment library, and a demo app for the payment library.
The documentation for this SDK can be found inside the bundle.
The payment library uses the SDK to communicate with the gateway. The payment method is determined by the getCommand() method from the instance of TransactionRequest that is passed to this library's activity. See below for an example.
This library currently can only process credit card sales (Command.CC_SALE) and authorizations (Command.CC_AUTH). More payment methods will be added in the future.
Note: This library uses the Android v7 appcompat support library. Please see Google's Support Library Setup guide for more information on how to add the v7 support library.
manifestmerger.enabled=true
or declare this library's activity in your app's manifest:
<activity android:name="com.ebizcharge.library.payment.PaymentLibraryActivity" android:label="@string/app_name" />
<uses-permission android:name="android.permission.INTERNET" />
Here is a code snippet for creating a new transaction request and calling this library to process the transaction as a credit card sale.
CurrencyAmount subtotal = new CurrencyAmount("10.00"); CurrencyAmount tax = new CurrencyAmount(0, 2); String invoice = "123456"; TransactionRequest request = new TransactionRequest(); request.setCommand(Command.CC_SALE); // credit card sale request.setTotal(subtotal.add(tax)); request.setTax(tax); request.setInvoice(invoice); Intent i = new Intent(this, PaymentLibraryActivity.class); i.putExtra(PaymentLibraryConstants.TRANSACTION_REQUEST, request); startActivityForResult(i, REQUEST_PAYMENT_LIBRARY);
The results of the transaction processing will be returned in your activity's onActivityResult method.
@Override public void onActivityResult(int requestCode, int resultCode, Intent data) { if (resultCode == RESULT_OK && requestCode == REQUEST_PAYMENT_LIBRARY) { TransactionResponse response = data .getParcelableExtra(PaymentLibraryConstants.TRANSACTION_RESPONSE); if (response == null) { // something wrong happened when communicating with the gateway GatewayException exception = data .getParcelableExtra(PaymentLibraryConstants.GATEWAY_EXCEPTION); exception.printStackTrace(); } else { String msg = "Transaction #: " + response.getRefNum() + ", Result: " + response.getResult() +", Error: " + response.getError(); Toast.makeText(this, msg, Toast.LENGTH_SHORT).show(); } } }
Class | Description | Link |
---|---|---|
TransactionRequest | Transaction details to submit | See SDK reference for more information |
TransactionResponse | Response from gateway | See SDK reference for more information |
CurrencyAmount | A class to handle money | See SDK reference for more information |
GatewayException | Exception if transaction couldn't be sent to gateway | See SDK reference for more information |
Version | Change |
---|---|
1.1 | Support for cash, check, and ACH payment methods |
1.0 | Initial release |