Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Currencies


Alexandero

Recommended Posts

Posted

Hi guys, i've got a serious problem here.

 

I've been struggeling to install Paydollar payment gateway and I am almost done, but there is still one problem should be fixed.

 

The currencies there are not calculated in correct manner.

 

Example:

 

I made a purchase of total 12 us $ but in Paydollar payment page this total is seen in HKD (Hong Kong dollars) :(

 

So, the client will only pay 12HKD and not 12$.

 

I made big efforts to let this module work, but I stopped here.

If you can support or help, I'd really appreciate that.

 

  function process_button() {
	global $_SERVER, $order;

	$this->totalsum = $order->info['total'];
	$this->orderRef = $order_id;   // JTD:01/25/06



	$process_button_string = '<input type="hidden" name="merchantId" value="'.MODULE_PAYMENT_PAYDOLLAR_ID.'"/>
							  <input type="hidden" name="amount" value="'. $this->totalsum .'" />
							  <input type="hidden" name="orderRef" value="'. $this->orderRef .'"/>
							  <input type="hidden" name="currCode" value="'. $this->getCurrencyCode() .'" />
							  <input type="hidden" name="successUrl" value="'. tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL', false) .'"/>
							  <input type="hidden" name="failUrl" value="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_status=failed', 'SSL') . '"/>
							  <input type="hidden" name="cancelUrl" value="'. tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_status=canceled', 'SSL') .'"/>
							  <input type="hidden" name="payType" value="N">
							  <input type="hidden" name="payMethod" value="CC">
							  <input type="hidden" name="lang" value="'. $this->getLanguageCode() .'">';

 return $process_button_string;

 }
/*“344” - HKD
“840” – USD
“702” – SGD
“156” – CNY (RMB)
“392” – JPY
“901” – TWD
“036” – AUD
“978” – EUR
“826” – GBP
“124” – CAD
 */
 function getCurrencyCode(){

switch (MODULE_PAYMENT_PAYDOLLAR_CURRENCY) {
		case 'Only HKD':  $cur = '344';
				break;
		case 'Only USD':  $cur = '840';
			   break;
		case 'Only SGD':  $cur = '702';
				break;
		case 'Only CNY':  $cur = '156';
				break;
		case 'Only JPY':  $cur = '392';
				break;
		case 'Only TWD':  $cur = '901';
				break;
		case 'Only AUD':  $cur = '036';
				break;
		case 'Only EUR':  $cur = '978';
				break;
		case 'Only GBP':  $cur = '826';
				break;
		case 'Only CAD':  $cur = '124';
				break;
		default:  $cur = '344';

}

return $cur;
 }

 

 

Thanks in advance .

Posted
Hi guys, i've got a serious problem here.

 

I've been struggeling to install Paydollar payment gateway and I am almost done, but there is still one problem should be fixed.

 

The currencies there are not calculated in correct manner.

 

Example:

 

I made a purchase of total 12 us $ but in Paydollar payment page this total is seen in HKD (Hong Kong dollars) :(

 

So, the client will only pay 12HKD and not 12$.

 

I made big efforts to let this module work, but I stopped here.

If you can support or help, I'd really appreciate that.

 

  function process_button() {
	global $_SERVER, $order;

	$this->totalsum = $order->info['total'];
	$this->orderRef = $order_id;   // JTD:01/25/06



	$process_button_string = '<input type="hidden" name="merchantId" value="'.MODULE_PAYMENT_PAYDOLLAR_ID.'"/>
							  <input type="hidden" name="amount" value="'. $this->totalsum .'" />
							  <input type="hidden" name="orderRef" value="'. $this->orderRef .'"/>
							  <input type="hidden" name="currCode" value="'. $this->getCurrencyCode() .'" />
							  <input type="hidden" name="successUrl" value="'. tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL', false) .'"/>
							  <input type="hidden" name="failUrl" value="' . tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_status=failed', 'SSL') . '"/>
							  <input type="hidden" name="cancelUrl" value="'. tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'payment_status=canceled', 'SSL') .'"/>
							  <input type="hidden" name="payType" value="N">
							  <input type="hidden" name="payMethod" value="CC">
							  <input type="hidden" name="lang" value="'. $this->getLanguageCode() .'">';

 return $process_button_string;

 }
/*“344” - HKD
“840” – USD
“702” – SGD
“156” – CNY (RMB)
“392” – JPY
“901” – TWD
“036” – AUD
“978” – EUR
“826” – GBP
“124” – CAD
 */
 function getCurrencyCode(){

switch (MODULE_PAYMENT_PAYDOLLAR_CURRENCY) {
		case 'Only HKD':  $cur = '344';
				break;
		case 'Only USD':  $cur = '840';
			   break;
		case 'Only SGD':  $cur = '702';
				break;
		case 'Only CNY':  $cur = '156';
				break;
		case 'Only JPY':  $cur = '392';
				break;
		case 'Only TWD':  $cur = '901';
				break;
		case 'Only AUD':  $cur = '036';
				break;
		case 'Only EUR':  $cur = '978';
				break;
		case 'Only GBP':  $cur = '826';
				break;
		case 'Only CAD':  $cur = '124';
				break;
		default:  $cur = '344';

}

return $cur;
 }

Thanks in advance .

 

 

 

Hi I'm not a whiz,

But a similar problem arose and all i did was to change the last part default: $cur='344'; to '840' which is the currency you want it all in.

 

koalaphil

Posted

Thank you so much for your kind reply Koalaphil, I did that already but it didn't work for me. Maybe there is something wrong in there.

 

My best regards,

Posted
Thank you so much for your kind reply Koalaphil, I did that already but it didn't work for me. Maybe there is something wrong in there.

 

My best regards,

 

Hello,

 

Set proper currency conversion rates.

 

So conversion take place at Your site.

And then set proper value for currency.

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...