Extended Sales
Please note: the following article describes an add-on feature to NATS4. If you want this feature, please request it and we'll install it on your system.
The Extended Sales module lets you pay affiliates for events outside the NATS system. It enables, for example, pay per lead programs. You track outside events with your reporting software and direct that software to send NATS information about the outsides events. NATS processes the incoming information and uses it to pay the referring affiliate.
Setup
Before you can set up extended sales, Too Much Media must install the Extended Sales Module on your system.
Configuration File
You must add the IP address of any computer that runs your reporting software to the NATS configuration file, includes/config.php. Make each address an element in the $config['EXTENDED_SECURE_IPS'] array; for example:
$config['EXTENDED_SECURE_IPS'] = Array( '0' => '111.111.111.111', '1' => '222.222.222.222', '3' => '333.333.333.333' );
Incorrectly formatting this line will break your NATS. Each entry should be a single IP address -- ranges, masks, and globs are not supported. Place a comma between each entry. NATS won't accept extended sales data from computers with IP addresses that aren't in this configuration array.
Billers Admin
Go to Billers Admin, click the Billers drop-down, select "Extended Sales" and click Add. Give the biller a shortname. You may add multiple Extended Sales billers.
Sites Admin
Go to Sites Admin, create or edit a tour, go to the Add Extended Site Details section, and enter the extended sales biller's shortname you created above. You may optionally associate extended sales to this site with a specific join option; on the Edit Tour page, add or edit a join option, go to the Extended Option Codes section, and enter the extended sales biller's shortname.
Sending Extended Sales Postbacks
Your reporting software should send information about extended sales to the following URL:
- http://domain/signup/process_extended.php
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.
All Actions
Arguments that are always required:
- extend_id: the extended sales biller shortname
- site_id: the site I.D.
- action: SALE, CREDIT, or CHARGEBACK (capitals required)
SALE
To pay affiliates for a new extended sale, set the action parameter (described above) to SALE. Sales have the following extra parameters.
Required argument for SALE:
- nats: The affiliate's natscode
Optional arguments for SALE:
- username (NATS randomly generates it if you don't send it)
- password (NATS randomly generates if if you don't send it)
- option_id: a join option I.D. (you can only use this if you setup a join option in the Sites Admin instructions above)
- transid: your reporting software's arbitrary transaction identifier
- extended_type: the id of the extended type setup in the config file by Too Much Media techs
- amount: the amount of the extended sale (used in revenue share programs)
- currency (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
To penalize affiliates for extended sales that failed, set the action parameter (described above) to CREDIT or CHARGEBACK. Credits and chargebacks have the following extra parameters:
Required argument for CREDIT or CHARGEBACK:
- transid: must match the original SALE's transid
Optional arguments for CREDIT or CHARGEBACK:
- amount
- currency (set to the NATS base currency if you don't send it)
Examples
A sale that includes a username, password, and transaction identifier sent using HTTP GET:
- http://example.com/signup/process_extended.php?extend_id=my_shortname&site_id=123&action=SALE&nats=xxxx&username&transid=my_identifier
A credit reversing the above transaction:
- http://example.com/signup/process_extended.php?extend_id=my_shortname&site_id=123&action=CREDIT&transid=my_identifier