Difference between revisions of "NATS4 Process Gateway Cross Sales Outside NATS"

From TMM Wiki
Jump to navigationJump to search
Line 31: Line 31:
 
== Sending Cross-Sell Data ==
 
== Sending Cross-Sell Data ==
 
You must send all of the following information to http://[[ct#Domain|domain]]/signup/process_gateway.php using a HTTP GET or POST.
 
You must send all of the following information to http://[[ct#Domain|domain]]/signup/process_gateway.php using a HTTP GET or POST.
* xs_nats: the ref code from ''xsells.php.''  This identifies the affiliate sending the cross sale and the cross sale id used.
+
* xs_nats: the ref code from ''http://[[ct#Domain|domain]]/internal.php?page=xsells.''  This identifies the affiliate sending the cross sale and the cross sale id used.
 
* username: the new [[Common Terms#Member|member's]] username. If this username is not unique on the receiving site, a new random username will be generated.
 
* username: the new [[Common Terms#Member|member's]] username. If this username is not unique on the receiving site, a new random username will be generated.
 
* password: the new member's password.
 
* password: the new member's password.

Revision as of 14:54, 23 June 2010

NATS 4
Members Admin
The Members Admin
View Member Details
Add Member
MySQL Auth
Mod Authn DB
Multisite Access
Member Logging
Member Password Retrieval
OpenID Connect
Mod Auth OpenIDC
ID Numbers
Upsells Admin
The Upsells Admin
Configuring Cross Sells
Configuring Upsells
Cross Sell Supported Billers
Upsell Supported Billers
Process Gateway Cross Sales Outside NATS
Cross Sells: A to Z
Upsells: A to Z
Upsell Plus
Setting Rules

If you want to send or receive cross-sells from one NATS program to another NATS program, please see the NATS4 Cross Sells Admin article. If you want to send or receive cross sells from something besides NATS to NATS, please read the following instructions.

Receiving Cross-Sell Data

To receive cross-sells, you must enter the IP address of the server that is sending the cross-sale into the $config['GATEWAY_ALLOWED_IPS'] configuration array in your NATS includes/config.php file. For example:

$config['GATEWAY_ALLOWED_IPS'] = Array(
'0' => '111.111.111.111',
'1' => '222.222.222.222',
'2' => '333.333.333.333'
);
$config['GATEWAY_DIRECT_ALLOWED_IPS'] = Array(
'0' => '111.111.111.111',
'1' => '222.222.222.222',
'2' => '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.

You must also enable the $config['ALLOW_<biller>_PROCESS_GATEWAY'] configuration variable for each gateway biller you want to support. Replace biller with the gateway biller's shortname in all capital letters. For example, to enable incoming Netbilling cross sells, add the following line to your includes/config.php file:

$config['ALLOW_NETBILLING_PROCESS_GATEWAY'] = 1;

Sending Cross-Sell Data

You must send all of the following information to http://domain/signup/process_gateway.php using a HTTP GET or POST.

  • xs_nats: the ref code from http://domain/internal.php?page=xsells. This identifies the affiliate sending the cross sale and the cross sale id used.
  • username: the new member's username. If this username is not unique on the receiving site, a new random username will be generated.
  • password: the new member's password.
  • email: the new member's email.
  • cc: the credit card number
  • cvv: the Card Verification Value

Depending on the Merchant's Biller setup, the following fields may also be needed:

  • enddate_year (4 digit year, ex: 2011)
  • enddate_month (2 digit month, ex: 12 for December)
  • ip (the ip of the member, ex: 123.456.789.012)
  • address1
  • city
  • state (two letter code)

An example HTTP GET:

http://example.com/signup/process_gateway.php?xs_nats=ref_code&username=example&password=example&email=example@example.com&cc=1234567890&cvv=123

If the recipient uses HTTPS, replace http with https.

You may optionally send any of the following information about the member by appending it to the HTTP GET or POST:

  • firstname
  • lastname
  • address1
  • address2
  • city
  • state
  • zip
  • country (2 Letter ISO code)
  • shipping_firstname
  • shipping_lastname
  • shipping_address1
  • shipping_address2
  • shipping_zip
  • shipping_city
  • shipping_country
  • shipping_state

Return Values

After NATS processes the information you've sent, it returns two lines. (Note: the lines are sent as text; in your web-browser, they may appear as one line.) The first line is either SALE OK or SALE DECLINED. After a SALE OK, the second line will be the new member's I.D. number. After a SALE DECLINED, the second line will describe the error. There are currently 17 possible error messages; the following two are most common:

  • UNSUPPORTED REQUEST
    • $config['ALLOW_biller_PROCESS_GATEWAY'] (see above) is either not setup or not setup correctly
  • NOT ALLOWED IP
    • The sending program's IP address is not in the $config['GATEWAY_SECURE_IPS'] configuration array