Paypal for android如何识别回调中的支付项目?

时间:2012-03-01 14:52:31

标签: android flash paypal paypal-adaptive-payments

我正在使用PayPal移动支付库,使用Adobe AIR为Android实施PayPal。

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

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

感谢。

1 个答案:

答案 0 :(得分:0)

您可以传递任何其他自定义数据,以便在服务器端trow param上识别您的付款:

payment.setCustomID(“您可以传递的一些额外的不可见数据,它将在您的服务器的ipn回调网址中返回”);

// 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);