paypal / ipn-code-samples

Other
562 stars 486 forks source link

About IPN validation parameters after 'VERIFIED' and 'Completed' #130

Closed objcoding closed 6 years ago

objcoding commented 6 years ago

If PayPal meets the problem of inconsistent order amount and so on, what parameter do I need to return to PayPal, let him mark that this payment is wrong so as to refund the money to the customer?

overint commented 6 years ago

I'm not sure what you mean, but I do not think you are able to change anything using the IPN. You would have to use one of the other PayPal APIs to do so. https://developer.paypal.com/

objcoding commented 6 years ago

@overint Thank you for your answer, so I want to ask you how you deal with the problem of inconsistency after the'VERIFIED'. Is PayPal want to ask the merchant system to apply for a refund voluntarily? Instead of returning an error code after processing, perform a refund operation for PayPal.

overint commented 6 years ago

I'm still not sure what you mean by apply refund, and the inconsistency? Can you explain further?

objcoding commented 6 years ago

@overint Sorry, my English is bad, that mean is "mc_gross is differ from merchant systmen order's fee"

objcoding commented 6 years ago

@overint

if (verifyInfo.equals("VERIFIED")) { // verify success

  if ("Completed".equals(paymentStatus)) { // payment success

    if (!receiverEmail.equals("merchant's email")) {

      // 1. TODO deal with merchant system

      // 2. what should I do to tell paypal that payment is Cheat???

      // return "FAIL"???

    } else if (!paymentAmount.equals("merchant's amount")) {

      // 1. TODO deal with merchant system

      // 2. what should I do to tell paypal that payment is Cheat???

      // return "FAIL"???
    }
  }
}
overint commented 6 years ago

what should I do to tell paypal that payment is Cheat

The IPN is valid, it just means someone else tried to cheat your system. I would log the details and send an email, or similar. You do not need to notify paypal.

objcoding commented 6 years ago

@overint Thank you for taking the time to explain to me!

overint commented 6 years ago

No worries.