PayPal as a part of their service can be set up to send Instant Payment Notification (IPN) messages to your website to notify e-Commerce or other system of an event that has occured. These messages can be telling your website that a payment has been made or a new subscription has been created. Also it can tell you more important information such as the fact a payment has been successful or it has failed. This will then allow e-Commerce to take the required action.

This IPN request may or may not be in the desired format. This can occur because the system has been migrated to e-Commerce and now existing subscriptions have a new id. Instead of getting all customers to recreate their subscriptions, we can alter the IPN request to have the new subscription numbers in them.

TODO: Create better example

function hook_ec_paypal_ipn_alter($ipn) {
  if ($ipn['txn_type'] == 'subscrip-payment') {
   ...
  }
}