use of java.security.InvalidParameterException in project connect-sdk-client-android by Ingenico-ePayments.
the class GcSession method getDirectoryForPaymentProductId.
/**
* Gets PaymentProductDirectory from the GC gateway
*
* @param productId, for which product must the lookup be done
* @param currencyCode, for which currencyCode must the lookup be done
* @param countryCode, for which countryCode must the lookup be done
* @param context, used for reading device metada which is send to the GC gateway
* @param listener, listener which will be called by the AsyncTask when the PaymentProductDirectory with fields is retrieved
*/
public void getDirectoryForPaymentProductId(String productId, CurrencyCode currencyCode, CountryCode countryCode, Context context, OnPaymentProductDirectoryCallCompleteListener listener) {
if (productId == null) {
throw new InvalidParameterException("Error getting PaymentProductDirectory, productId may not be null");
}
if (currencyCode == null) {
throw new InvalidParameterException("Error getting PaymentProductDirectory, currencyCode may not be null");
}
if (countryCode == null) {
throw new InvalidParameterException("Error getting PaymentProductDirectory, countryCode may not be null");
}
if (listener == null) {
throw new InvalidParameterException("Error getting PaymentProductDirectory, listener may not be null");
}
if (context == null) {
throw new InvalidParameterException("Error getting PaymentProductDirectory, context may not be null");
}
PaymentProductDirectoryAsyncTask task = new PaymentProductDirectoryAsyncTask(productId, currencyCode, countryCode, context, communicator, listener);
task.execute();
}
use of java.security.InvalidParameterException in project connect-sdk-client-android by Ingenico-ePayments.
the class GcSession method getBasicPaymentProductGroups.
/**
* Gets BasicPaymentProducts for the given PaymentRequest
*
* @param context, used for reading device metada which is send to the GC gateway
* @param paymentContext, C2sPaymentProductContext which contains all neccesary data for doing call to the GC gateway to retrieve paymentproducts
* @param listener, OnPaymentProductsCallComplete which will be called by the BasicPaymentProductsAsyncTask when the BasicPaymentProducts are loaded
*/
public void getBasicPaymentProductGroups(Context context, PaymentContext paymentContext, OnBasicPaymentProductGroupsCallCompleteListener listener) {
if (context == null) {
throw new InvalidParameterException("Error getting paymentProductGroups, context may not be null");
}
if (paymentContext == null) {
throw new InvalidParameterException("Error getting paymentProductGroups, paymentContext may not be null");
}
if (listener == null) {
throw new InvalidParameterException("Error getting paymentProductGroups, listener may not be null");
}
this.paymentContext = paymentContext;
// Add OnBasicPaymentProductGroupsCallCompleteListener and this class to list of listeners so we can store the paymentProductGroups here
List<OnBasicPaymentProductGroupsCallCompleteListener> listeners = new ArrayList<>();
listeners.add(this);
listeners.add(listener);
// Start the task which gets paymentproducts
BasicPaymentProductGroupsAsyncTask task = new BasicPaymentProductGroupsAsyncTask(context, paymentContext, communicator, listeners);
task.execute();
}
use of java.security.InvalidParameterException in project connect-sdk-client-android by Ingenico-ePayments.
the class GcSession method getPaymentProductGroup.
/**
* Gets PaymentProductGroup with fields from the GC gateway
*
* @param context, used for reading device metada which is send to the GC gateway
* @param groupId, the productId of the group which needs to be retrieved from the GC gateway
* @param paymentContext, PaymentContext which contains all necessary data for doing call to the GC gateway to retrieve PaymentProductGroup
* @param listener, listener which will be called by the AsyncTask when the PaymentProductGroup with fields is retrieved
*/
public void getPaymentProductGroup(Context context, String groupId, PaymentContext paymentContext, OnPaymentProductGroupCallCompleteListener listener) {
if (context == null) {
throw new InvalidParameterException("Error getting paymentproduct, context may not be null");
}
if (groupId == null) {
throw new InvalidParameterException("Error getting paymentproduct, groupId may not be null");
}
if (paymentContext == null) {
throw new InvalidParameterException(("Error getting paymentproduct, paymentContext may not be null"));
}
if (listener == null) {
throw new InvalidParameterException("Error getting paymentproduct, listener may not be null");
}
this.paymentContext = paymentContext;
// Create the cache key for this paymentProductGroup
PaymentItemCacheKey key = createPaymentItemCacheKey(paymentContext, groupId);
// If the paymentProductGroup is already in the cache, call the listener with that paymentProductGroup
if (paymentItemMapping.containsKey(key)) {
PaymentProductGroup cachedPPG = (PaymentProductGroup) paymentItemMapping.get(key);
listener.onPaymentProductGroupCallComplete(cachedPPG);
} else {
// Add OnPaymentProductsCallComplete listener and this class to list of listeners so we can store the paymentproduct here
List<OnPaymentProductGroupCallCompleteListener> listeners = new ArrayList<>();
listeners.add(this);
listeners.add(listener);
// Do the call to the GC gateway
PaymentProductGroupAsyncTask task = new PaymentProductGroupAsyncTask(context, groupId, paymentContext, communicator, listeners);
task.execute();
}
}
use of java.security.InvalidParameterException in project connect-sdk-client-android by Ingenico-ePayments.
the class GcSession method getPaymentProductNetworks.
public void getPaymentProductNetworks(Context context, String productId, PaymentContext paymentContext, OnPaymentProductNetworksCallCompleteListener listener) {
if (context == null) {
throw new InvalidParameterException("Error getting PaymentProductNetworks, context may not be null");
}
if (productId == null) {
throw new InvalidParameterException("Error getting PaymentProductNetworks, productId may not be null");
}
if (paymentContext == null) {
throw new InvalidParameterException("Error getting PaymentProductNetworks, paymentContext may not be null");
}
if (listener == null) {
throw new InvalidParameterException("Error getting PaymentProductNetworks, listener may not be null");
}
PaymentProductNetworksAsyncTask task = new PaymentProductNetworksAsyncTask(context, productId, paymentContext, communicator, listener);
task.execute();
}
use of java.security.InvalidParameterException 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();
}
Aggregations