create

fun create(from: ComponentActivity, stripePublishableKey: String, cardScanSheetResultCallback: CardScanSheet.CardScanResultCallback, registry: ActivityResultRegistry = from.activityResultRegistry): CardScanSheet

Create a CardScanSheet instance with ComponentActivity.

This API registers an ActivityResultLauncher into the ComponentActivity and notifies its result to cardScanSheetResultCallback, it must be called before the ComponentActivity is created (in the onCreate method).


fun create(from: Fragment, stripePublishableKey: String, cardScanSheetResultCallback: CardScanSheet.CardScanResultCallback, registry: ActivityResultRegistry? = null): CardScanSheet

Create a CardScanSheet instance with Fragment.

This API registers an ActivityResultLauncher into the Fragment and notifies its result to cardScanSheetResultCallback, it must be called before the Fragment is created (in the onCreate method).