本文整理汇总了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;
}
}
示例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);
}
示例3: launchFuturePayment
import com.braintreepayments.api.PayPal; //导入方法依赖的package包/类
public void launchFuturePayment(View v) {
setProgressBarIndeterminateVisibility(true);
PayPalOverrides.setFuturePaymentsOverride(true);
PayPal.authorizeAccount(mBraintreeFragment);
}
示例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));
}