-
- All Implemented Interfaces:
-
io.primer.android.PrimerCheckoutListener,io.primer.android.components.PrimerHeadlessUniversalCheckoutInterface,io.primer.android.di.DIAppComponent,org.koin.core.component.KoinComponent
public final class PrimerHeadlessUniversalCheckout implements PrimerHeadlessUniversalCheckoutInterface, PrimerCheckoutListener, DIAppComponent
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classPrimerHeadlessUniversalCheckout.Companion
-
Method Summary
Modifier and Type Method Description UnitsetListener(PrimerHeadlessUniversalCheckoutListener listener)Sets the PrimerHeadlessUniversalCheckoutListener Use the listener in order to receive different events from the SDK Unitstart(Context context, String clientToken, PrimerSettings settings, PrimerHeadlessUniversalCheckoutListener listener)Starts the PrimerHeadlessUniversalCheckout SDK with Context & clientToken & PrimerSettings & PrimerHeadlessUniversalCheckoutListener. List<PrimerInputElementType>getRequiredInputElementTypes(String paymentMethodType)Gets the PrimerInputElementType for a given paymentMethodType ViewmakeView(String paymentMethodType, ViewGroup container)Creates View for a given paymentMethodType UnitshowPaymentMethod(Context context, String paymentMethodType)Initialise and show specific payment method flows with PrimerHeadlessUniversalCheckout. Unitcleanup()This method should be called when disposing the listener in order to free PrimerHeadlessUniversalCheckout SDK resource. UnitonTokenizeSuccess(PrimerPaymentMethodTokenData paymentMethodTokenData, PrimerResumeDecisionHandler decisionHandler)UnitonFailed(PrimerError error, PrimerErrorDecisionHandler errorHandler)UnitonFailed(PrimerError error, PrimerCheckoutData checkoutData, PrimerErrorDecisionHandler errorHandler)UnitonDismissed()UnitonCheckoutCompleted(PrimerCheckoutData checkoutData)UnitonResumePending(PrimerCheckoutAdditionalInfo additionalInfo)UnitonAdditionalInfoReceived(PrimerCheckoutAdditionalInfo additionalInfo)-
Methods inherited from class io.primer.android.components.PrimerHeadlessUniversalCheckout
getKoin, onBeforeClientSessionUpdated, onBeforePaymentCreated, onClientSessionUpdated, onResumeSuccess -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
setListener
Unit setListener(PrimerHeadlessUniversalCheckoutListener listener)
Sets the PrimerHeadlessUniversalCheckoutListener Use the listener in order to receive different events from the SDK
-
start
Unit start(Context context, String clientToken, PrimerSettings settings, PrimerHeadlessUniversalCheckoutListener listener)
Starts the PrimerHeadlessUniversalCheckout SDK with Context & clientToken & PrimerSettings & PrimerHeadlessUniversalCheckoutListener. Calling this function will reset any old state
- Parameters:
clientToken- base64 string containing information about this Primer session.
-
getRequiredInputElementTypes
List<PrimerInputElementType> getRequiredInputElementTypes(String paymentMethodType)
Gets the PrimerInputElementType for a given paymentMethodType
-
makeView
View makeView(String paymentMethodType, ViewGroup container)
Creates View for a given paymentMethodType
- Parameters:
container- Optional view to be the parent of the generated hierarchy.
-
showPaymentMethod
Unit showPaymentMethod(Context context, String paymentMethodType)
Initialise and show specific payment method flows with PrimerHeadlessUniversalCheckout.
- Parameters:
paymentMethodType- the payment method flow to be shown.
-
cleanup
Unit cleanup()
This method should be called when disposing the listener in order to free PrimerHeadlessUniversalCheckout SDK resource. Once instance of PrimerHeadlessUniversalCheckout has freed up the used resources, it is in the same state as newly created PrimerHeadlessUniversalCheckout and can be used once again, but should go through start once again.
-
onTokenizeSuccess
Unit onTokenizeSuccess(PrimerPaymentMethodTokenData paymentMethodTokenData, PrimerResumeDecisionHandler decisionHandler)
-
onFailed
Unit onFailed(PrimerError error, PrimerErrorDecisionHandler errorHandler)
-
onFailed
Unit onFailed(PrimerError error, PrimerCheckoutData checkoutData, PrimerErrorDecisionHandler errorHandler)
-
onDismissed
Unit onDismissed()
-
onCheckoutCompleted
Unit onCheckoutCompleted(PrimerCheckoutData checkoutData)
-
onResumePending
Unit onResumePending(PrimerCheckoutAdditionalInfo additionalInfo)
-
onAdditionalInfoReceived
Unit onAdditionalInfoReceived(PrimerCheckoutAdditionalInfo additionalInfo)
-
-
-
-