android - Paypal for android 如何在回调中识别付款项?

标签 android flash paypal paypal-adaptive-payments

我正在使用 PayPal 移动支付库来使用 Adob​​e AIR 为 Android 实现 PayPal。

当我为用户创建一些 PayPalPayment 对象以添加要购买的商品时,如何在回调函数中获取该商品?

我希望能够检查交易是否有效?

谢谢。

最佳答案

您可以传递任何额外的自定义数据以在您的服务器端 trow 参数上识别您的付款:

payment.setCustomID("你可以传递一些额外的不可见数据,它会在 ipn 回调 URL 中返回到你的服务器");

// Create a basic PayPalPayment.
PayPalPayment payment = new PayPalPayment();

// Sets the currency type for this payment.
payment.setCurrencyType(currency_type);

// Sets the recipient for the payment. This can also be a phone number.
payment.setRecipient(paypal_recipient);

// Sets the amount of the payment, not including tax and shipping amounts.
payment.setSubtotal(new BigDecimal(currency_cost));

// Sets the payment type. This can be PAYMENT_TYPE_GOODS, PAYMENT_TYPE_SERVICE, PAYMENT_TYPE_PERSONAL, or PAYMENT_TYPE_NONE.
payment.setPaymentType(PayPal.PAYMENT_TYPE_GOODS);

// Sets the Custom ID. This is any ID that you would like to have associated with the payment.
payment.setCustomID(transaction_id);

// Sets the Instant Payment Notification url. This url will be hit by the PayPal server upon completion of the payment.
payment.setIpnUrl(payment_url_callback);

// Sets the memo. This memo will be part of the notification sent by PayPal to the necessary parties.
payment.setDescription(product_description);

关于android - Paypal for android 如何在回调中识别付款项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9518350/

相关文章:

jquery - 不安全的 JavaScript 尝试访问带有 URL 错误的框架

android - Flutter 的 'path_provider' 依赖项中的未定义类

android - 将最新的 facebook 4.0.1 sdk 导入 eclipse 以作为 facebook 功能登录时出错

android - 第二次单击标记时隐藏 infoWindow(Google Map Android API V2)

javascript - 卡住 req.flash 不是函数错误

flash - 在 Windows 上将 AIR 应用程序(而非安装程序)打包为单个 EXE

php - Paypal 使用 PHP cURL 获取访问 token

java - 在 Android Java 中键入时自动为 Edittext 中的标签着色

c++ - 形状中的 Flash "CurveTo"和 "LineTo"

forms - 如何将 2 个不同的提交按钮放在一个表单中(使用 CI)?