PayPal pour Android Comment identifier l'article de paiement dans le rappel?
-
14-11-2019 - |
Question
J'utilise la bibliothèque PayPal Mobile Payments pour implémenter PayPal pour Android à l'aide d'Adobe Air.
Lorsque je crée un objet PayPalPayment pour que l'utilisateur puisse ajouter un article à acheter, comment puis-je obtenir cet article dans la fonction de rappel?
Je veux pouvoir vérifier que la transaction est valide?
Merci.
La solution
Vous pouvez transmettre toutes les données personnalisées supplémentaires pour identifier votre paiement sur le paramètre de TROW de votre serveur:
PAYS.SetcustomId ("Des données supplémentaires non visibles que vous pouvez passer et elles reviendront dans l'URL de rappel IPN sur votre serveur");
// 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);
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow