public interface PaymentMethodPlugin
extends java.io.Serializable
Modifier and Type | Interface and Description |
---|---|
static class |
PaymentMethodPlugin.CheckoutData |
static interface |
PaymentMethodPlugin.OnPaymentMethodListener |
static class |
PaymentMethodPlugin.PluginPosition |
Modifier and Type | Method and Description |
---|---|
android.support.v4.app.Fragment |
getFragment(PaymentMethodPlugin.CheckoutData data,
android.content.Context context)
Fragment that will appear if
shouldShowFragmentOnSelection() is true
when user clicks this payment method. |
android.os.Bundle |
getFragmentBundle(PaymentMethodPlugin.CheckoutData data,
android.content.Context context)
This bundle will be attached to the fragment that you expose in
getFragment(CheckoutData, Context) |
java.lang.String |
getId()
Returns the plugin id
|
PaymentMethodInfo |
getPaymentMethodInfo(android.content.Context context)
This method returns the minimum amount of information required
by the payment method to be shown in payment method selection.
|
PaymentMethodPlugin.PluginPosition |
getPluginPosition()
This method returns
PaymentMethodPlugin.PluginPosition.TOP or
PaymentMethodPlugin.PluginPosition.BOTTOM it represents
where the plugin will be placed in payment method selection. |
void |
init(PaymentMethodPlugin.CheckoutData checkoutData)
Init method to be called in a background thread to init this plugin.
|
boolean |
isEnabled()
method to know if the plugin is available.
|
boolean |
shouldShowFragmentOnSelection()
method to know if the plugin should show a view on selection.
|
void init(@NonNull PaymentMethodPlugin.CheckoutData checkoutData)
PaymentMethodPlugin.PluginPosition getPluginPosition()
PaymentMethodPlugin.PluginPosition.TOP
or
PaymentMethodPlugin.PluginPosition.BOTTOM
it represents
where the plugin will be placed in payment method selection.@NonNull java.lang.String getId()
boolean shouldShowFragmentOnSelection()
@NonNull PaymentMethodInfo getPaymentMethodInfo(@NonNull android.content.Context context)
context
- provided to construct the PaymentMethodInfo if it's needed.PaymentMethodInfo
@Nullable android.os.Bundle getFragmentBundle(@NonNull PaymentMethodPlugin.CheckoutData data, @NonNull android.content.Context context)
getFragment(CheckoutData, Context)
data
- checkout data to the moment it's called.context
- that you may need to fill information.@Nullable android.support.v4.app.Fragment getFragment(@NonNull PaymentMethodPlugin.CheckoutData data, @NonNull android.content.Context context)
shouldShowFragmentOnSelection()
is true
when user clicks this payment method.
inside Fragment.onAttach(Context)
context will be an instance of PaymentMethodPlugin.OnPaymentMethodListener
data
- checkout data to the moment it's called.context
- that you may need to fill information.boolean isEnabled()