-
public interface PrimerHeadlessUniversalCheckoutListener
-
-
Method Summary
Modifier and Type Method Description abstract UnitonAvailablePaymentMethodsLoaded(List<PrimerHeadlessUniversalCheckoutPaymentMethod> paymentMethods)Called after the PrimerHeadlessUniversalCheckout has been initialized. UnitonTokenizationStarted(String paymentMethodType)Called before the payment method tokenization is performed. UnitonTokenizeSuccess(PrimerPaymentMethodTokenData paymentMethodTokenData, PrimerHeadlessUniversalCheckoutResumeDecisionHandler decisionHandler)Called when payment method tokenization is successful. UnitonCheckoutResume(String resumeToken, PrimerHeadlessUniversalCheckoutResumeDecisionHandler decisionHandler)Called when payment method resume is successful. UnitonResumePending(PrimerCheckoutAdditionalInfo additionalInfo)Called when there is additional information returned for a payment. UnitonFailed(PrimerError error)Called in case SDK encounters an error. UnitonFailed(PrimerError error, PrimerCheckoutData checkoutData)Called in case SDK encounters an error. UnitonBeforePaymentCreated(PrimerPaymentMethodData paymentMethodData, PrimerPaymentCreationDecisionHandler createPaymentHandler)Called before the tokenization and payment creation has started. UnitonCheckoutAdditionalInfoReceived(PrimerCheckoutAdditionalInfo additionalInfo)Called when there is additional information returned for a payment. abstract UnitonCheckoutCompleted(PrimerCheckoutData checkoutData)Called when the user completed the checkout. UnitonBeforeClientSessionUpdated()UnitonClientSessionUpdated(PrimerClientSession clientSession)-
-
Method Detail
-
onAvailablePaymentMethodsLoaded
abstract Unit onAvailablePaymentMethodsLoaded(List<PrimerHeadlessUniversalCheckoutPaymentMethod> paymentMethods)
Called after the PrimerHeadlessUniversalCheckout has been initialized. Based on the clientToken provided, the payment methods that should be displayed will be returned.
-
onTokenizationStarted
Unit onTokenizationStarted(String paymentMethodType)
Called before the payment method tokenization is performed.
-
onTokenizeSuccess
Unit onTokenizeSuccess(PrimerPaymentMethodTokenData paymentMethodTokenData, PrimerHeadlessUniversalCheckoutResumeDecisionHandler decisionHandler)
Called when payment method tokenization is successful.
- Parameters:
paymentMethodTokenData- represents the tokenized payment method.decisionHandler- can be used to continue the payment flow in case there is required action needed.
-
onCheckoutResume
Unit onCheckoutResume(String resumeToken, PrimerHeadlessUniversalCheckoutResumeDecisionHandler decisionHandler)
Called when payment method resume is successful.
- Parameters:
resumeToken- should be used to continue/complete the PENDING payment.decisionHandler- can be used to continue the payment flow in case there is required action needed.
-
onResumePending
Unit onResumePending(PrimerCheckoutAdditionalInfo additionalInfo)
Called when there is additional information returned for a payment. These can be used to show information to the users in your own UI. At this stage the checkout flow can be considered as completed.
- Parameters:
additionalInfo- should be used to get additional payment info.
-
onFailed
Unit onFailed(PrimerError error)
Called in case SDK encounters an error.
- Parameters:
error- io.primer.android.domain.error.models.PrimerError.
-
onFailed
Unit onFailed(PrimerError error, PrimerCheckoutData checkoutData)
Called in case SDK encounters an error.
- Parameters:
error- io.primer.android.domain.error.models.PrimerError.checkoutData- represents a simple model about failed payment.
-
onBeforePaymentCreated
Unit onBeforePaymentCreated(PrimerPaymentMethodData paymentMethodData, PrimerPaymentCreationDecisionHandler createPaymentHandler)
Called before the tokenization and payment creation has started.
- Parameters:
paymentMethodData- represents a simple data about the payment method.createPaymentHandler- can be used to continue/cancel tokenization and payment process at this stage.
-
onCheckoutAdditionalInfoReceived
Unit onCheckoutAdditionalInfoReceived(PrimerCheckoutAdditionalInfo additionalInfo)
Called when there is additional information returned for a payment. These can be used to show information to the users in your own UI.
- Parameters:
additionalInfo- should be used to get additional payment info.
-
onCheckoutCompleted
abstract Unit onCheckoutCompleted(PrimerCheckoutData checkoutData)
Called when the user completed the checkout.
- Parameters:
checkoutData- represents a simple model about completed payment.
-
onBeforeClientSessionUpdated
Unit onBeforeClientSessionUpdated()
-
onClientSessionUpdated
Unit onClientSessionUpdated(PrimerClientSession clientSession)
-
-
-
-