Jump to content

Modules for INR to USD currency Conversion in Paypal Gateway


mbate

Recommended Posts

If you are using WHMCS in India and configured the Currency settings to INR, for Paypal payment gateway, you will have to convert INR currency to UDS in order to process the order.

 

Here is a module that will fix the issue.

 

1. Open you WHMC folder

 

2. Open Modules > Gateways

 

3. Create a new file

 

4. Give name like paypal-india.php

 

5. copy and paste below code

 

<?php

###############################
##Realizado por OportHost.com and Customized By Linu for Indian Users##
###########GRATIS##############

$GATEWAYMODULE["paypalpesosname"]="paypalpesos";
$GATEWAYMODULE["paypalpesosvisiblename"]="PayPal INR to USD";
$GATEWAYMODULE["paypalpesostype"]="Invoices";

function paypalpesos_activate() {
defineGatewayField("paypalpesos","text","cotiza","0.00","Exchange Rate","","");
defineGatewayField("paypalpesos","text","mail","","PayPal Email","","");
defineGatewayField("paypalpesos","yesno","testmode","","Test Mode","","");
}

function paypalpesos_link($params) {
# Gateway Specific Variables
$gatewaycotiza = $params['cotiza'];
$gatewaymail = $params['mail'];
$gatewaytestmode = $params['testmode'];
# Invoice Variables
$invoiceid = $params['invoiceid'];
$description = $params["description"];
$amount = $params['amount'];
$duedate = $params['duedate'];
# Client Variables
$firstname = $params['clientdetails']['firstname'];
$lastname = $params['clientdetails']['lastname'];
$email = $params['clientdetails']['email'];
$address1 = $params['clientdetails']['address1'];
$address2 = $params['clientdetails']['address2'];
$city = $params['clientdetails']['city'];
$state = $params['clientdetails']['state'];
$postcode = $params['clientdetails']['postcode'];
$country = $params['clientdetails']['country'];
$phone = $params['clientdetails']['phone'];
# System Variables
$companyname = $params['companyname'];
$systemurl = $params['systemurl'];
$currency = $params['currency'];
# End of Variables

# se le suman sus comisiones de paypal
$presioparcial = $amount / $gatewaycotiza;

$presiofinal = round( $presioparcial * 100) / 100;


$code = '	
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="'.$gatewaymail.'">
<input type="hidden" name="item_name" value="Web Hosting Invoice # '.$invoiceid.'">
<input type="hidden" name="item_number" value="'.$invoiceid.'">
<input type="hidden" name="amount" value="'.$presiofinal.'">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="IN">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="image" src="https://www.paypalobjects.com/WEBSCR-540-20080916-1/en_US/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" alt="Secured Payment Link">
<img alt="" border="0" src="https://www.paypal.com/es_XC/i/scr/pixel.gif" ="1" height="1">
</form>';

return $code;

}

?>

 

6. Save File

 

7. Login WHMC Admin > Configuration > Payments Gateways

 

8. Choose PayPal INR to USD and activate

 

9. Enter current exchange rate of USD $1.00 = INR Rs.0.00 ?

 

(check this link to find the current exchange rate)

 

10. Enter your paypal email ID

 

Save Changes.

 

Linu

Bangalore

PP-INR-USD.zip

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated