Search in sources :

Example 1 with PaymentProductPublicKeyAsyncTask

use of com.globalcollect.gateway.sdk.client.android.sdk.asynctask.PaymentProductPublicKeyAsyncTask in project connect-sdk-client-android by Ingenico-ePayments.

the class GcSession method getPaymentProductPublicKey.

/**
 * Retrieves the publickey for a specific payment product from the GC gateway
 *
 * @param context, used for reading device metadata, which is send to the GC gateway
 * @param listener, OnPaymentProductPublicKeyLoaded listener which is called when the Android pay public key is retrieved
 */
public void getPaymentProductPublicKey(Context context, String productId, OnPaymentProductPublicKeyLoadedListener listener) {
    if (context == null) {
        throw new InvalidParameterException("Error getting payment product public key, context may not be null");
    }
    if (productId == null) {
        throw new InvalidParameterException("Error getting payment product public key, productId may not be null");
    }
    if (listener == null) {
        throw new InvalidParameterException("Error getting payment product public key, listener may not be null");
    }
    PaymentProductPublicKeyAsyncTask task = new PaymentProductPublicKeyAsyncTask(context, productId, communicator, listener);
    task.execute();
}
Also used : PaymentProductPublicKeyAsyncTask(com.globalcollect.gateway.sdk.client.android.sdk.asynctask.PaymentProductPublicKeyAsyncTask) InvalidParameterException(java.security.InvalidParameterException)

Aggregations

PaymentProductPublicKeyAsyncTask (com.globalcollect.gateway.sdk.client.android.sdk.asynctask.PaymentProductPublicKeyAsyncTask)1 InvalidParameterException (java.security.InvalidParameterException)1