Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PsiGate XML Gateway


Recommended Posts

I'm having the same problem where PSIGate is charging a different amount that osCommerce is charging. However this problem only seems to be happening when there is shipping being charged. If I remove the shipping charges (or if I purchase enough to have free shipping) the charges are the same in osCommerce and PSIGate.

 

This seems to be happening with the tax on the shipping.

Link to comment
Share on other sites

  • 1 month later...
  • Replies 73
  • Created
  • Last Reply

Top Posters In This Topic


The credit card information and expiry date is not being passed correctly from OScommerce to PSI

It's getting to them blank.. I've enabled debugging on checkout_confirmation.php. I'm in production using the test mode with test CC 4111111111111 and of course the test user/pass from PSI.

 

cart => Object id #1 - shoppingCart Object ( [contents] => Array ( [206] => Array ( [qty] => 1 ) [202] => Array ( [qty] => 1 ) ) [total] => 100 [weight] => 4 [cartID] => [content_type] => physical )

language => english - english

languages_id => 1 - 1

currency => CAD - CAD

navigation => Object id #2 - navigationHistory Object ( [path] => Array ( [0] => Array (


=> checkout_confirmation.php [mode] => NONSSL [get] => Array ( [paynow] => )

customer_id => 22 - 22

customer_default_address_id => 22 - 22

customer_first_name => Rob - Rob

customer_country_id => 38 - 38

customer_zone_id => 74 - 74

sendto => 22 - 22

billto => 22 - 22

cartID => -

action => -

shipping => -

psigate_xml_cc_owner => -

psigate_xml_cc_number => -

psigate_xml_cc_expires_month => -

psigate_xml_cc_expires_year => -

psigate_xml_cc_cvv => -

preview_x => -

preview_y => -

comments => -

payment => psigate_xml - psigate_xml

 

On the confirmation page, the payment section shows as:

 

Payment Information

 

 

Credit Card Owner:

Credit Card Number:

Credit Card Expiry Date: December, 2019

 

 

I've enabled debug mode in the PSI module, and when I click on Confirm Order..

 

I get

 

teststorepsigate1234120.30CC01R22Rob Rob<my personal info>OsCommerce XML Interface 1.0216.48.165.90 Sat Nov 11 10:16:35 EST 2006 SALE ERROR N:ERROR PSI-0103:The Credit Card Number is invalid. 0.00 0.00 0.00 0.00 CC 0000000000000000

 

 

Our OScommerce is using Fast Easy Checkout ( FEC 2.3 )

 

the site is http://www.truewaysupplements.com

 

you can create a free account and check it out.

Link to comment
Share on other sites

Hello everyone, just installed this great contribution and it worked first time no problems. Thanks to all who put in such a nice effort.

 

I am using database storage of responses options and on testing found out that it was not storing customer_id and osc_order_id. On further investigation i found that for getting the customer_id in the database all i had to do was change

 

File: catalog/includes/modules/payment/psigate_xml.php	line no: 268
tep_db_query("insert into " . TABLE_PSIGATE_XML . " (id, customer_id, osc_order_id, psi_order_id, transaction_time, approved, return_code, error_message, trans_ref, cvv_result, avs_result, card_auth, card_ref, ip_result, ip_country, ip_region, ip_city) values ('', '" . $HTTP_SESSION_VARS['customer_id'] . "', '', '" . $Psi_OrderID . "', '" . $Psi_TransTime . "', '" . $Psi_Approved . "', '" . $Psi_ReturnCode . "', '" . $Psi_ErrMsg . "', '" . $Psi_RefNumber . "', '" . $Psi_CardIDResult . "', '" . $Psi_AVSResult . "', '" . $Psi_CardAuthNumber . "', '" . $Psi_CardRefNumber . "', '" . $Psi_IPResult . "', '" . $Psi_IPCountry . "', '" . $Psi_IPRegion . "', '" . $Psi_IPCity . "')");

Change : $HTTP_SESSION_VARS['customer_id'] 

to
		$_SESSION['customer_id']

 

For storing osc_order_id i guess when above line is excuted at that moment order_id is not available. Thats what i figured out and i might be wrong. A simple solution that worked for me is as follow:

File: catalog/includes/modules/payment/psigate_xml.php	

Replace LINE NO 20 with

  var $code, $title, $description, $enabled,$Psi_RefNumber; // added var $Psi_RefNumber


Find $Psi_IPCity = $psi->getTrxnIPCity(); line number 264

  After this line ADD

	   $this->Psi_RefNumber = $Psi_RefNumber; // Set $Psi_RefNumber


Find Function function after_process()  line 277
replace whole function 
function after_process() {
  return false;
 }


WITH

function after_process() {
  global $insert_id;
	  // update psigate xml table with order id
  if (MODULE_PAYMENT_PSIGATE_XML_STORE_DATA == 'True') {
		if(isset($this->Psi_RefNumber)){
			  $sql_data_array = array('osc_order_id' => $insert_id);
			  tep_db_perform(TABLE_PSIGATE_XML, $sql_data_array, 'update', "trans_ref='".$this->Psi_RefNumber."'");											
	  }
	}
  return true;
}

 

This worked for me, if you have a better way of doing it please share here. Thanks

 

I am planning to start work on developing admin view of information stored in psi xml database. If you are working or planning to work on it i would be glad to offer my time in doing so.

Link to comment
Share on other sites

Hi

 

We are in test mode and using teh test CC details. We are getting:

 

PSI-0013:Invalid SubTotal. - Your card has been declined. Please re-enter in your card information, try another card, or contact the store owner for assistance.

 

Any ideas? Other than the port issue?

 

Next time it would be really nice if you could post how you fixed it. This community thrives on sharing information, its 2 way street thats why its so successful.

 

I had the same problem and had to spend quite some time to figure out the problem and fix.

 

To Fix PSI-0013:Invalid SubTotal

 

This problem is due to comma being added if the subtotal is over 1000. Fix is simple

 

File: catalog/includes/modules/payment/psigate_xml.php

 

Replace Line: 201

$psi->setSubTotal(number_format($order->info['total'] * $currencies->get_value($currency), 2));

 

With

$psi->setSubTotal(number_format($order->info['total'] * $currencies->get_value($currency), 2,'.','')); //number_format($number, 2); fix for comma in subtotal field

 

I would consider this as a bug because its going to affect everyone. If someone is planning to release new files on contribution page could you please add this change in there. Thanks

Link to comment
Share on other sites

  • 2 weeks later...

HI,

 

 

I can enter the test credit card information fine in the payment details pages, then I click continue and I am brought to the order confirmation page, BUT when I confirm the order - it returns to the payment details page. no error messages. the decline is recorded in Psigate, but the customers don't get any decline message. btw, I tested with a real credit card, and everything was fine.

The ports are closed (those that were mentioned before), and my host is probably going to open it. don't know if there is any connection, but I'll report. Anyway, if you have any idea why there are no decline messages pls let me know (if I enter wrong CC it does give me an error message, so not sure what is going here).

 

I conntacted Psigate but they have no idea.

 

 

Thanks.

Link to comment
Share on other sites

Hello all,

 

I am having a problem where osCommerce is adding everything nicely but the PSI Gate XML payment module forgets to charge taxes on shipping, as described and discussed in this topic and also in this topic but without any posted solutions.

 

I would appreciate the solution if someone figured it out, or a hand in getting rid of the problem.

 

It seems to if I could only get line 201:

 

$psi->setSubTotal(number_format($order->info['total'] * $currencies->get_value($currency), 2));

 

to take the right total, the one that includes the taxes on shipping, I'd be set, but have no idea how. That line calls for the field "total" in "order" but the SQL DB name is "orders" and doesn't contain a field called "total"... shows that I don't get it...

 

Little help ?

 

Thanks !

Link to comment
Share on other sites

  • 2 weeks later...

I have been looking into the problem of the total value not being properly transferred to PsiGate correctly. This problem seems to be rooted in the place that the function "before_process" is called.

 

It seems that other payment modules (including the old psigate html submittal module) actually do the work for processing the transaction in the function "process_button". The new psigate_xml payment module uses "before_process" to do the work. It is at this point that each module determines the total value of the order.

 

The problem lies in when the order total modules are applied. At the point that process_button is called, the order total modules have been applied. However, the order total modules are applied between the functions "before_process" and "after_process".

 

I have created a workaround that passes the total from process_button to before_process on the POST request, based on the assumtion that the total value is correct at that point. I call this a workaround because I think a more appropriate solution would involve using the after_process function. Unfortunately I don't have time to figure out what effect this would have on the module.

 

I have also made a change that displays the error returned from psigate more prominently, as I came across this while troubleshooting.

 

If someone has the chance to incorporate this into a new release of the contribution, feel free to.

 

Here are the changes that I have made (all changes are to catalog/includes/modules/payment/psigate_xml.php):

 

replace the function process_button (line 169 in original file) with:

	function process_button() {
  global $HTTP_POST_VARS, $currency, $currencies, $order;
  // These are hidden fields on the checkout confirmation page
  $process_button_string = tep_draw_hidden_field('cc_owner', $HTTP_POST_VARS['psigate_xml_cc_owner']) .
						   tep_draw_hidden_field('cc_expires', $this->cc_expiry_month . substr($this->cc_expiry_year, -2)) .
						   tep_draw_hidden_field('cc_expires_month', $this->cc_expiry_month) .
						   tep_draw_hidden_field('cc_expires_year', substr($this->cc_expiry_year, -2)) .
						   tep_draw_hidden_field('cc_type', $this->cc_card_type) .
						   tep_draw_hidden_field('cc_num', $this->cc_card_number) .
						   tep_draw_hidden_field('cc_cvv', $HTTP_POST_VARS['psigate_xml_cc_cvv']) .
						   tep_draw_hidden_field('FullTotal', number_format($order->info['total'] * $currencies->get_value($currency), $currencies->currencies[$currency]['decimal_places'],'.',''));
  $process_button_string .= tep_draw_hidden_field(tep_session_name(), tep_session_id());
  return $process_button_string;
}

 

replace the line:

$psi->setSubTotal(number_format($order->info['total'] * $currencies->get_value($currency), 2,'.','')); //number_format($number, 2); fix for comma in subtotal field

(line 201 in original file) with:

$psi->setSubTotal( $HTTP_POST_VARS['FullTotal'] );

 

and finally, to fix the error message, replace line 273 (in the original file):

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . $Psi_ErrMsg . ' - ' . urlencode(MODULE_PAYMENT_PSIGATE_XML_TEXT_DECLINED_MESSAGE), 'SSL', true, false));

with:

tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_error=' . $this->code . '&error=' . $Psi_ErrMsg . ' - ' . urlencode(MODULE_PAYMENT_PSIGATE_XML_TEXT_DECLINED_MESSAGE), 'SSL', true, false));

Link to comment
Share on other sites

  • 4 weeks later...

Has anyone been getting an error message on their status bar (bottom left) when checkout_payment.php loads? When you click on this error it displays a little popup Windows message.

This one reads:

Error: Expected '}'

 

I believe the file that is the culprit is "modules\payment\psigate_xml.php".

It shows 35 occurences of the '{' but only 34 occurences of the '}'

 

Could this be causing problems?

 

I ask because, I have been having intermitent problems, where clients are getting bounced back to the payment page after clicking to confirm their orders.....

 

Peace

Edited by Luke99

SS:20030317

Link to comment
Share on other sites

I have what is proving to be a bit of a unique problem using PSIgate's XML module. I have been forced to used their "old" HTML module since my OScommerce installation seems to be inserting a , (comma) in the numeric value for amounts greater than $999.99.

 

When OSC does this the comma interferes with PSIgate's ability to properly process the credit card payment as evidently a comma is an invalid character.

 

Long story short... I need to find the root part of the code within OSC that tells it to insert a comma in amounts greater than $999.99 (i.e. $1,234.56 as opposed to $1234.56).

 

Help would be appreciated if this is even possible.

 

Anthony

Link to comment
Share on other sites

  • 2 weeks later...

Introducing: a brand new problem with PSI Gates XML payment module for OC.

 

We have two installations of OsCommerce: one for Canadian shoppers and one for US and International shoppers. In our US-International shopping cart we offer the prices in Euro and in USD using OsCommerce built-in currency system since we frequently get sales from the EU.

 

With the previous PSI Gate payment module (pre-XML) all was well, the price would get converted to USD using the OsCommerce exchange rate (which we would keep up to date) and then be passed to PSI Gate. The CC would get charged the correct USD equivalent of the Euro price.

 

With the current XML PSI Gate payment module however the price arrives unconverted to PSI Gate but in USD, so an item at 100Euro would end up being charged as 100USD on the CC.

 

Looking at the now infamous line 201 of psigate_xml.php:

 

$psi->setSubTotal(number_format($order->info['total'] * $currencies->get_value($currency), 2));

 

or

 

$psi->setSubTotal(number_format($order->info['total'] * $currencies->get_value($currency), 2,'.',''));

 

with the comma thousands separator fix (This is not our Canadian store so I don't have to involve the fix for missing taxes on shipping which has a different line 201).

 

It seems to me there is some attempt at currency conversion.

 

Anyone has any idea what's wrong ?

 

Thanks in advance.

Link to comment
Share on other sites

There's a fix for this. Check the contributions....

 

Luke,

 

That fix is for the XML module which I am NOT using. For those who are unaware of the XML comma fix, it's at the bottom of this post.

 

I've tried to implement the fix in the regular (non-XML) payment module but the closest line I could find to the one in the fix was this...

 

 

tep_draw_hidden_field('FullTotal', number_format($order->info['total'] * $currencies->get_value(MODULE_PAYMENT_PSIGATE_CURRENCY), $currencies->currencies[MODULE_PAYMENT_PSIGATE_CURRENCY]['decimal_places'])) .

 

 

Given the XML fix below, how would I apply the fix to the line above (if that line is indeed the appropriate line in the non-XML module)?

 

Thanks,

Anthony

 

 

-----------------------------------------

 

To Fix PSI-0013:Invalid SubTotal

 

This problem is due to comma being added if the subtotal is over 1000. Fix is simple

 

File: catalog/includes/modules/payment/psigate_xml.php

 

Replace Line: 201

$psi->setSubTotal(number_format($order->info['total'] * $currencies->get_value($currency), 2));

With

$psi->setSubTotal(number_format($order->info['total'] * $currencies->get_value($currency), 2,'.','')); //number_format($number, 2); fix for comma in subtotal field

Link to comment
Share on other sites

Hello All,

 

I am having a weird problem with psigate charging the wrong amount when a customer is using a coupon. The module Credit Class & Gift Voucher is installed and the checkout confirmation and the admin/orders.php show the discount correctly:

 

Sub-Total: $15.00

Shipping & Handling: $15.00

Discount Coupons:discount: $5.00

Total: $25.00

 

But when I am in the psigate backend which shows the transaction (https://secure.psigate.com/Store_Reports/view_order_details) the amount that is charged to the customer is $30.00 and not $25.00.

 

Can anyone assist me with this problem as I looked in class.psigate_xml.php and I really dont want to play with this since I am not 100% sure how everything works. I have quite extensive knowledge of OS Commerce and php so if you can point me in the right direction maybe i can figure it out.

 

Thanks in advance for the help....

Rod

Link to comment
Share on other sites

  • 2 weeks later...

Just installed this on my shopping cart at the request of PSiGate.

 

Problems:

1) Need to be able to FORCE people to submit the CVV details

2) Although info is being captured by oscommerce it isnt being transferred to PSiGate (even though the purchase comes back as A-OK by oscommerce)

 

Any ideas?

 

Need to have this completely setup by Monday!

 

Thanks in advance!

 

~Roq

Link to comment
Share on other sites

Problems:

1) Need to be able to FORCE people to submit the CVV details

2) Although info is being captured by oscommerce it isnt being transferred to PSiGate (even though the purchase comes back as A-OK by oscommerce)

 

Problem 2 has a solution... it was my error! YAY! after installing this mod you need to go to the XML version of PSiGate's system. Click here to go to the appropriate page

 

Could still use some suggestions for the first issue of forcing a field to be completed before continuing,

 

Thanks

 

~Roq

Link to comment
Share on other sites

Ok... this is starting to get a little frustrating. Every time I try to do an update to get this thing working without errors I get a new error... most recently the "}" that plagued Luke99's install.

 

Could someone PLEASE update the PSiGate XML downloadable contribution with ALL the recently tested and functioning improvements?

 

Thanks

Link to comment
Share on other sites

I installed the psigate XML contribution.

 

I am at the testing phase.

 

Everything seems fine until I get to the order confirmation. Then nothing happens. The order doesn't go through.

 

I have the ports open.

I do not have SSL.

 

Any ideas?

 

Thanks in advance.

Link to comment
Share on other sites

Man... does this contribution need some love...

 

After installing the contribution to the shopping cart (PSiGate_XML_osc 1.21) all works fine. Tech guy at PSiGate said to be sure to update with the code provided by mikeshantz (here) I get the "}" error appearing in the bottom left of the IE window. Nothing damaging really.. but customers dont like seeing error messages on pages where they will be entering in their credit card info!!!

 

Other problems:

1) Orders that do not include the customers CVV info get processed anyways!!! They shouldnt even be able to progress to the Confirm Order page without entering info in there. (ideas on how to do that would be appreciated)

 

2) Failed transactions get sent back to the checkout_payment.php without any reasons specified as to WHY their transaction failed. Is there a way to specify errors in the pretty pink box available??

 

Comments or suggestions would be appreciated.

 

~Roq

Link to comment
Share on other sites

I get the "}" error appearing in the bottom left of the IE window.

 

An extra point on this error...

 

After entering bogus credit card details and being returned to "checkout_payment.php" the "}" error no longer appears. Odd...

 

This is the returned link:

catalog/checkout_payment.php?payment_error=psigate_xml&error=The+expiry+date+entered+for+the+credit+card+is+invalid.%3Cbr%3EPlease+check+the+date+and+try+again.&psigate_xml_cc_owner=Jason+Lastname&psigate_xml_cc_expires_month=01&psigate_xml_cc_expires_year=07

 

How do you get these errors to appear in the pink box?????????

 

~Roq

Link to comment
Share on other sites

After updating the cURL info as suggested by the PSiGate XML contribution page I get the following error:

 

Parse error: parse error, unexpected T_ELSE in /home/fnjrtbrg/public_html/catalog/includes/modules/payment/psigate_xml/class.psigate_xml.php on line 485

 

 

WTF??

 

Anyone a pro at installing this contribution? I am |----------> :angry: <-----------| close to paying for it.

Link to comment
Share on other sites

After updating the cURL info as suggested by the PSiGate XML contribution page I get the following error:

 

Parse error: parse error, unexpected T_ELSE in /home/fnjrtbrg/public_html/catalog/includes/modules/payment/psigate_xml/class.psigate_xml.php on line 485

WTF??

 

Anyone a pro at installing this contribution? I am |----------> :angry: <-----------| close to paying for it.

 

 

Unfortunately there doesn't seem to be much support for this contribution.

I have been fighting with it for a couple of days and can't find any help on here. :angry:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...