Jump to content

Make Gateways Available For All Currencies


Blesta Addons

Recommended Posts

I think what this thread should be requesting is the ability to show currency equivalence.

For example, package is $100 USD, user uses GBP, so they could see on the order form:

$100 USD (approx. £78.73).

 

Yes, this is an interesting ideia :)

 

+ 1 for this :)

Link to comment
Share on other sites

in the fact , equivalance currency is not the solution .

let say we have just one currency . this curency is not supported in paypal . the goal or the idea is to show all available gateway to the user , then if the gateway is not supporting the user currency , it should convert the currency to a default or accepted currency like USD or EUR . then pass the amount to the currency .

i have searched all the code , i don't see or maybe i have not arrived to found the class that responsible for showing gateway . normally the gateway appear only if the user currency is listed in the accepted currencies for that gateway .

another time, V2.5 was this possiblity and we have changed some gateways to convert the currencies in the proccess .

Link to comment
Share on other sites

i hope the staff can do something for that . paypal available in 203 markets(countries) and just 26 currencies is supported .

so is more than 150 country/currency cannot use international gateways in blesta like paypal .

i have see also in the database a table for the supported currencies for given gateway . so a plugin to add more currencies can do the trick , now what is missed is how to make the conversion without changing the CORE FILES .

Link to comment
Share on other sites

  • 4 weeks later...

Hello,

 

like I promisse (a litle late :P) here is what I found out :)

 

If we do this below we can change the currency for a default one if it dosent support on the Gateway.

 

(now it only needs a Summary->Total function to convert the choosen currency total to the default gateway currency. It will take more time for me to detect and implement the conversion rate)

 

 

Open: plugins/order/order_form_controller.php
 
line 592 find:
		if ($currency == null)
Change to:
$default_currency = "USD"; // put here your default gateway currency to convert if it dosent exists

if ($currency == null)

on line 606 find:

		// Fetch merchant gateway for this currency
		$merchant_gateway = $this->GatewayManager->getInstalledMerchant($this->company_id, $currency, null, true);

Replace with:

// Fetch merchant gateway for this currency
$merchant_gateway = $this->GatewayManager->getInstalledMerchant($this->company_id, $currency, null, true);

if (!$merchant_gateway)
     $merchant_gateway = $this->GatewayManager->getInstalledMerchant($this->company_id, $default_currency, null, true);
            $currency = $default_currency;

Find on line 624:

			$gw = $this->GatewayManager->getInstalledNonmerchant($this->company_id, null, $gateway->gateway_id, $currency);
			if ($gw)
				$nonmerchant_gateways[] = $gw;

Replace with:

			$gw = $this->GatewayManager->getInstalledNonmerchant($this->company_id, null, $gateway->gateway_id, $currency);

            if (!$gw)
                $gw = $this->GatewayManager->getInstalledNonmerchant($this->company_id, null, $gateway->gateway_id, $default_currency);
                $currency = $default_currency;

			if ($gw)
				$nonmerchant_gateways[] = $gw;
 
I hope that helps :)
 
But ofcourse with ould be great to have a defaul option to select a "default" currency for each Payment gatway that make the convertion from the client choosent currency and display on the order summary and on the invoice something like:
 
$100 USD (converted to £78.73 for payment gateway support)
Link to comment
Share on other sites

  • 2 weeks later...

i have back again .

 

the final solution will be as we have doit in v2.5 , a custom gateway for paypal and the others .

 

the only probleme we have here , is we can't show any message to the client that the curency/amount to pay has been changed to a new amount/currency .

 

but is better than we can't use paspay , stripe , payza ..... )

 

tomorrow i will share the paypal gateway with the community .

 

EDIT : we can pass a message in the proccess.pdt file :)

Link to comment
Share on other sites

  • 2 months later...
  • 7 years later...

I want this feature too. My domains are billed to me in USD and I've listed them as packages in USD, but my clients are paying in INR and I use CCAvenue and the gateway does not process payments in USD. So I need something that will convert the amount to INR and allow to be paid via the gateway that doesn't supports the billing currency.

How to do ? Earlier if i remember that when generating invoices blesta used to calculate the exchange and created invoices according to user's currency, but i guess it works only when generating invoices for renewal. When user is placing a new order then the conversion is not happening and invoice is generated in usd. Weird.

Thanks.

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
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.

Loading...
×
×
  • Create New...