Payment Modules

PayPal Express – no shipping options?

I was working on the ‘official’ PayPal Express release for osCommerce:

https://cms.paypal.com/cms_content/GB/en_GB/files/developer/osc_PayPal_v177.zip

Installation was fine (other than the recurring payments bits which I did not install) but, when I was testing it on the PayPal Sandbox I found that I was being presented with no shipping fee at checkout_confirmation – just the single character ‘r’

Tracking down the reason took awhiles but here it is – in the file ext/modules/payment/paypal/express.php find the following at around line 300:

// select cheapest shipping method
$shipping = $shipping_modules->cheapest();
$shipping = $shipping['id'];

Change this by commenting out the last line

 // select cheapest shipping method
$shipping = $shipping_modules->cheapest();
//$shipping = $shipping['id'];

ANZ Egate not displaying in the front end

If you install the ANZ Egate payment module that uses MIGS ( get it here ) and, after activation it in the admin, you may be puzzled to find that it does not display in the front end. You then spend ages bug hunting. I did.

The front end will not display unless you insert both a MIGS Merchant ID and MIGS Access Code in the admin page – both these can be any dummy numbers that you like but, without those two fields filled in the module will not display in checkout_payment.php

Discussed here.

Pagseguro

Pagseguro::Erro 165 – O VALOR do item 1 não foi informado.

Came across this one recently – Pagseguro is a Brazilian payment processor Pagsegurowith a built in postal calculation function.

All of a sudden the client’s store was throwing errors on checkout:

O VALOR do item 1 não foi informado.
O VALOR do item 2 não foi informado.

and so on.

Using HttpFox I could see that the correct value for the currency (tep_draw_hidden_field(‘moeda’, ‘BR’)) was being passed to the payment server but no values for the individual items in the order.

After a bit of digging I found that the client (ahem!) had been in the store admin and he had changed the currency code for Brazilian Reals to ‘BR’ from the existing ISO-4217 code ‘BRL’ so that it would match the  ‘BR’  required by Pagseguro as per their moeda field.

The Pagseguro payment module passes individual prices for each item in the order to the payment server by using the osCommerce function  $currencies->get_value($currency) – changing the currency code in the admin to BR will make this function return a zero value.

So if you find that your Reals are not being correctly calculated then check that admin currency setting.