android - 下载前的 Paypal 功能

标签 android paypal

我在安卓系统工作。我正在设计一个程序来从我的 http 服务器下载文件。在下载文件付款之前应该完成。

这是我的第一个布局:- enter image description here

当我点击 paypal 按钮时,这个 paypal 网站被打开:-

enter image description here

所以我想知道在付款后这个网站是否会根据我可以允许或不允许用户下载来返回一些东西。

我想知道用户是否支付了一些东西?请帮助我了解 android 中的 paypal 概念。

提前致谢...

最佳答案

我是通过从一本书中获得帮助来做到这一点的。

这是用于解决我的问题的代码:-

@覆盖

public void onActivityResult(int requestCode, int resultCode, Intent data) {

switch(resultCode) {

case Activity.RESULT_OK:

//The payment succeeded



Toast.makeText(this,"Payment has done successfully",Toast.LENGTH_SHORT).show();

//Tell the user their payment succeeded

休息;

case Activity.RESULT_CANCELED:


    Toast.makeText(this,"Payment has cancled",Toast.LENGTH_SHORT).show();
break;

case PayPalActivity.RESULT_FAILURE:

    flag=false;
    Toast.makeText(this,"Sorry Payment failed",Toast.LENGTH_SHORT).show();
    }

关于android - 下载前的 Paypal 功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7749740/

相关文章:

android - 使用 Amazon SNS 移动推送服务注册移动/Android 端点

java - 在android中动态添加1小时

php - Paypal 订阅(具有多个付款计划的付款协议(protocol))

c# - Paypal Rest API 使用模拟账户但不使用真实账户

php - 为用户 Wordpress 自动填充虚拟钱包

android - 如何在某种情况下跳过第一个 Activity

android - 是否可以在完整的新应用程序(游戏)的内部测试阶段测试 Google play 计费(应用内计费)?

android - 新的Android API是否包含所有以前版本的API?

api - Paypal - 使用 REST API 从沙盒切换到真实账户

codeigniter - 在 Codeigniter 中使用 Paypal Lib 时未获取 paypal 发布的信息