0

Using PayPal MPL, how could the back-end server check whether the payment completed? As I understand the MPL controls the entire flow, no need for back-end server calls - but what if the server needs to validate and register the purchase completion.

UPDATE First of all, thank you for the answers so far. We have two requirements/preferences that can guide us to refine our process:

  1. The payment should be validated as soon as possible. Customer should access the paid services right after the purchase.
  2. For the validation process we should use minimum proof data from the app. Consider the following scenario: purchase completed, but the back-end server went offline - so the client app needs to store the proof data (transaction id, payment id) in order to validate later. But what if the client looses the proof data (app reinstall, etc.) in the meantime- how can then the client and the back-end server get back in sync?

Because of req #1, we don't prefer IPN. According to the IPN documentation:

Although PayPal usually processes IPN messages immediately, IPN is not synchronized with actions on your website. Internet connectivity is not always 100% reliable and IPN messages can be lost or delayed. The IPN service automatically resends messages until the listener acknowledges them. The service resents messages for up to 4 days. Because IPN is not a real-time service, your checkout flow should not wait for the IPN message before it is allowed to complete. If the checkout flow is dependent on receiving an IPN message, processing can be delayed by system load or other reasons. Configure your checkout flow to handle a possible delay.

The process described in the iOS SDK docs involves various API calls to verify the payment, but those calls need some proof data from the client app. But what if the client looses proof data? (req #2) Maybe the proof data could be sent to the back-end before the payment? In that case the back-end server could store the proof data until it can be validated. That process would go like this:

  1. Client app initiates a PayPal payment
  2. Client app sends proof data/payment info to the back-end server
  3. Back-end server stores payment info
  4. Client app follow through the payment process with PayPal
  5. Client app notifies back-end that the payment can be validated (no additional data needed)
  6. Back-end server validates payment using the data from step 2.

For this we need an API call with a parameter that is available in step 2, but most id-s are available only after payment completed. Any advices?

4

2 回答 2

0

您应该会收到回复,表明付款已完成。但是,如果您想要在响应之外进行一些验证并注册购买完成,您从 MPL 中返回,您将不得不使用 API 调用或 IPN。您可以使用 API 调用检查交易状态或使用 IPN 并连接到您的数据库并验证订单是否完成。

于 2013-03-07T13:58:59.670 回答
0

请参阅https://developer.paypal.com/webapps/developer/docs/integration/mobile/verify-mobile-payment/

这些文档适用于今天发布的新 iOS SDK,但验证应该与旧 MPL 相同。(当然希望你会比旧的 MPL 更喜欢新的 SDK)

于 2013-03-08T14:20:50.590 回答