Paypal IPN Request handling with Spring controller?
<p>I am wanting to extend the functionality of a Spring App to include an HTTP endpoint to receive Paypal Instant Payment Notifications.</p>

<p>Paypal sends these in the HTTP body like so:</p>

<blockquote>
  <p>mc_gross=19.95&amp;protection_eligibility=Eligible&amp;address_status=confirmed&amp;payer_id=LPLWNMTBWMFAY&amp;tax=0.00&amp;address_street=1+Main+St&amp;payment_date=20%3A12%3A59+Jan+13%2C+2009+PST&amp;payment_status=Completed&amp;charset=windows-1252&amp;address_zip=95131&amp;first_name=Test&amp;mc_fee=0.88&amp;address_country_code=US&amp;address_name=Test+User&amp;notify_version=2.6&amp;custom=&amp;payer_status=verified&amp;address_country=United+States&amp;address_city=San+Jose&amp;quantity=1&amp;verify_sign=AtkOfCXbDm2hu0ZELryHFjY-Vb7PAUvS6nMXgysbElEn9v-1XcmSoGtf&amp;payer_email=gpmac_1231902590_per%40paypal.com&amp;txn_id=61E67681CH3238416&amp;payment_type=instant&amp;last_name=User&amp;address_state=CA&amp;receiver_email=gpmac_1231902686_biz%40paypal.com&amp;payment_fee=0.88&amp;receiver_id=S8XGHLYDW9T3S&amp;txn_type=express_checkout&amp;item_name=&amp;mc_currency=USD&amp;item_number=&amp;residence_country=US&amp;test_ipn=1&amp;handling_amount=0.00&amp;transaction_subject=&amp;payment_gross=19.95&amp;shipping=0.00</p>
</blockquote>

<p><a href="https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNIntro/" rel="nofollow noreferrer">https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNIntro/</a></p>

<p>Do I need to define a concrete class to define the request body e.g.</p>

<p><strong>Request Class</strong></p>

<pre><code>    public class PaypalIPNRequest {

    private static final long serialVersionUID = 1L;
    private String mc_gross;
    private String protection_eligibility;
    private String address_street;
    ...


    public PaypalIPNRequest() {
    }

    //getters setters
}
</code></pre>

<p><strong>Controller</strong></p>

<pre><code>@Override
@Auditable
@RequestMapping(value = "/ipnRequest.do", method = RequestMethod.POST)
@ResponseStatus(value = HttpStatus.OK)
public void ipnRequest(@RequestBody final PaypalIPNRequest request) {
}
</code></pre>

<p>As stated in this SO answer: <a href="https://stackoverflow.com/questions/11291933/requestbody-and-responsebody-spring">@RequestBody and @ResponseBody annotations in Spring</a></p>

<p>What happens though if Paypal change their IPN request in the future, will this break?</p>

<p>Is there a better way to pass the request body without having a specific class?</p>

<p>Could I use HttpServletRequest?</p>