-
- All Implemented Interfaces:
-
android.content.ComponentCallbacks
,android.view.View.OnCreateContextMenuListener
,androidx.activity.result.ActivityResultCaller
,androidx.lifecycle.HasDefaultViewModelProviderFactory
,androidx.lifecycle.LifecycleOwner
,androidx.lifecycle.ViewModelStoreOwner
,androidx.savedstate.SavedStateRegistryOwner
,com.oppwa.mobile.connect.checkout.dialog.PaymentButton
public class PaymentButtonFragment extends Fragment implements PaymentButton
Represents the payment button. Should be initialized with specific payment brand setPaymentBrand. Your activity must extend FragmentActivity.
-
-
Field Summary
Fields Modifier and Type Field Description public final static String
OPP_PAYMENT_BRAND_CARD
-
Method Summary
Modifier and Type Method Description void
onCreate(Bundle savedInstanceState)
View
onCreateView(@NonNull() LayoutInflater inflater, @Nullable() ViewGroup container, @Nullable() Bundle savedInstanceState)
void
onAttach(@NonNull() Context context)
void
onDetach()
void
onViewCreated(@NonNull() View view, @Nullable() Bundle savedInstanceState)
void
onStart()
void
onStop()
void
setActivityResultLauncher(@NonNull() ActivityResultLauncher<CheckoutSettings> activityResultLauncher)
Sets the to start the CheckoutActivity. String
getPaymentBrand()
Returns current payment brand. void
setPaymentBrand(@Nullable() String paymentBrand)
Sets payment brand for button. void
setPaymentButtonIntegrationMode(@NonNull() PaymentButtonIntegrationMode paymentButtonIntegrationMode)
Sets PaymentButtonIntegrationMode integration mode for the payment button. void
submitTransaction(@NonNull() CheckoutSettings checkoutSettings)
Submits a transaction via payment button. static void
isReadyForGooglePay(@NonNull() Context context, @NonNull() Connect.ProviderMode providerMode, @NonNull() String paymentDataRequestJson, @NonNull() OnCompleteListener<Boolean> completeListener)
Makes a check that Google Pay is ready for payment. static void
isReadyForSamsungPay(@NonNull() Context context, @NonNull() String serviceId, @NonNull() StatusListener statusListener)
Makes a check that Samsung Pay is ready for payment. -
-
Method Detail
-
onCreateView
@Nullable() View onCreateView(@NonNull() LayoutInflater inflater, @Nullable() ViewGroup container, @Nullable() Bundle savedInstanceState)
-
onDetach
void onDetach()
-
onViewCreated
void onViewCreated(@NonNull() View view, @Nullable() Bundle savedInstanceState)
-
onStart
void onStart()
-
onStop
void onStop()
-
setActivityResultLauncher
void setActivityResultLauncher(@NonNull() ActivityResultLauncher<CheckoutSettings> activityResultLauncher)
Sets the to start the CheckoutActivity.
- Parameters:
activityResultLauncher
- the activity result launcher.
-
getPaymentBrand
@Nullable() String getPaymentBrand()
Returns current payment brand.
-
setPaymentBrand
void setPaymentBrand(@Nullable() String paymentBrand)
Sets payment brand for button.
- Parameters:
paymentBrand
- the payment brand
-
setPaymentButtonIntegrationMode
void setPaymentButtonIntegrationMode(@NonNull() PaymentButtonIntegrationMode paymentButtonIntegrationMode)
Sets PaymentButtonIntegrationMode integration mode for the payment button.
- Parameters:
paymentButtonIntegrationMode
- the PaymentButtonIntegrationMode
-
submitTransaction
void submitTransaction(@NonNull() CheckoutSettings checkoutSettings)
Submits a transaction via payment button. Make sure you called setPaymentBrand prior. If user input is required, the CheckoutActivity will be opened, otherwise the transaction will be executed immediately.
- Parameters:
checkoutSettings
- the CheckoutSettings
-
isReadyForGooglePay
static void isReadyForGooglePay(@NonNull() Context context, @NonNull() Connect.ProviderMode providerMode, @NonNull() String paymentDataRequestJson, @NonNull() OnCompleteListener<Boolean> completeListener)
Makes a check that Google Pay is ready for payment.
- Parameters:
paymentDataRequestJson
- The payment data request in Json format.completeListener
- The completion listener.
-
isReadyForSamsungPay
static void isReadyForSamsungPay(@NonNull() Context context, @NonNull() String serviceId, @NonNull() StatusListener statusListener)
Makes a check that Samsung Pay is ready for payment.
- Parameters:
context
- The context.serviceId
- The Unique ID to represent the service.statusListener
- The requested operation status is returned via this interface.
-
-
-
-