E-xact Knowledge Base

HOWTO: Integrate Hosted Checkout with osCommerce

  1. Download and rename the file attached to this article as authorizenet_sim.php
  2. Use the renamed file from step 2 to replace this file: ./catalog/includes/modules/payment/authorizenet_sim.php (in your osCommerce installation) 
  3. Log in to your osCommerce administration panel
  4. Click on Modules on the left menu
  5. Select the "Authorize.net SIM (Payment Form)" module
  6. Install the module (if this has not been done previously)
  7. Configure as in the screenshot below
  8. Press update to complete the configuration
oscommerce-authnet.png

Note:
  • There is no Silent Post handler in the osCommerce source code so this receipting option is not available to customers using Hosted Checkout and an OsCommerce shopping cart. Developers would need to build a customized handler to use this feature or use a different method (i.e. Relay Response or Receipt Link).
  •   Ensure the Relay Response Signature (x_MD5_Hash or x_SHA1_Hash) value in the returned transaction result is in uppercase
Default Hosted Receipt

Shopping Cart

  1. Using a text editor open, "[installation root]/catalog/includes/modules/payment/authorizenet_cc_sim.php"
  2. Find the line: var $exact_mode;
  3. Change it to: var $exact_mode = self::hosted;
HCO Payment Page

  1. Set "Return Link" method (for receipt page) to POST
  2. Set "Receipt Link URL" to the checkout process URL
Sample Request Parameters

x_fp_sequence = 961
x_fp_timestamp = 1271879002
x_fp_hash = 6adf60472153092e9a870180a810ba0f
x_login = WSP-E-XAC-95-38
x_version = 3.1
x_show_form = PAYMENT_FORM
x_first_name = John
x_last_name = Oscommerce
x_company =
x_address = 1234 Main Street
x_city = Vancouver
x_state = British Columbia
x_zip = V5R3G4
x_country = Canada
x_phone = 604-123-4567
x_cust_id = 2
x_customer_ip = 10.70.20.106
x_email = llin@e-xact.com
x_description = osCommerce Test Store
x_amount = 44.99
x_currency_code = CAD
x_method = CC
x_type = AUTH_ONLY
x_ship_to_first_name = John
x_ship_to_last_name = Oscommerce
x_ship_to_company =
x_ship_to_address = 1234 Main Street
x_ship_to_city = Vancouver
x_ship_to_state = British Columbia
x_ship_to_zip = V5R3G4
x_ship_to_country = Canada
x_test_request = TRUE
x_line_item = 1<|>Microsoft IntelliMouse Pro<|>Microsoft IntelliMouse Pro<|>1<|>39.99<|>NO
x_freight = 5.00
osCsid = utvsvsc33hifs0kk2gmjgko8t4


Relay Response

The option, "Pass HTTP Redirects to the Customer's Browser" can be enabled since the osCommerce checkout process handler returns a redirect (HTTP Status 302) to the destination page. The destination page would be, "[base URL]/catalog/checkout_success.php" for a successful payment or, "[base URL]/catalog/checkout_payment.php" for a failed payment.

Shopping Cart

  1. Using a text editor open, "[installation root]/catalog/includes/modules/payment/authorizenet_cc_sim.php"
  2. Find the line: var $exact_mode;
  3. Change it to: var $exact_mode = self::relay;
The payment request will include:
  •     x_relay_response set to TRUE
  •     x_relay_url set to checkout process URL
HCO Payment Page
  1. Check "Allow Relay Response"
  2. Set "Relay Response URL" to the checkout process URL
Sample Request Parameters

x_fp_sequence = 897
x_fp_timestamp = 1271880313
x_fp_hash = eafa4a5abae131f12808fd4afd06a827
x_login = WSP-E-XAC-95-38
x_version = 3.1
x_show_form = PAYMENT_FORM
x_first_name = John
x_last_name = Oscommerce
x_company =
x_address = 1234 Main Street
x_city = Vancouver
x_state = British Columbia
x_zip = V5R3G4
x_country = Canada
x_phone = 604-123-4567
x_cust_id = 2
x_customer_ip = 10.70.20.106
x_email = llin@e-xact.com
x_description = osCommerce Test Store
x_amount = 34.99
x_currency_code = CAD
x_method = CC
x_type = AUTH_CAPTURE
x_relay_response = TRUE
x_relay_url = http://10.70.20.123/oscommerce/catalog/checkout_process.php
x_ship_to_first_name = John
x_ship_to_last_name = Oscommerce
x_ship_to_company =
x_ship_to_address = 1234 Main Street
x_ship_to_city = Vancouver
x_ship_to_state = British Columbia
x_ship_to_zip = V5R3G4
x_ship_to_country = Canada
x_test_request = TRUE
x_line_item = 1<|>Courage Under Fire<|>Courage Under Fire<|>1<|>29.99<|>NO
x_freight = 5.00
osCsid = utvsvsc33hifs0kk2gmjgko8t4

REDI

Shopping Cart
  1. Using a text editor open, "[installation root]/catalog/includes/modules/payment/authorizenet_cc_sim.php"
  2. Find the line: var $exact_mode;
  3. Change it to: var $exact_mode = self::redir;
HCO Payment Page
  1. Set "Return Link" method (for receipt page) to REDI
  2. Set "Receipt Link URL" to the checkout process URL
  3. Set "Maximum Number of Payment Attempts" to 1 (recommended)
Sample Request Parameters

x_fp_sequence = 32
x_fp_timestamp = 1271880821
x_fp_hash = a57a7e16c36200e92dfc5fa45e141a44
x_login = WSP-E-XAC-95-38
x_version = 3.1
x_show_form = PAYMENT_FORM
x_first_name = John
x_last_name = Oscommerce
x_company =
x_address = 1234 Main Street
x_city = Vancouver
x_state = British Columbia
x_zip = V5R3G4
x_country = Canada
x_phone = 604-123-4567
x_cust_id = 2
x_customer_ip = 10.70.20.106
x_email = llin@e-xact.com
x_description = osCommerce Test Store
x_amount = 504.99
x_currency_code = CAD
x_method = CC
x_type = AUTH_CAPTURE
x_ship_to_first_name = John
x_ship_to_last_name = Oscommerce
x_ship_to_company =
x_ship_to_address = 1234 Main Street
x_ship_to_city = Vancouver
x_ship_to_state = British Columbia
x_ship_to_zip = V5R3G4
x_ship_to_country = Canada
x_test_request = TRUE
x_line_item = 1<|>Hewlett Packard LaserJet 1100Xi<|>Hewlett Packard LaserJet 1100Xi<|>1<|>499.99<|>NO
x_freight = 5.00
osCsid = utvsvsc33hifs0kk2gmjgko8t4



Article Details

Last Updated
13th of July, 2010

Would you like to...

Print this page Print this page

Email this page Email this page

Post a comment Post a comment

Subscribe me

Add to favorites Add to favorites

Remove Highlighting Remove Highlighting

Edit this Article

Quick Edit

Export to PDF

User Opinions (0 votes)

No users have voted.

How would you rate this answer?



Thank you for rating this answer.

Continue