• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java PayPalConfiguration类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.paypal.android.sdk.payments.PayPalConfiguration的典型用法代码示例。如果您正苦于以下问题:Java PayPalConfiguration类的具体用法?Java PayPalConfiguration怎么用?Java PayPalConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PayPalConfiguration类属于com.paypal.android.sdk.payments包,在下文中一共展示了PayPalConfiguration类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getConstants

import com.paypal.android.sdk.payments.PayPalConfiguration; //导入依赖的package包/类
@Override public Map<String, Object> getConstants() {
  final Map<String, Object> constants = new HashMap<>();

  constants.put(ENVIRONMENT_NO_NETWORK, PayPalConfiguration.ENVIRONMENT_NO_NETWORK);
  constants.put(ENVIRONMENT_SANDBOX, PayPalConfiguration.ENVIRONMENT_SANDBOX);
  constants.put(ENVIRONMENT_PRODUCTION, PayPalConfiguration.ENVIRONMENT_PRODUCTION);

  constants.put(SCOPE_FUTURE_PAYMENTS, PayPalOAuthScopes.PAYPAL_SCOPE_FUTURE_PAYMENTS);
  constants.put(SCOPE_PROFILE, PayPalOAuthScopes.PAYPAL_SCOPE_PROFILE);
  constants.put(SCOPE_PAYPAL_ATTRIBUTES, PayPalOAuthScopes.PAYPAL_SCOPE_PAYPAL_ATTRIBUTES);
  constants.put(SCOPE_EMAIL, PayPalOAuthScopes.PAYPAL_SCOPE_EMAIL);
  constants.put(SCOPE_ADDRESS, PayPalOAuthScopes.PAYPAL_SCOPE_ADDRESS);
  constants.put(SCOPE_ADDRESS, PayPalOAuthScopes.PAYPAL_SCOPE_ADDRESS);
  constants.put(SCOPE_PHONE, PayPalOAuthScopes.PAYPAL_SCOPE_PHONE);
  constants.put(SCOPE_OPENID, PayPalOAuthScopes.PAYPAL_SCOPE_OPENID);
  
  return constants;
}
 
开发者ID:hieudole,项目名称:react-native-paypal-integration,代码行数:19,代码来源:PayPal.java


示例2: profileSharing

import com.paypal.android.sdk.payments.PayPalConfiguration; //导入依赖的package包/类
@ReactMethod
public void profileSharing(final ReadableMap payPalConfig, Callback callback)  {
  Activity currentActivity = this.getCurrentActivity();
  if (currentActivity == null) {
    return;
  }

  this.callback = callback;

  PayPalConfiguration config = this.createPayPalConfiguration(payPalConfig);

  this.startPayPalService(config, currentActivity);

  Intent intent = new Intent(currentActivity, PayPalProfileSharingActivity.class);
  intent.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, config);
  intent.putExtra(PayPalProfileSharingActivity.EXTRA_REQUESTED_SCOPES, this.getOauthScopes(payPalConfig));
  
  currentActivity.startActivityForResult(intent, REQUEST_CODE_PROFILE_SHARING);
}
 
开发者ID:hieudole,项目名称:react-native-paypal-integration,代码行数:20,代码来源:PayPal.java


示例3: onClick

import com.paypal.android.sdk.payments.PayPalConfiguration; //导入依赖的package包/类
@Override
public void onClick(View view) {
    valuesToVerify = new ValuesToVerify();
    valuesToVerify.currency = this.currency;
    valuesToVerify.price = this.price;
    valuesToVerify.tax = this.tax;
    valuesToVerify.repo = repo;
    if (alreadyRegistered) {
        final String correlationId = PayPalConfiguration.getApplicationCorrelationId(BasePurchaseActivity.this);
        PayProductRequestPayPal request = new PayProductRequestPayPal();
        request.setToken(token);
        request.setRepo(repo);
        request.setProductId(productId);
        request.setPrice(String.valueOf(price));
        request.setCurrency(currency);
        if(simcc!=null && simcc.length()>0){
            request.setSimCountryCode(simcc);
        }
        request.setCorrelationId(correlationId);
        request.setRetryPolicy(noRetryPolicy);
        requestsetExtra(request);

        DialogFragment df = new ProgressDialogFragment();
        df.show(getSupportFragmentManager(), "pleaseWaitDialog");
        df.setCancelable(false);
        spiceManager.execute(request, new PurchaseRequestListener());
    } else {
        Intent ppIntent = new Intent(BasePurchaseActivity.this, PayPalFuturePaymentActivity.class);
        startActivityForResult(ppIntent, REQUEST_CODE_FUTURE_PAYMENT);
        spiceManager.removeDataFromCache(IabSimpleResponseJson.class, "authorization-" + token);
    }
}
 
开发者ID:Aptoide,项目名称:aptoide-client,代码行数:33,代码来源:BasePurchaseActivity.java


示例4: getConstants

import com.paypal.android.sdk.payments.PayPalConfiguration; //导入依赖的package包/类
@Override public Map<String, Object> getConstants() {
  final Map<String, Object> constants = new HashMap<>();

  constants.put("NO_NETWORK", PayPalConfiguration.ENVIRONMENT_NO_NETWORK);
  constants.put("SANDBOX", PayPalConfiguration.ENVIRONMENT_SANDBOX);
  constants.put("PRODUCTION", PayPalConfiguration.ENVIRONMENT_PRODUCTION);
  constants.put(ERROR_USER_CANCELLED, ERROR_USER_CANCELLED);
  constants.put(ERROR_INVALID_CONFIG, ERROR_INVALID_CONFIG);

  return constants;
}
 
开发者ID:lukamarin,项目名称:paypal-react-native,代码行数:12,代码来源:PayPal.java


示例5: paymentRequest

import com.paypal.android.sdk.payments.PayPalConfiguration; //导入依赖的package包/类
@ReactMethod
public void paymentRequest(
  final ReadableMap payPalParameters,
  final Callback successCallback,
  final Callback errorCallback
) {
  this.successCallback = successCallback;
  this.errorCallback = errorCallback;

  final String environment = payPalParameters.getString("environment");
  final String clientId = payPalParameters.getString("clientId");
  final String price = payPalParameters.getString("price");
  final String currency = payPalParameters.getString("currency");
  final String description = payPalParameters.getString("description");

  PayPalConfiguration config =
    new PayPalConfiguration().environment(environment).clientId(clientId);

  startPayPalService(config);

  PayPalPayment thingToBuy =
    new PayPalPayment(new BigDecimal(price), currency, description,
                      PayPalPayment.PAYMENT_INTENT_SALE);

  Intent intent =
    new Intent(activityContext, PaymentActivity.class)
    .putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, config)
    .putExtra(PaymentActivity.EXTRA_PAYMENT, thingToBuy);

  currentActivity.startActivityForResult(intent, paymentIntentRequestCode);
}
 
开发者ID:lukamarin,项目名称:paypal-react-native,代码行数:32,代码来源:PayPal.java


示例6: navigateToPayPalForResult

import com.paypal.android.sdk.payments.PayPalConfiguration; //导入依赖的package包/类
public void navigateToPayPalForResult(int requestCode, String currency, String description,
    double amount) {

  final Bundle bundle = new Bundle();
  bundle.putParcelable(PayPalService.EXTRA_PAYPAL_CONFIGURATION,
      new PayPalConfiguration().environment(BuildConfig.PAYPAL_ENVIRONMENT)
          .clientId(BuildConfig.PAYPAL_KEY)
          .merchantName(marketName));
  bundle.putParcelable(com.paypal.android.sdk.payments.PaymentActivity.EXTRA_PAYMENT,
      new PayPalPayment(new BigDecimal(amount), currency, description,
          PayPalPayment.PAYMENT_INTENT_SALE));

  activityNavigator.navigateForResult(com.paypal.android.sdk.payments.PaymentActivity.class,
      requestCode, bundle);
}
 
开发者ID:Aptoide,项目名称:aptoide-client-v8,代码行数:16,代码来源:BillingNavigator.java


示例7: createPayPalConfiguration

import com.paypal.android.sdk.payments.PayPalConfiguration; //导入依赖的package包/类
private PayPalConfiguration createPayPalConfiguration(final ReadableMap config) {
 final String environment = config.getString("environment");
 final String clientId = config.getString("clientId");
 final String merchantName = config.getString("merchantName");
 final String merchantPrivacyPolicyUri = config.getString("merchantPrivacyPolicyUri");
 final String merchantUserAgreementUri = config.getString("merchantUserAgreementUri");

  return new PayPalConfiguration()
   .environment(environment)
   .clientId(clientId)
   .merchantName(merchantName)
   .merchantPrivacyPolicyUri(Uri.parse(merchantPrivacyPolicyUri))
   .merchantUserAgreementUri(Uri.parse(merchantUserAgreementUri));
}
 
开发者ID:hieudole,项目名称:react-native-paypal-integration,代码行数:15,代码来源:PayPal.java


示例8: startPayPalService

import com.paypal.android.sdk.payments.PayPalConfiguration; //导入依赖的package包/类
private void startPayPalService(PayPalConfiguration config, Activity currentActivity) {
  if (currentActivity == null) {
    return;
  }
  
  Intent intent = new Intent(currentActivity, PayPalService.class);
  intent.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, config);
  currentActivity.startService(intent);
}
 
开发者ID:hieudole,项目名称:react-native-paypal-integration,代码行数:10,代码来源:PayPal.java


示例9: onFuturePaymentPurchasePressed

import com.paypal.android.sdk.payments.PayPalConfiguration; //导入依赖的package包/类
public void onFuturePaymentPurchasePressed(View pressed) {
    // Get the Client Metadata ID from the SDK
    String metadataId = PayPalConfiguration.getClientMetadataId(this);

    Log.i("FuturePaymentExample", "Client Metadata ID: " + metadataId);

    // TODO: Send metadataId and transaction details to your server for processing with
    // PayPal...
    Toast.makeText(
            getApplicationContext(), "Client Metadata Id received from SDK", Toast.LENGTH_LONG)
            .show();
}
 
开发者ID:Gchorba,项目名称:NickleAndDimed,代码行数:13,代码来源:SampleActivity.java


示例10: setupPayPalConfig

import com.paypal.android.sdk.payments.PayPalConfiguration; //导入依赖的package包/类
private  void setupPayPalConfig() {
	try {
			
		payPalConfig = new PayPalConfiguration()
				.environment(PayPalConfiguration.ENVIRONMENT_SANDBOX)
				.clientId(
						getString(R.string.twitter_consumer_key));
	} catch (Exception e) {
		Log.e(TAG_PAYPAL, "Exception while paypal init configuration"+e,e);
	}
}
 
开发者ID:rutvijkumarshah,项目名称:WatsiAndroidApp,代码行数:12,代码来源:BaseFragmentActivity.java


示例11: startPayPalService

import com.paypal.android.sdk.payments.PayPalConfiguration; //导入依赖的package包/类
private void startPayPalService(PayPalConfiguration config) {
  Intent intent = new Intent(currentActivity, PayPalService.class);
  intent.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, config);
  currentActivity.startService(intent);
}
 
开发者ID:lukamarin,项目名称:paypal-react-native,代码行数:6,代码来源:PayPal.java


示例12: onPayClicked

import com.paypal.android.sdk.payments.PayPalConfiguration; //导入依赖的package包/类
/*****************************************************
 *
 * Notifies the agent that the user has clicked on the
 * credit card payment button.
 *
 *****************************************************/
@Override
public void onPayClicked( Context context, APaymentFragment paymentFragment, Order order, SingleCurrencyAmounts singleCurrencyAmount )
  {
  mContext              = context;
  mPaymentFragment      = paymentFragment;
  mOrder                = order;
  mSingleCurrencyAmount = singleCurrencyAmount;


  final PayPalCard lastUsedCard = PayPalCard.getLastUsedCard( context );

  if ( lastUsedCard != null && !lastUsedCard.hasVaultStorageExpired() )
    {
    AlertDialog.Builder builder = new AlertDialog.Builder( context );

    if ( KiteSDK.getInstance( context ).getPayPalEnvironment().equals( PayPalConfiguration.ENVIRONMENT_SANDBOX ) )
      {
      builder.setTitle( R.string.title_payment_source_sandbox );
      }
    else
      {
      builder.setTitle( R.string.title_payment_source );
      }

    builder.setItems( new String[]{ context.getString( R.string.alert_dialog_item_pay_with_new_card ), context.getString( R.string.alert_dialog_item_pay_with_existing_card_format_string, lastUsedCard.getLastFour() ) }, new DialogInterface.OnClickListener()
      {
      @Override
      public void onClick( DialogInterface dialogInterface, int itemIndex )
        {
        if ( itemIndex == 0 )
          {
          payWithNewCard();
          }
        else
          {
          payWithExistingCard( lastUsedCard );
          }
        }
      } );
    builder.show();
    }
  else
    {
    payWithNewCard();
    }
  }
 
开发者ID:OceanLabs,项目名称:Android-Print-SDK,代码行数:53,代码来源:PayPalCreditCardAgent.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HttpResponseFactory类代码示例发布时间:2022-05-21
下一篇:
Java QuadCurve类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap