当前位置: 首页>>代码示例>>Java>>正文


Java PayPal.authorizeAccount方法代码示例

本文整理汇总了Java中com.braintreepayments.api.PayPal.authorizeAccount方法的典型用法代码示例。如果您正苦于以下问题:Java PayPal.authorizeAccount方法的具体用法?Java PayPal.authorizeAccount怎么用?Java PayPal.authorizeAccount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.braintreepayments.api.PayPal的用法示例。


在下文中一共展示了PayPal.authorizeAccount方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onPaymentMethodSelected

import com.braintreepayments.api.PayPal; //导入方法依赖的package包/类
@Override
public void onPaymentMethodSelected(PaymentMethodType type) {
    mLoadingViewSwitcher.setDisplayedChild(0);

    switch (type) {
        case PAYPAL:
            PayPal.authorizeAccount(mBraintreeFragment);
            break;
        case ANDROID_PAY:
            AndroidPay.requestAndroidPay(mBraintreeFragment, mDropInRequest.getAndroidPayCart(),
                    mDropInRequest.isAndroidPayShippingAddressRequired(),
                    mDropInRequest.isAndroidPayPhoneNumberRequired(),
                    mDropInRequest.getAndroidPayAllowedCountriesForShipping());
            break;
        case GOOGLE_PAYMENT:
            GooglePayment.requestPayment(mBraintreeFragment, mDropInRequest.getGooglePaymentRequest());
            break;
        case PAY_WITH_VENMO:
            Venmo.authorizeAccount(mBraintreeFragment);
            break;
        case UNKNOWN:
            Intent intent = new Intent(this, AddCardActivity.class)
                    .putExtra(DropInRequest.EXTRA_CHECKOUT_REQUEST, mDropInRequest);
            startActivityForResult(intent, ADD_CARD_REQUEST_CODE);
            break;
    }
}
 
开发者ID:braintree,项目名称:braintree-android-drop-in,代码行数:28,代码来源:DropInActivity.java

示例2: onPaymentMethodSelected_startsPayPal

import com.braintreepayments.api.PayPal; //导入方法依赖的package包/类
@Test
public void onPaymentMethodSelected_startsPayPal() {
    mockStatic(PayPal.class);
    doNothing().when(PayPal.class);
    PayPal.authorizeAccount(any(BraintreeFragment.class));

    mActivity.onPaymentMethodSelected(PaymentMethodType.PAYPAL);

    verifyStatic();
    PayPal.authorizeAccount(mActivity.braintreeFragment);
}
 
开发者ID:braintree,项目名称:braintree-android-drop-in,代码行数:12,代码来源:DropInActivityPowerMockTest.java

示例3: launchFuturePayment

import com.braintreepayments.api.PayPal; //导入方法依赖的package包/类
public void launchFuturePayment(View v) {
    setProgressBarIndeterminateVisibility(true);

    PayPalOverrides.setFuturePaymentsOverride(true);
    PayPal.authorizeAccount(mBraintreeFragment);
}
 
开发者ID:braintree,项目名称:braintree_android,代码行数:7,代码来源:PayPalActivity.java

示例4: launchFuturePaymentAddressScope

import com.braintreepayments.api.PayPal; //导入方法依赖的package包/类
public void launchFuturePaymentAddressScope(View v) {
    setProgressBarIndeterminateVisibility(true);

    PayPalOverrides.setFuturePaymentsOverride(true);
    PayPal.authorizeAccount(mBraintreeFragment, Collections.singletonList(PayPal.SCOPE_ADDRESS));
}
 
开发者ID:braintree,项目名称:braintree_android,代码行数:7,代码来源:PayPalActivity.java


注:本文中的com.braintreepayments.api.PayPal.authorizeAccount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。