Android – Advanced Integration

Accept payments in your own Android application thanks to the HiPay Android SDK.

This integration allows you to build your own payment workflow and your own form, using the core wrapper. You can thus fully customize the payment experience to fit your needs. On the downside, you have to take care of building the whole user interface of the page and creating and sending the orders to HiPay so the payment can be made.

Advantages of this integration: Checkout page customization.

Before going through this part, make sure you have followed the SDK configuration.

The HiPay Enterprise SDK for Android contains a layer referred to as the core wrapper, which is basically a helpful wrapper of the HiPay Enterprise platform’s REST API. By using it, you won’t have to send HTTP requests or deal with XML or JSON deserialization. The core wrapper will take care of this for you.

It exposes models and methods that allow you to easily send payment requests. In fact, the built-in payment screen itself relies on the core wrapper for performing order requests, retrieving transaction details, etc.

The sections below describe the main interfaces you can rely on to perform order requests, tokenize credit cards, retrieve transaction details, etc. The payment workflow implementation details and the user interface are up to you.

Tokenize a card

To tokenize a card, you need to leverage the Secure Vault client, as follows. This step is mandatory in order to make payments with credit or debit cards, either for one-shot or recurring payments.

You can also update a token by using the Secure Vault method named updatePaymentCard(String, String, String, String, String, UpdatePaymentCardCallback).

To get information about a previously generated token, use the Secure Vault method named lookupPaymentCardWithToken(String, String, LookupPaymentCardCallback).

Payment

You can make payments using the Gateway Client and its requestNewOrder(OrderRequest, OrderRequestCallback) method. This request will both create a new order based on the information you provided and process the payment simultaneously.

Therefore, you need to provide your order ID, the amount of the transaction, the payment product (Visa, MasterCard, PayPal, etc.) and the related payment method information (i.e., the token if it’s a credit or a debit card). You can also provide a lot of other optional information.

When requesting a new order, do not forget to check the state of the newly created transaction.

The signature parameter is required for security purposes. Please refer to the signature section for details.

Payment Products

In order to get the exact list of payment methods enabled on your account, you can leverage the getPaymentProductsForRequest method of the Gateway Client. You need to provide this endpoint with information about your order (by using a PaymentPageRequest, because the list of payment products may change depending on order-related information (i.e., the currency)).