The Extended Sales module is an add-on to NATS4 that lets you track events that occur outside the NATS system. For example, you can enable free join tracking using the Extended Sales module.
To begin, you must first add the IP address of any computer that runs your reporting software to the NATS configuration file: includes/config.php. In the configuration file, make each address an element in the $config['EXTENDED_ALLOWED_IPS'] array. For example:
$config['EXTENDED_ALLOWED_IPS'] = Array( '0' => '184.108.40.206', '1' => '220.127.116.11', '3' => '333.333.333.333' );
Formatting this line incorrectly will cause your NATS to break-- thus you should ensure that each entry is a single IP address: ranges, masks, and globs are not supported by this module. Also, make sure that you have placed a comma between each entry. NATS will not accept extended sales data from computers with IP addresses that are not defined in this configuration array.
To begin configuring your Extended Sales module, go to the Billers Admin in your NATS install. Go to the "Setup New Biller" drop-down menu, select "Extended Sales," and click Add. Give the biller a shortname to distinguish them, as NATS allows you to add multiple Extended Sales billers.
Go to the Sites Admin and create a new tour, or edit an already existing one. On the Edit Tour page, scroll down to the "Add Extended Site Details" section and enter the extended sales biller's shortname that you created above.
You can also optionally associate extended sales to this particular site by using a specific join option. To do so, go to the Edit Tour page and add or edit a join option. On the Join Options page, scroll down to the Extended Option Codes section and enter the extended sales biller's shortname that you previously specified.
If you want to set up payouts to affiliates, go to the Programs Admin and create a new program. On the Edit Program page, select the "Extended Sales Program" for the program type.
Sending Extended Sales Postbacks
If properly configured, your reporting software should send information about any extended sales to the following URL:
Simply replace domain with your site's domain.
Your reporting software needs to send the following information to the above URL in a HTTP GET or POST:
Arguments that are always required:
- extended_id: the extended sales biller's shortname
- site_id: the code you placed in the site setup for this extended biller
- action: SALE, CREDIT, or CHARGEBACK (this is case-sensitive, capitals are required) (defaults to SALE if not provided)
To pay your affiliates for a new extended sale, set the action parameter (described above) to "SALE". Sales will have the following extra parameters:
Required argument for SALE:
- nats: The affiliate's natscode
Optional arguments for SALE:
- username (NATS will randomly generate this if you don't send it)
- password (NATS will randomly generate this if you don't send it)
- option_id: the code you setup for the specific join option in the Sites Admin
- transid: your reporting software's arbitrary transaction identifier
- extended_type: the id of the extended type set up in the config file by Too Much Media techs
- amount: the amount of the extended sale (used in revenue share programs)
- currency: the currency used for the transaction (automatically set to the NATS base currency if you don't send it)
- email: the consumer's email address
- ip: the consumer's IP address
CREDIT or CHARGEBACK
If you would like to penalize affiliates for extended sales that have failed or not gone through, set the action parameter (described above) to CREDIT or CHARGEBACK to account for these. Credits and chargebacks contain the following extra parameters:
Required argument for CREDIT or CHARGEBACK:
- transid: must match the original SALE's transid
Optional arguments for CREDIT or CHARGEBACK:
- currency (set to the NATS base currency if you don't send it)
A sale that includes a username, password, and transaction identifier sent using HTTP GET:
A credit reversing the above transaction: