This is an extension to Payments Pro.

Requirements:

  • A way to specify the information (fields) needed to refund payments for each payment processor type.
  • A way to specify time limit for refund for each payment processor.
    • partial refund
    • complete refund
  • A way to automatically extract this information from the JSON serialized information saved at payment time, with the payment record Id as the input.
  • A refund plugin that takes the type of refund (partial/complete), amount to refund in the case of partial (% or amount), and payment record Id to refund as input and triggers a refund on request.
    • If time limit for refund has exceeded, the plugin will give a message to that effect.
    • Each payment can only be refunded once (whether partial/complete refund does not matter). If refunded before, the plugin should show alternative content saying that it has already been refunded.
  • A common error and confirmation handling return values to the plugin that requested refund, so that the plugin can handle it the way it wants (perhaps to redirect to certain specified page as default handling):
    • refund successful
    • refund failed
  • A way to specify the definition JSON serialized for return values for each payment processor
  • A standard way to store and retrieve the JSON serialized values returned together with a payment record Id that can be referenced (conceivably, payment plugins can store this Id in the other trackers to reference payments, and make use of this info for other purposes).
  • Storing together with the refund record, info such as payment record Id, amount, refund type, payment processor, etc...


A sample implementation to Paypal Payments Refunds API is to be included. https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_RefundTransaction