Link Search Menu Expand Document

paypal_processor

The paypal_processor tag can be used to process PayPal IPN.

Please see Core Concepts - PayPal for an in-depth discussion of this tag.

Parameters

  • debug
  • logfile

debug

The processing of IPN by this tag is a background operation which makes it difficult to know what exactly is going on in case things don’t work in the expected manner. By setting this parameter to ‘1’, we can make this tag log into a file (specified by the logfile parameter) every step it takes while processing.

logfile

The log file into which the steps are to be logged. If this parameter is skipped, a log file named ‘log.txt’ in your site’s root is used (created if not already existing) for logging.
You can specify a path with the file that is relative to the site’s root.

<cms:paypal_processor debug='1' logfile='paypal.log' />
<cms:paypal_processor debug='1' logfile='couch/uploads/file/secure/paypal.log' />

In the last snippet we are saving the log file in a subfolder of Couch which has a .htaccess file protecting its contents from being directly downloaded.

Variables

PayPal provides values pertaining to the transaction being handled through the IPN. This tag makes available those values by setting variables for each. The following are the variables that give those values -

  • pp_item_name
  • pp_item_number
  • pp_quantity
  • pp_mc_gross
  • pp_mc_currency
  • pp_txn_id
  • pp_receiver_email
  • pp_payer_email
  • pp_first_name
  • pp_last_name
  • pp_payer_business_name

Once this tag verifies that the transaction is valid, it sets an additional variable to notify this -

  • k_paypal_success

Apart from this variable, all the variables of the page representing the item being sold, which are normally available in the page’s page-view, are also made available.

If the transaction is deemed invalid, the following variable is set to notify this -

  • k_paypal_error