Interface PaymentBusinessService
-
- All Superinterfaces:
BusinessService
public interface PaymentBusinessService extends BusinessService
Initiates the Payment business service to perform payment related commands.There are several entry points for using this business service:
AbstractHCEServiceInternal.processCommandApdu(byte[], Bundle)
- triggered by the POS Terminal throughAbstractHCEService
orAsyncHCEService.processCommandApdu(byte[], Bundle)
- triggered by POS Terminal throughAsyncHCEService
for contactless paymentgenerateApplicationCryptogram(PaymentType, PaymentInputData, PaymentServiceListener)
orgenerateApplicationCryptogram(DigitalizedCard, PaymentType, PaymentInputData, PaymentServiceListener)
- triggered by the application for QR code or Remote payment
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
activate(DigitalizedCard card, PaymentType type, PaymentServiceListener listener)
Deprecated.since SDK v4.1.void
activate(PaymentType type, PaymentServiceListener listener)
Activates the payment service for default card,which fulfills the PIN_TAP payment use case Activates the payment service for default card(if have),which fulfills the TAP_PIN_TAP payment use casevoid
activateCard(java.lang.String tokenizedCardID, PaymentType type, PaymentServiceListener listener, CardActivationListener cardActivationlistener)
Deprecated.void
activateNonDefaultCard(java.lang.String tokenizedCardID, PaymentType type, boolean keepAsDefault, PaymentServiceListener listener, CardActivationListener cardActivationlistener)
Activate another card than default card.void
activateNonDefaultCard(java.lang.String tokenizedCardID, PaymentType type, PaymentServiceListener listener, CardActivationListener cardActivationlistener)
Activate another card than default card.void
deactivate()
Deactivate the currently activated payment service.void
generateApplicationCryptogram(DigitalizedCard card, PaymentType paymentType, PaymentInputData paymentInputData, PaymentServiceListener paymentServiceListener)
To generate Remote or QR payment data with the given DigitalizedCard.void
generateApplicationCryptogram(PaymentType paymentType, PaymentInputData paymentInputData, PaymentServiceListener paymentServiceListener)
To generate Remote or QR payment data with default card.void
generateQRCodePaymentData(java.lang.String inputData, PaymentServiceListener listener)
Deprecated.PaymentService
getActivatedPaymentService()
To get the currently activatePaymentService
.void
getAuthenticationFlowPriorToPayment(PaymentServiceListener listener, PaymentType type)
Deprecated.void
startAuthentication(PaymentServiceListener listener, PaymentType type)
To trigger authentication flow prior to Contactless payment.-
Methods inherited from interface com.gemalto.mfs.mwsdk.sdkconfig.BusinessService
initialize, reset
-
-
-
-
Method Detail
-
activate
void activate(DigitalizedCard card, PaymentType type, PaymentServiceListener listener)
Deprecated.since SDK v4.1. refer toactivateNonDefaultCard(String, PaymentType, PaymentServiceListener, CardActivationListener)
.Activates the payment service for manually selected card,which fulfills the PIN_TAP payment use case Activates the payment service for default card(if have),which fulfills the TAP_PIN_TAP payment use case- Parameters:
card
- A card to activate or null to activate the default card.type
- Type of payment transaction to be activated.listener
- thePaymentServiceListener
that provides interfaces for authentication and errors handlers
-
activate
void activate(PaymentType type, PaymentServiceListener listener)
Activates the payment service for default card,which fulfills the PIN_TAP payment use case Activates the payment service for default card(if have),which fulfills the TAP_PIN_TAP payment use case- Parameters:
type
- Type of payment transaction to be activated.listener
- thePaymentServiceListener
that provides interfaces for authentication and errors handlers
-
activateCard
@Deprecated void activateCard(java.lang.String tokenizedCardID, PaymentType type, PaymentServiceListener listener, CardActivationListener cardActivationlistener)
Deprecated.Activate another card than default card This method is to support card change in middle of tap use case. This method is deprecated. Please use insteadactivateNonDefaultCard(String, PaymentType, PaymentServiceListener, CardActivationListener)
oractivateNonDefaultCard(String, PaymentType, boolean, PaymentServiceListener, CardActivationListener)
- Parameters:
tokenizedCardID
- card token id to use for this paymenttype
- payment typelistener
- PaymentService listener for any notification to appcardActivationlistener
- to know once new card is activated for payment- Since:
- 6.1.0
-
activateNonDefaultCard
void activateNonDefaultCard(java.lang.String tokenizedCardID, PaymentType type, PaymentServiceListener listener, CardActivationListener cardActivationlistener)
Activate another card than default card. This method is to support card change after authentication use case. It preserves the CVM reset timeout and currently supports contactless payment only.The newly selected card remains as default at the end of the payment. However, in case of Single-Used-Key use cases such as MasterCard and PURE, the new default card must not be used directly for subsequent payment as payment key is not loaded for next payment. Key loading is skipped to avoid losing 1 payment key as this method is intended to be used when MPA does not keep the selected card as default after the payment. SDK does not automatically revert to the original default card. In above cases, if MPA intends to continue use the newly selected card, MPA must invoke DigitalizedCardManager.unsetDefaultCard(PaymentType, AbstractAsyncHandler)
followed byDigitalizedCard.setDefault(PaymentType, AbstractAsyncHandler)
on the selected payment card. To avoid the additional call, it is recommended to use APIactivateNonDefaultCard(String, PaymentType, boolean, PaymentServiceListener, CardActivationListener)
.- Parameters:
tokenizedCardID
- card token id to use for this paymenttype
- payment typelistener
- PaymentService listener for any notification to appcardActivationlistener
- to know once new card is activated for payment- Since:
- 6.1.0
-
activateNonDefaultCard
void activateNonDefaultCard(java.lang.String tokenizedCardID, PaymentType type, boolean keepAsDefault, PaymentServiceListener listener, CardActivationListener cardActivationlistener)
Activate another card than default card. This method is to support card change after authentication use case. It preserves the CVM reset timeout and currently supports contactless payment only.- Parameters:
tokenizedCardID
- card token id to be set as default and use for this paymenttype
- payment typekeepAsDefault
- if the card activated is intended to be kept as the default card after payment.If 'false', the API behaves the same as activateNonDefaultCard(String, PaymentType, PaymentServiceListener, CardActivationListener)
. When it is set as 'true', the newly selected card remains as default at the end of the payment. It is ready for next payment as a default card. However, in case the selected card has only 1 payment key left, it could no longer be used for further payment. Please check onDeactivationStatus
provided onContactlessPaymentServiceListener.onNextTransactionReady(DeactivationStatus, DigitalizedCardStatus, DigitalizedCard)
callback triggered at the end of a successful payment.listener
- PaymentService listener for any notification to appcardActivationlistener
- to know once new card is activated for payment- Since:
- 6.8.0
-
deactivate
void deactivate()
Deactivate the currently activated payment service.
If no payment service has been activated yet, this call will simply return. This method is used when user aborts the transaction when authentication is prompted or after authentication is performed.
-
getActivatedPaymentService
PaymentService getActivatedPaymentService()
To get the currently activatePaymentService
. The activatedPaymentService
is available when payment flow is successfully started and in progress. Such as when authentication is requested to the application. It become unavailable once the payment is completed or after the APIdeactivate()
is invoked.- Returns:
- The activated
PaymentService
or null if no card has been activated yet.
-
startAuthentication
void startAuthentication(PaymentServiceListener listener, PaymentType type)
To trigger authentication flow prior to Contactless payment.- Parameters:
listener
- Listener should be a ContactlessPaymentServiceListener} for call back notificationtype
- Should be ContactlessPaymentType
-
generateQRCodePaymentData
@Deprecated void generateQRCodePaymentData(java.lang.String inputData, PaymentServiceListener listener)
Deprecated.To generate QR code payment data. The callbackQRCodePaymentServiceListener.onDataReadyForPayment(PaymentService, TransactionContext)
will inform MPA when output data is ready to retrieve. This method is deprecated. Please use insteadgenerateApplicationCryptogram(PaymentType, PaymentInputData, PaymentServiceListener)
- Parameters:
inputData
- A JSON String with AID, authorised amount, currency code, and issuer discretionary data.listener
-PaymentServiceListener
for call back notification- Since:
- 6.1.0
-
getAuthenticationFlowPriorToPayment
@Deprecated void getAuthenticationFlowPriorToPayment(PaymentServiceListener listener, PaymentType type)
Deprecated.To trigger authentication flow prior to Contactless payment. This is deprecated, please usestartAuthentication(PaymentServiceListener, PaymentType)
instead- Parameters:
listener
- Listener should be a ContactlessPaymentServiceListener} for call back notificationtype
- Should be ContactlessPaymentType
- Since:
- 6.1.0
-
generateApplicationCryptogram
void generateApplicationCryptogram(PaymentType paymentType, PaymentInputData paymentInputData, PaymentServiceListener paymentServiceListener)
To generate Remote or QR payment data with default card. The callbackRemotePaymentServiceListener.onDataReadyForPayment(PaymentService, TransactionContext)
will be invoked for DSRP &QRCodePaymentServiceListener.onDataReadyForPayment(PaymentService, TransactionContext)
invoked for QR will inform MPA when output data is ready to retrieve.- Parameters:
paymentType
- =PaymentType.DSRP
orPaymentType.QR
paymentInputData
- PaymentInputData built for QR or DSRPpaymentServiceListener
-PaymentServiceListener
for call back notification. Instance ofRemotePaymentServiceListener
for DSRP, Instance ofQRCodePaymentServiceListener
for QR- Since:
- 6.1.0
-
generateApplicationCryptogram
void generateApplicationCryptogram(DigitalizedCard card, PaymentType paymentType, PaymentInputData paymentInputData, PaymentServiceListener paymentServiceListener)
To generate Remote or QR payment data with the given DigitalizedCard. The card does not have to be set as defaultCard for the payment. MPA is required to ensure the payment type is supported for the card otherwise error will be returned. The callbackRemotePaymentServiceListener.onDataReadyForPayment(PaymentService, TransactionContext)
will be invoked for DSRP &QRCodePaymentServiceListener.onDataReadyForPayment(PaymentService, TransactionContext)
invoked for QR will inform MPA when output data is ready to retrieve.- Parameters:
card
- Card used to generate cryptogrampaymentType
- =PaymentType.DSRP
orPaymentType.QR
paymentInputData
- PaymentInputData built for QR or DSRPpaymentServiceListener
-PaymentServiceListener
for call back notification. Instance ofRemotePaymentServiceListener
for DSRP, Instance ofQRCodePaymentServiceListener
for QR- Since:
- 6.5.0
-
-