Difference between revisions of "NATS4 Process Gateway Cross Sales Outside NATS"
(14 intermediate revisions by 5 users not shown) | |||
Line 3: | Line 3: | ||
}} | }} | ||
− | If you want to send or receive [[ct#Cross Sell|cross-sells]] from one NATS program to another NATS program, please see the [[ | + | <font color="red">'''WARNING'''</font> It is important to use POST requests only, using GET may cause sensitive data to be logged by your webserver. |
+ | |||
+ | |||
+ | If you want to send or receive [[ct#Cross Sell|cross-sells]] from one NATS [[Ct#Program|program]] to another NATS program, please see the [[Upsells 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 == | == 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 <tt>$config['GATEWAY_ALLOWED_IPS']</tt> configuration array in your NATS ''includes/config.php'' file. For example: | + | To receive [[Ct#Cross Sell|cross-sells]], you must enter the IP address of the server that is sending the cross-sale into the <tt>$config['GATEWAY_ALLOWED_IPS']</tt> configuration array in your NATS ''includes/config.php'' file. For example: |
<pre> | <pre> | ||
Line 28: | Line 31: | ||
$config['ALLOW_NETBILLING_PROCESS_GATEWAY'] = 1; | $config['ALLOW_NETBILLING_PROCESS_GATEWAY'] = 1; | ||
</pre> | </pre> | ||
+ | |||
+ | Additionally, you must set [[NATS]] to allow new [[Ct#Member|members]] to be created by posts from [[Ct#Biller|billers]] to properly receive a [[Ct#Cross Sell|cross sale]]. This setting will be turned off by default in your [[NATS]] install. To enable creation of new members by [[Ct#Biller|biller]] posts, go to the [[NATS4 Configuration Admin|Configuration Admin]] and select the "Billers" section from the "Current Section" drop-down menu. Under specific biller settings will be the option ''ALLOW_CREATE_NEW_MEMBER_XXX'', with "XXX" being the name of the [[Ct#Biller|biller]] in question. Check the specified biller you would like to allow, and click Store Changes. That biller will now be able to create new [[Ct#Member|members]] in your database through posts. | ||
+ | |||
+ | [[File:Allow create new member.PNG|450px|Biller Settings For Cross Sales]] | ||
+ | |||
+ | Once you have completed the above steps, you will be able to receive gateway cross sales from outside [[NATS]]. | ||
== 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 | + | You must send all of the following information to http://[[ct#Domain|domain]]/signup/process_gateway.php using HTTP POST. |
− | * xs_nats: the ref code from '' | + | * xs_nats: the ref code from ''http://[[ct#Domain|domain]]/internal.php?page=xsells.'' This identifies the [[Ct#Affiliate|affiliate]] sending the [[Ct#Cross Sell|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 [[Ct#Member|member]]'s password. |
− | * email: the new member's email. | + | * email: the new [[Ct#Member|member]]'s email. |
* cc: the credit card number | * cc: the credit card number | ||
* cvv: the [http://en.wikipedia.org/wiki/Card_Verification_Value Card Verification Value] | * cvv: the [http://en.wikipedia.org/wiki/Card_Verification_Value Card Verification Value] | ||
Line 45: | Line 54: | ||
* city | * city | ||
* state (two letter code) | * state (two letter code) | ||
− | An example HTTP | + | An example HTTP POST: |
<pre> | <pre> | ||
− | http://example.com/signup/process_gateway.php | + | http://example.com/signup/process_gateway.php |
+ | postxs_nats=refcode&postusername=example&postpassword=example... | ||
</pre> | </pre> | ||
If the recipient uses HTTPS, replace ''http'' with ''https''. | 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 | + | You may optionally send any of the following information about the [[Ct#Member|member]] by appending it to the HTTP POST: |
* firstname | * firstname | ||
Line 73: | Line 83: | ||
=== Return Values === | === 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: | + | 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 | * UNSUPPORTED REQUEST | ||
** <tt>$config['ALLOW_biller_PROCESS_GATEWAY']</tt> (see above) is either not setup or not setup correctly | ** <tt>$config['ALLOW_biller_PROCESS_GATEWAY']</tt> (see above) is either not setup or not setup correctly | ||
* NOT ALLOWED IP | * NOT ALLOWED IP | ||
− | ** The sending program's IP address is not in the <tt>$config[' | + | ** The sending program's IP address is not in the <tt>$config['GATEWAY_ALLOWED_IPS']</tt> configuration array |
+ | |||
+ | [[Category:NATS4 Upsells]] |
Latest revision as of 13:54, 26 January 2018
WARNING It is important to use POST requests only, using GET may cause sensitive data to be logged by your webserver.
If you want to send or receive cross-sells from one NATS program to another NATS program, please see the Upsells 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;
Additionally, you must set NATS to allow new members to be created by posts from billers to properly receive a cross sale. This setting will be turned off by default in your NATS install. To enable creation of new members by biller posts, go to the Configuration Admin and select the "Billers" section from the "Current Section" drop-down menu. Under specific biller settings will be the option ALLOW_CREATE_NEW_MEMBER_XXX, with "XXX" being the name of the biller in question. Check the specified biller you would like to allow, and click Store Changes. That biller will now be able to create new members in your database through posts.
Once you have completed the above steps, you will be able to receive gateway cross sales from outside NATS.
Sending Cross-Sell Data
You must send all of the following information to http://domain/signup/process_gateway.php using HTTP 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 POST:
http://example.com/signup/process_gateway.php postxs_nats=refcode&postusername=example&postpassword=example...
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 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_ALLOWED_IPS'] configuration array