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


Java WalletConstants.ENVIRONMENT_TEST属性代码示例

本文整理汇总了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));
}
 
开发者ID:Adyen,项目名称:adyen-android,代码行数:35,代码来源:AndroidPayActivity.java

示例2: getEnvironment

static int getEnvironment(AndroidPayConfiguration configuration) {
    if ("production".equals(configuration.getEnvironment())) {
        return WalletConstants.ENVIRONMENT_PRODUCTION;
    } else {
        return WalletConstants.ENVIRONMENT_TEST;
    }
}
 
开发者ID:braintree,项目名称:braintree_android,代码行数:7,代码来源:GooglePayment.java

示例3: environment

public static int environment(final @NonNull Build build) {
  return build.isInternal() ? WalletConstants.ENVIRONMENT_TEST : WalletConstants.ENVIRONMENT_PRODUCTION;
}
 
开发者ID:kickstarter,项目名称:android-oss,代码行数:3,代码来源:AndroidPayUtils.java


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