Class PaymentExperienceSettings
- java.lang.Object
-
- com.gemalto.mfs.mwsdk.payment.experience.PaymentExperienceSettings
-
public final class PaymentExperienceSettings extends java.lang.Object
This class gives MPA the possibility to get the supported payment experience and set the expected payment experience in case the contactless payment flow is initiated whereas the TSHPaySDK is not initialized beforehand.- Since:
- 6.3.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static boolean
checkPaymentExperienceSupport(android.content.Context context, PaymentExperience paymentExperience)
Deprecated.6.7.0 it is no longer advised for usage.static boolean
checkPaymentExperienceSupport(android.content.Context context, PaymentExperience paymentExperience, int tolerance)
Deprecated.6.7.0 it is no longer advised for usage.static PaymentExperience
getPaymentExperience(android.content.Context context)
This API returns the current payment experience set insetPaymentExperience(Context ,PaymentExperience)
.static void
setPaymentExperience(android.content.Context context, PaymentExperience paymentExperience)
This API enables the payment application to set the expected payment experience in cases where the contactless payment is initiated and TSHPaySDK is not initialized.
-
-
-
Method Detail
-
checkPaymentExperienceSupport
@WorkerThread public static boolean checkPaymentExperienceSupport(android.content.Context context, PaymentExperience paymentExperience)
Deprecated.6.7.0 it is no longer advised for usage. With performance improvements done, MPA could adopt toPaymentExperience.ONE_TAP_ENABLED
directly.This API returns a boolean for the payment experience to be checked.This API checks the device capability for below payment experience:
- Parameters:
context
- the applicationContext
.paymentExperience
- the payment experience to be checked.- Returns:
- the checking result.
- Since:
- 6.4.0
If the device is running some background tasks such as location services or many background tasks running parallel during the usage of checkPaymentExperienceSupport API, this API may not return the accurate supported payment experience.
It is recommended to periodically check the checkPaymentExperienceSupport API because the device performance may slow down as it ages.
For
PaymentExperience.ONE_TAP_REQUIRES_SDK_INITIALIZED
andPaymentExperience.TWO_TAP_ALWAYS
, This API will always returntrue
immediately.For
PaymentExperience.ONE_TAP_ENABLED
, This API will perform benchmark operation which takes a couple of seconds. It is recommended to call this API in a separate thread without blocking the UI.- if the result is true, the MPA can set payment experience as
PaymentExperience.ONE_TAP_ENABLED
without keeping the SDK always initialized beforehand. - if the result is false, the MPA can
- set
PaymentExperience.ONE_TAP_REQUIRES_SDK_INITIALIZED
and keep the SDK always initialized (using foreground service) or - set
PaymentExperience.TWO_TAP_ALWAYS
and in such case it does not require to keep the SDK initialized.
- set
In case the MPA is not running in background, we recommend the MPA to check device performance.
If
PaymentExperience.TWO_TAP_ALWAYS
is set, PFP module is automatically enabled and there is no need to set "PFP.enable = true
" in bundle., 6.3.0
- if the result is true, the MPA can set payment experience as
-
checkPaymentExperienceSupport
@WorkerThread public static boolean checkPaymentExperienceSupport(android.content.Context context, PaymentExperience paymentExperience, int tolerance)
Deprecated.6.7.0 it is no longer advised for usage. With performance improvements done, MPA could adopt toPaymentExperience.ONE_TAP_ENABLED
directly.This API returns a boolean for the payment experience to be checked.This API checks the device capability for below payment experience:
- Parameters:
context
- the applicationContext
.paymentExperience
- the payment experience to be checked.tolerance
- the tolerance, which allows for 1 to 10, is a tolerated percentage of device performance threshold, can be used during device performance checking for non-high end devices to perform one tap payment.- Returns:
- the checking result.
- Since:
- 6.4.0
If the device is running some background tasks such as location services or many background tasks running parallel during the usage of checkPaymentExperienceSupport API, this API may not return the accurate supported payment experience.
It is recommended to periodically check the checkPaymentExperienceSupport API because the device performance may slow down as it ages.
For
PaymentExperience.ONE_TAP_REQUIRES_SDK_INITIALIZED
andPaymentExperience.TWO_TAP_ALWAYS
, This API will always returntrue
immediately.For
PaymentExperience.ONE_TAP_ENABLED
, This API will perform benchmark operation which takes a couple of seconds. It is recommended to call this API in a separate thread without blocking the UI.- if the result is true, the MPA can set payment experience as
PaymentExperience.ONE_TAP_ENABLED
without keeping the SDK always initialized beforehand. - if the result is false, the MPA can
- set
PaymentExperience.ONE_TAP_REQUIRES_SDK_INITIALIZED
and keep the SDK always initialized (using foreground service) or - set
PaymentExperience.TWO_TAP_ALWAYS
and in such case it does not require to keep the SDK initialized.
- set
In case the MPA is not running in background, we recommend the MPA to check device performance.
If
PaymentExperience.TWO_TAP_ALWAYS
is set, PFP module is automatically enabled and there is no need to set "PFP.enable = true
" in bundle., 6.3.0
- if the result is true, the MPA can set payment experience as
-
setPaymentExperience
public static void setPaymentExperience(android.content.Context context, PaymentExperience paymentExperience)
This API enables the payment application to set the expected payment experience in cases where the contactless payment is initiated and TSHPaySDK is not initialized. It is recommended to set the payment experience according to the device capability.Please see
checkPaymentExperienceSupport(android.content.Context, com.gemalto.mfs.mwsdk.payment.experience.PaymentExperience)
to check the device capability and get a more accurate payment experience according to device performance.By default payment experience is
PaymentExperience.ONE_TAP_REQUIRES_SDK_INITIALIZED
.If
PaymentExperience.TWO_TAP_ALWAYS
is set, PFP module is automatically enabled and there is no need to set "PFP.enable = true
" in bundle.- Parameters:
context
- the applicationContext
.paymentExperience
- thePaymentExperience
, can bePaymentExperience.ONE_TAP_ENABLED
orPaymentExperience.TWO_TAP_ALWAYS
, orPaymentExperience.ONE_TAP_REQUIRES_SDK_INITIALIZED
.- Since:
- 6.3.0
- See Also:
- Payment Fast Path (PFP)
-
getPaymentExperience
public static PaymentExperience getPaymentExperience(android.content.Context context)
This API returns the current payment experience set insetPaymentExperience(Context ,PaymentExperience)
.- Parameters:
context
- the applicationContext
.- Returns:
- the current payment experience.
- Since:
- 6.3.0
-
-