Services
Set-up Instructions : Advanced Level Linking
Our most challenging level of linking for people who want total control.
The customer remains on your website.
Please contact Swreg prior to starting development to confirm you are eligible to use the feature. In addition, study the Intermediate Level as you will need to understand the concepts before proceeding here. This especially applies to multiple products per order.
The Advanced Level principle is that you collect all the order information on your own secure server, you then POST the information to our program called https://usd.swreg.org/cgi-bin/c.cgi that returns a string containing a result code, a currency, type of purchase (i.e., realtime, by fax, by phone, etc), an order number, and a value in your own default currency (See below table for further details). On receipt of that string you will produce a web page for your customer incorporating template web pages stored on our website (you must link to them rather than store them locally as they can change from time to time). Meanwhile we will operate exactly as Basic and Advanced levels in sending out emails, storing transactions, etc.
Result parameters Key Value Description result Integer Values/description available below. ordernumber Integer Swreg order number. payment_method Integer Swreg Payment Method id (Definitions available at tester.htm). soft_descriptor Url escaped string For payment method 1 calls. Will return soft descriptor that will appear on credit card statement. currency Url escaped string Native currency to server/account. amount Float Amount charged in server/account currency. txn_currency Url escaped string Transaction currency credit card was charged. txn_amount Float Amount charged in transaction currency. Parameters that may be returned by check payment processing BANKACCOUNTNUMBER String Payment processor customData BANKNAME String Payment processor customData BRANCHCODE String Payment processor customData CHEQUEACCOUNTHOLDER String Payment processor customData COUNTRYDESCRIPTION String Payment processor customData PAYMENTREFERENCE String Payment processor customData POSTALADDRESS1 String Payment processor customData POSTALADDRESS2 String Payment processor customData POSTALADDRESS3 String Payment processor customData SWIFTCODE String Payment processor customData Parameters that may be returned by electronic/wire payment processing ACCOUNTHOLDER String Payment processor customData ADDITIONALBANKINFO String Payment processor customData ADDITIONALREFERENCE String Payment processor customData ATTEMPTID String Payment processor customData BANKACCOUNTNUMBER String Payment processor customData BANKNAME String Payment processor customData BANK_SORT_CODE String Payment processor customData BRANCHCODE String Payment processor customData CITY String Payment processor customData COMPLETE_FORMATED_ACCOUNT String Payment processor customData COUNTRYDESCRIPTION String Payment processor customData EFFORTID String Payment processor customData EXTERNALREFERENCE String Payment processor customData IBAN String Payment processor customData MERCHANTID String Payment processor customData ORDERID String Payment processor customData PAYMENTREFERENCE String Payment processor customData SPECIALID String Payment processor customData STATUSDATE String Payment processor customData STATUSID String Payment processor customData SWIFTCODE String Payment processor customData midCategory String Payment processor customData reference_number String Payment processor customData Active until October 1st, 2008 (Please discontinue using before this date) USD Float Amount charged in server/account currency. GBP Float Amount charged in server/account currency. EUR Float Amount charged in server/account currency. CAD Float Amount charged in server/account currency. ??? Float Amount charged but server/account currency unknown.
Please go to a live working site now at http://www.evidence-eliminator.com - this is from our second busiest vendor, Andy Churchill, to whom we are indebted for assistance in developing this system, and is working in anger right now. Feel free to do a test using the "By Phone" or "By Fax" orders but make it clear in your address it is a test purchase so Evidence Eliminator can ignore them in the Pending Orders report. (Of course you could always buy a copy)!! Click here to download Andy's PERL source code for adaption by yourself.
Chris from Cinarsoft has kindly made an adaption to work with PHP. Click here for source code. His website is running it at http://www.cinarsoft.com/
Graham from GPP Software has provided a solution for .NET. Please click here to download. It is written in C# .NET, conversion to VB.NET would be very simple.
Please do not ask these two kind folks to support their code.
You may wish to lift the source code for the list of countries we sell to from https://usd.swreg.org/cgi-bin/s.cgi?s=43387&p=433871&v=0&d=0&q=1&t=
Now look at the web page at http://swreg.org/tester.htm - you will see a test page listing all the variables we need - you should study the code on this page to see how it works. All variables are required to be POSTed but a list of variables that must have data is shown with an asterisk. All variables not required to have a value must still be sent as a null value (this can simply be an = sign like "x=")
What happens when you submit our sample page is that it sends a string to our program at https://usd.swreg.org/cgi-bin/c.cgi
If the order is successful you will get back a zero (0). If the order fails, a non-zero value with be returned. Possible return values are available here.
RULES:
When not a realtime credit card order you need to supply the following web pages in a frame with your pricing confirmation at the top and the following information at the bottom. The information at the top must always quote the Order Number prominently - this is one of the returned values from our server.
On a multiple product order you only enter the general variables (name, address, etc) once. All transaction variables can be entered just like the Intermediate method described above.
You will need a GetEnv variable to identify the customer's IP - getenv("REMOTE_ADDR") - or try http://www.swreg.org/cgi-bin/whoami.cgi to see how it can work.
Currencies: The best practice is to display and charge your customer in their native currency. You can convert USD to other world currencies by calling http://usd.swreg.org/cgi-bin/rate-calculator.cgi?currency=GBP. Where GBP is the international 3 letter currency code. This will return the conversion rate we are using at that moment so you will need to multiply USD by that rate to get an approximation of what will appear on the customer's credit card. Then you will pass the currency to charge the customer with the c= parameter. We will return the amount and currency of the charge. There are currencies that we do not have exchange rates, the rate calculator will return 0.000000 in these cases.
For a list of supported currencies please visit :-
https://usd.swreg.org/cgi-bin/s.cgi?s=43387&p=433871&v=0&d=0&q=1&t=
MORE RULES:
Please keep an eye on these rules as they may change form time to time until we have worked them all out from experience.
VAT Issues
You must assume that the local VAT rate will be added to any EU shipping address order - that includes any $3 manual processing fees. You can call a cgi called vnv.cgi to determine the VAT rate. There are some instructions at :-
Please list on the receipt as:
As part of the address you will need to collect the customer's VAT number. It must be in the format of two letters and a series of numbers (max 15 characters) i.e. GB445812740 in that format. If the customer enters a VAT number, you must pass it to c.cgi in the vn=<number> parameter. You can use the vnv.cgi module to validate the VAT number is in an acceptable format.
If this field is completed, and the customer is not in the EU please make the following information available on the receipt page - and possibly prior to order completion if you feel it may help.
Sold by:
SWREG Inc.
9625 West 76th Street
Eden Prairie, MN 55344
USA
Our VAT Reg. # EU826011714
Your VAT #: FR123456789
"If you are a company within the European Union and did not provide or do not have a VAT number, you can obtain the VAT refund from your taxing authority provided you are VAT exempt. We are unable to refund the VAT tax from a completed order."
A list of country names we accept is available by grabbing the from the following URL :-
https://usd.swreg.org/cgi-bin/s.cgi?s=43387&p=433871&v=0&d=0&q=1&t=
Additional Information
You can also interrogate https://usd.swreg.org/cgi-bin/token2order.pl with three arguments sent as a post (You cannot send as a GET): shop_id (your store number), token_id, and password. The password is specified by you through your author details via the new "Automated calls" password field.
Results are sent as plain text. Each result name/value pair is on its own line: Name/value pairs: StatusCode StatusMessage TokenId OrderId ErrorCode
<form>
<select onmousewheel="return(false);">
<option value="1">option 1</option>
<option value="2">option 2</option>
<option value="3">option 3</option>
<option value="4">option 4</option>
<option value="5">option 5</option>
</select>
</form>l