@Test public void init_addsPaymentSessionToken_andFetchesCustomer() { PaymentSession.PaymentSessionListener mockListener = mock(PaymentSession.PaymentSessionListener.class); PaymentSession paymentSession = new PaymentSession(mActivityController.get()); paymentSession.init(mockListener, new PaymentSessionConfig.Builder().build()); Set<String> tokenSet = CustomerSession.getInstance().getProductUsageTokens(); assertTrue(tokenSet.contains(PaymentSession.TOKEN_PAYMENT_SESSION)); verify(mockListener).onCommunicatingStateChanged(eq(true)); }
public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); }
PaymentSession { public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); } }
PaymentSession { public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); } PaymentSession(@NonNull Activity hostActivity); }
PaymentSession { public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); } PaymentSession(@NonNull Activity hostActivity); void completePayment(@NonNull PaymentCompletionProvider provider); boolean handlePaymentData(int requestCode, int resultCode, @NonNull Intent data); boolean updateIsPaymentReadyToCharge(PaymentSessionConfig paymentSessionConfig, PaymentSessionData paymentSessionData); boolean init(@NonNull PaymentSessionListener listener,
                        @NonNull PaymentSessionConfig paymentSessionConfig); boolean init(
            @NonNull PaymentSessionListener listener,
            @NonNull PaymentSessionConfig paymentSessionConfig,
            @Nullable Bundle savedInstanceState); void presentPaymentMethodSelection(); void savePaymentSessionInstanceState(@NonNull Bundle outState); void setCartTotal(@IntRange(from = 0) long cartTotal); void presentShippingFlow(); PaymentSessionData getPaymentSessionData(); void onDestroy(); }
PaymentSession { public boolean init(@NonNull PaymentSessionListener listener, @NonNull PaymentSessionConfig paymentSessionConfig) { return init(listener, paymentSessionConfig, null); } PaymentSession(@NonNull Activity hostActivity); void completePayment(@NonNull PaymentCompletionProvider provider); boolean handlePaymentData(int requestCode, int resultCode, @NonNull Intent data); boolean updateIsPaymentReadyToCharge(PaymentSessionConfig paymentSessionConfig, PaymentSessionData paymentSessionData); boolean init(@NonNull PaymentSessionListener listener,
                        @NonNull PaymentSessionConfig paymentSessionConfig); boolean init(
            @NonNull PaymentSessionListener listener,
            @NonNull PaymentSessionConfig paymentSessionConfig,
            @Nullable Bundle savedInstanceState); void presentPaymentMethodSelection(); void savePaymentSessionInstanceState(@NonNull Bundle outState); void setCartTotal(@IntRange(from = 0) long cartTotal); void presentShippingFlow(); PaymentSessionData getPaymentSessionData(); void onDestroy(); static final String TOKEN_PAYMENT_SESSION; static final String EXTRA_PAYMENT_SESSION_ACTIVE; static final String PAYMENT_SESSION_DATA_KEY; static final String PAYMENT_SESSION_CONFIG; }