本文整理汇总了Java中com.google.android.gms.wallet.WalletConstants.ENVIRONMENT_TEST属性的典型用法代码示例。如果您正苦于以下问题:Java WalletConstants.ENVIRONMENT_TEST属性的具体用法?Java WalletConstants.ENVIRONMENT_TEST怎么用?Java WalletConstants.ENVIRONMENT_TEST使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.google.android.gms.wallet.WalletConstants
的用法示例。
在下文中一共展示了WalletConstants.ENVIRONMENT_TEST属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
@SuppressWarnings("unchecked")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_android_pay);
Intent intent = getIntent();
publicKey = intent.getExtras().getString("publicKey");
Amount amount = (Amount) intent.getExtras().getSerializable("amount");
//Locale.US is intentional. AndroidPay expects prices in format "2.00" regardless of locale.
cartTotal = AmountUtil.format(amount, false, Locale.US);
currency = amount.getCurrency();
merchantName = intent.getExtras().getString("merchantName");
googleApiClient = getGoogleApiClient();
int environment = WalletConstants.ENVIRONMENT_TEST;
if (intent.hasExtra("environment") && intent.getExtras().getString("environment") != null
&& !intent.getExtras().getString("environment").isEmpty()) {
environment = Integer.parseInt(intent.getExtras().getString("environment"));
}
supportWalletFragment = createWalletFragment(environment,
WalletFragmentStyle.BuyButtonAppearance.ANDROID_PAY_DARK, WalletConstants.THEME_DARK);
// add Wallet fragment to the UI
getSupportFragmentManager().beginTransaction()
.replace(R.id.android_pay_fragment_container, supportWalletFragment)
.commit();
LocalBroadcastManager.getInstance(getApplicationContext()).registerReceiver(uiFinalizationIntent,
new IntentFilter(ADYEN_UI_FINALIZE_INTENT));
}
示例2: getEnvironment
static int getEnvironment(AndroidPayConfiguration configuration) {
if ("production".equals(configuration.getEnvironment())) {
return WalletConstants.ENVIRONMENT_PRODUCTION;
} else {
return WalletConstants.ENVIRONMENT_TEST;
}
}
示例3: environment
public static int environment(final @NonNull Build build) {
return build.isInternal() ? WalletConstants.ENVIRONMENT_TEST : WalletConstants.ENVIRONMENT_PRODUCTION;
}