#g4pppay_refundPayment

      *//////////////////////////////////////////////////////////////*
      * #g4pppay_refundPayment - Refund Payment                      *
      *                                                              *
      * Input/Output                                                 *
      *   in_out_refFile - The fully qualified path and name of the  *
      *    JSON file that contains the refund information as         *
      *    generated by PayPal.                                      *
      *    If this value is blank the filename and path will be      *
      *    automatically generated.                                  *
      *    NOTE: This file will only exist is the value for          *
      *    save_refund_draft is set to true.                         *
      *                                                              *
      * Output:                                                      *
      *   out_refID - The refund ID that was created.                *
      *   out_errMsg - The error message (if error exists).          *
      *                                                              *
      * Returns:                                                     *
      *   -1 for error, 0 for no error.                              *
      *                                                              *
      * Settable Variables ([r]=required)                            *
      *   account - PayPal Account ID [r]                            *
      *   sale_id - The sale ID to be used fore the refund. [r]      *
      *   refund_currency_code - Refund Currency Code (Default USD)  *
      *   refund_value - Total Refund Amount                         *
      *   item_subtotal - If this refund includes an item list this  *
      *     should contain the item subtotal.                        *
      *   shipping_subtotal - The shipping subtotal.                 *
      *   tax_subtotal - The tax subtotal.                           *
      *   handling_subtotal - The handling subtotal.                 *
      *   shipping_discount_subtotal - The shipping discount         *
      *     subtotal.                                                *
      *   insurance_subtotal - The insurance subtotal.               *
      *   giftwrap_subtotal - The giftwrap subtotal.                 *
      *   refund_source - The source of the refund.                  *
      *     INSTANT_FUNDING_SOURCE, ECHECK, UNRESTRICTED (default)   *
      *   refund_reason - The refund reason description.             *
      *   invoice_number - The invoice number the refund is for.     *
      *   refund_advice - If in store credit has already been issued *
      *     for the refund.  (true or false)  Default is false.      *
      *   save_refund_draft - Save Refund Draft JSON file (true      *
      *     or false.  Default false.)                               *
      *   temporary_directory - Temporary directory to use for work  *
      *     files.  Default /tmp.                                    *
      *   reset - Reset Values After Call (*YES or *NO, Default *YES)*
      *   ccsid - The CCSID to use (1208)                            *
      *   debug - Turn on Debug (*NO, *YES)                          *
      *   debug_file - The debug file name.                          *
      *     (/tmp/g4pp_[account]_refundPayment)                      *
      *                                                              *
      *//////////////////////////////////////////////////////////////*
     D #g4pppay_refundPayment...
     D                 PR            10i 0
     D  out_refID                   256
     D  in_out_refFile...
     D                              256
     D  out_errMsg                  256    Options(*NOPASS)
      *--------------------------------------------------------------*

#g4pppay_refundPayment is used to issue a full or partial refund for a PayPal payment. You must set a specific payment/sale ID in order for the refund to process correctly.

Returns: 0 for success, -1 for error.

Required Parameters:

  • Refund ID (output) - The refund ID that is returned from PayPal when the refund is issued.

Optional Parameters:

  • Refend JSON File Name (input/output) - Specify a fully qualified path and filename for the JSON refund data file. If you leave this blank a filename will be automatically generated. This field is only used if save_refund_draft is set to *YES.
  • Error Message (output) - Error message

Settable Variables:

  • account - PayPal Account ID (required)
  • sale_id - The sale ID to be used fore the refund. (required)
  • refund_currency_code - Refund Currency Code.
  • refund_value - Total Refund Amount. If this is left blank the entire payment will be refunded.
  • refund_description - The description for the refund. This will appear on the refund details.
  • refund_reason - The reason for the refund. This is yet to be implemented by PayPal, but it is available on the API.
  • invoice_number - The invoice number the refund is for.
  • save_refund_draft - Save Refund Draft JSON file (true or false. Default false.)
  • temporary_directory - Temporary directory to use for work files. Default /tmp.
  • reset - Reset Values After Call (*YES or *NO, Default *YES)
  • ccsid - The CCSID to use (1208)
  • debug - Turn on Debug (*NO, *YES)
  • debug_file - The debug file name. (Default is /tmp/g4pp_[account]_refundPayment)