paypal 第一次接触,听说很强大,在这里我门先不深究它的来历,上代码

首先你要下在个SDK,呵呵.....

1官网链接:https://developer.paypal.com/docs/classic/lifecycle/sdks/

示例如下:

2点击PayPal Mobile SDKs

示例如下:

3 点击PayPal Android SDK 进入GITHUB

如下图示;

一般集成 PayPal就够了...PS:Braintree不知道干啥的,PayPal就可以实现支付可能更强大,记得告诉我

4下翻  下翻

compile 'com.paypal.sdk:paypal-android-sdk:2.15.0'

导包---

5 正题来了 有时候依赖库多了会出现 这个问题

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed with multiple errors, see logs

莫慌莫慌

不是有度娘和gg么

http://blog.csdn.net/qq_33785670/article/details/52455241

这篇文章是正解!!!

但是如果在报错....嘿嘿文章说的是对,但是我是builde.gradle的 没有办法更改minSdkVersion和targetSdkVersion

哈哈,GitHub上是有解决办法的

貌似是说PayPal  不能在API低于16的版本运行 ,那么来吧小宝贝儿~~

把它说的

xmlns:tools="http://schemas.android.com/tools"
<uses-sdk android:minSdkVersion="INSERT_YOUR_DESIRED_minSdkVersion_HERE" tools:overrideLibrary="com.paypal.android.sdk.payments"/>

加进AndroidManifest中

6.PayPal支付用到的界面和service的配置。

<!-- PayPal支付 -->
<activity android:name="com.paypal.android.sdk.payments.PaymentActivity" />
<activity android:name="com.paypal.android.sdk.payments.PaymentMethodActivity" />
<activity android:name="com.paypal.android.sdk.payments.PaymentConfirmActivity" />
<activity android:name="com.paypal.android.sdk.payments.LoginActivity" />
<activity android:name="com.paypal.android.sdk.payments.PayPalFuturePaymentActivity" />
<activity android:name="com.paypal.android.sdk.payments.FuturePaymentConsentActivity" />
<activity android:name="com.paypal.android.sdk.payments.FuturePaymentInfoActivity" />
<activity android:name="com.paypal.android.sdk.payments.PayPalProfileSharingActivity" />
<activity android:name="com.paypal.android.sdk.payments.ProfileSharingConsentActivity" /><service
    android:name="com.paypal.android.sdk.payments.PayPalService"
    android:exported="false" />
<!-- PayPal支付 -->

7.调用PayPal
public class BBActivity extends BaseActivity implements View.OnClickListener {private static final String TAG = BBActivity.class.getSimpleName();private static final int REQUEST_CODE_PAYMENT = 1;// PayPal configurationprivate static PayPalConfiguration paypalConfig = new PayPalConfiguration().environment(Config.PAYPAL_ENVIRONMENT).clientId(Config.PAYPAL_CLIENT_ID);@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.a_activity);Intent intent = new Intent(this, PayPalService.class);intent.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, paypalConfig);startService(intent);findview();}@Overrideprotected void onDestroy() {stopService(new Intent(this, PayPalService.class));super.onDestroy();}private void findview() {findViewById(R.id.back).setOnClickListener(this);findViewById(R.id.cz_1w).setOnClickListener(this);}/**** 点击事件*/private String czmon="0";@Overridepublic void onClick(View v) {productsInCart.clear();czmon="0";switch (v.getId()) {case R.id.cz_1w: {//充值10000元czmon="10000";PayPalItem item = new PayPalItem("充值", 1,new BigDecimal("10000"), Config.DEFAULT_CURRENCY, "9999");productsInCart.add(item);launchPayPalPayment();}break;case R.id.back: {finish();}break;}}private List<PayPalItem> productsInCart = new ArrayList<PayPalItem>();/*** 添加商品信息* Preparing final cart amount that needs to be sent to PayPal for payment*/private PayPalPayment prepareFinalCart() {PayPalItem[] items = new PayPalItem[productsInCart.size()];items = productsInCart.toArray(items);// Total amountBigDecimal subtotal = PayPalItem.getItemTotal(items);// If you have shipping cost, add it hereBigDecimal shipping = new BigDecimal("0");// If you have tax, add it here赋税BigDecimal tax = new BigDecimal("0");PayPalPaymentDetails paymentDetails = new PayPalPaymentDetails(shipping, subtotal, tax);BigDecimal amount = subtotal.add(shipping).add(tax);PayPalPayment payment = new PayPalPayment(amount,Config.DEFAULT_CURRENCY,"Description about transaction. This will be displayed to the user.",Config.PAYMENT_INTENT);payment.items(items).paymentDetails(paymentDetails);// Custom field like invoice_number etc.,payment.custom("This is text that will be associated with the payment that the app can use.");return payment;}/*** 启动支付界面* Launching PalPay payment activity to complete the payment*/private void launchPayPalPayment() {PayPalPayment thingsToBuy = prepareFinalCart();Intent intent = new Intent(BBActivity.this, PaymentActivity.class);intent.putExtra(PayPalService.EXTRA_PAYPAL_CONFIGURATION, paypalConfig);intent.putExtra(PaymentActivity.EXTRA_PAYMENT, thingsToBuy);startActivityForResult(intent, REQUEST_CODE_PAYMENT);}/*** Receiving the PalPay payment response*/@Overrideprotected void onActivityResult(int requestCode, int resultCode, Intent data) {if (requestCode == REQUEST_CODE_PAYMENT) {if (resultCode == Activity.RESULT_OK) {PaymentConfirmation confirm = data.getParcelableExtra(PaymentActivity.EXTRA_RESULT_CONFIRMATION);if (confirm != null) {try {Log.e(TAG, confirm.toJSONObject().toString(4));Log.e(TAG, confirm.getPayment().toJSONObject().toString(4));String paymentId = confirm.toJSONObject().getJSONObject("response").getString("id");String payment_client = confirm.getPayment().toJSONObject().toString();Log.e(TAG, "paymentId: " + paymentId+ ", payment_json: " + payment_client);// <span style="font-size: 12pt; font-family: Arial, Helvetica, sans-serif;">请求后台,</span>在服务器端验证付款paypal(paymentId,czmon);} catch (JSONException e) {Log.e(TAG, "an extremely unlikely failure occurred: ",e);}}} else if (resultCode == Activity.RESULT_CANCELED) {Log.e(TAG, "The user canceled.");} else if (resultCode == PaymentActivity.RESULT_EXTRAS_INVALID) {Log.e(TAG,"An invalid Payment or PayPalConfiguration was submitted.");}}}/**** 核实付款*/private void paypal(String orders, String money) {showloading();xhttp = new Xhttp(URLManager.paypal);xhttp.add("orders", orders);xhttp.add("uid", MyData.USERID);xhttp.add("money", money);xhttp.post(new XhttpCallBack() {@Overridepublic void onSuccess(String result) {try {JSONObject obj = new JSONObject(result);String status = obj.getString("status");String mess = obj.getString("meg");showMessage(mess);if (status.equals("1")) {}} catch (JSONException e) {e.printStackTrace();}dismissloading();}@Overridepublic void onError() {dismissloading();}});}}
感谢.....
cc..
av..
http://www.androidhive.info/2015/02/android-integrating-paypal-using-php-mysql-part-2/#download_paypal_android_sdk


忘了 还有一段代码
import com.paypal.android.sdk.payments.PayPalConfiguration;
import com.paypal.android.sdk.payments.PayPalPayment;/*** Created by Kkan on 2016/10/24.*/public class Config {// PayPal app configurationpublic static final String PAYPAL_CLIENT_ID = "你的clientid";public static final String PAYPAL_CLIENT_SECRET = "secret 前端用不到";public static final String PAYPAL_ENVIRONMENT = PayPalConfiguration.ENVIRONMENT_SANDBOX;public static final String PAYMENT_INTENT = PayPalPayment.PAYMENT_INTENT_SALE;public static final String DEFAULT_CURRENCY = "USD";//美元}
												

Android paypal支付 集成 Manifest merger failed with multiple errors, see logs相关推荐

  1. 快速解决Android编译报错 : Manifest merger failed with multiple errors, see logs

    快速解决Android编译报错 : Manifest merger failed with multiple errors, see logs 编译项目的时候,遇到Android Manifest合并 ...

  2. android studio manifest merger failed,Android Studio报错Manifest merger failed with multiple errors...

    1.Error:Execution failed for task ':XXXX:processDebugManifest'. > Manifest merger failed with mul ...

  3. Android极光推送,Manifest merger failed with multiple errors, see logs

    极光推送加载jar包时,报错 Manifest merger failed with multiple errors, see logs 解决方法 加入红色部分 defaultConfig {appl ...

  4. Manifest merger failed with multiple errors, see logs解决方案

    Manifest merger failed with multiple errors, see logs解决方案 组件化开发,在测试单个组件的时候,有时编译会出现这样的问题 以本人的项目模拟: 当前 ...

  5. Manifest merger failed with multiple errors, see logs 问题处理

    在android开发的时候,有时候会遇到这样的问题 Error:Execution failed for task ':app:processBaiduDebugMainManifest'. > ...

  6. Manifest merger failed with multiple errors, see logs问题处理

    在android开发的时候,有时候会遇到这样的问题 Error:Execution failed for task ':test:processDebugManifest'. > Manifes ...

  7. Manifest merger failed with multiple errors, see logs问题解决

    今天在接入一个Android SDK的时候,报了一个Manifest merger failed with multiple errors, see logs问题,google了一下,这个问题在引入第 ...

  8. 手把手教你轻松解决Error:java.lang.RuntimeException: Manifest merger failed with multiple errors, see logs...

    这可谓经典错误了,Manifest merger failed 的意思是清单文件合并错误,首先是可以定位AndroidManifest.xml文件了. 错误等级 高 因为错误不明显,所以解决起来貌似非 ...

  9. ERROR: Manifest merger failed with multiple errors, see logs

    ERROR: Manifest merger failed with multiple errors, see logs 新建一个Android项目build的时候出现ERROR: Manifest ...

最新文章

  1. explicit specialization of ‘Race‘ after instantiation ,implicit instantiation first required here。
  2. docker管理平台 shipyard安装
  3. python推荐书籍-有哪些 Python 经典书籍?
  4. EconomicIndoor集成测试
  5. 《深入剖析NGINX》学习记录
  6. CentOS6.X安装QQ2012
  7. python自带的库有哪些餐厅_Python 常用的标准库以及第三方库有哪些
  8. spark学习-51-Spark的task任务的运行
  9. windows bat脚本编写_怎样在 txt 中用 2 行代码写出一个锁屏休息提醒脚本?
  10. 前端开发的模块化和组件化的定义,以及两者的关系?
  11. c#二次开发明华URF-R330读写器读写问题解决方案
  12. CSS选择器的权重计算
  13. HTML鼠标悬停图片置顶,鼠标悬浮图片放大
  14. ONVIF系列——海康摄像头设置onvif协议开启
  15. 怎么把QQ音乐里wav格式转换成MP3
  16. 【CF480D】Parcels DP
  17. 天池大数据众智平台笔记SQL(一)
  18. css div颜色渐变效果
  19. 查看window7 是否永久激活
  20. iOS安全攻防(九)使用Theos开发SpringBoard的Tweat

热门文章

  1. 软考A计划-电子商务设计师-电子商务系统建设
  2. Table中collapseColumns,stretchColumns
  3. 【googletrans包】Python谷歌翻译
  4. css外部命名规范,前端开发较全CSS命名规范
  5. ORA-12541: TNS: 无监听程序 的解决办法
  6. 中蒙俄经济走廊背景_中蒙俄经济走廊背景下黑龙江省对俄经贸合作发展研究
  7. 神经网络中的常用算法-BP算法
  8. 从消费者物联网聊点骇人的
  9. oracle 建一个自增序列,Oracle中如何创建使用SEQUENCES自增序列
  10. reduce的梦幻用法