-1

how to post currency code as United States dollar and India. By default it uses IND.

[HttpPost]
public void Plans(UserRegistreModel model)
{
    string firstName = model.FirstName;
    string middleName = model.MiddleName;
    string lastName = model.LastName;
    string amount = Convert.ToString(model.Amount);
    string Noofemp = model.NoOfEmployees;
    string productInfo = "HRMS";
    string email = model.Email;
    string phone = model.Contact;
    string FirmName = model.FirmName;
    //string surl = form["txtsurl"].ToString();
    //string furl = form["txtfurl"].ToString();

    RemotePost myremotepost = new RemotePost();
    string key = "";
    string salt = "";

    //posting all the parameters required for integration.

    myremotepost.Url = "https://secure.payu.in/_payment";
    myremotepost.Add("key", "");
    string txnid = Generatetxnid();
    myremotepost.Add("txnid", txnid);
    myremotepost.Add("amount", amount);
    myremotepost.Add("productinfo", productInfo);
    myremotepost.Add("firstname", firstName);
    myremotepost.Add("phone", phone);
    myremotepost.Add("email", email);
    //UserRegistreModel register = new UserRegistreModel();
    TempData["model"] = model;
    myremotepost.Add("surl", "");
    myremotepost.Add("furl", "");
    string hashString = key + "|" + txnid + "|" + amount + "|" +           productInfo + "|" + firstName + "|" + email + "|||||||||||" + salt;
    string hash = Generatehash512(hashString);
    myremotepost.Add("hash", hash);
    myremotepost.Post();
}
Ritesh
  • 31
  • 4

1 Answers1

0

You can do things like this

myremotepost.Add("currency", "INR");

It will set the currency INR for current request.

Anirudha Gupta
  • 9,073
  • 9
  • 54
  • 79
  • By default, It will set the currency to INR I am using myremotepost.Add("currency", "USD"); but it's not working – Ritesh Nov 07 '17 at 11:23
  • I read the pdf It says Amount: Amount is the total amount of the transaction (greater than 0) in INR, without a currency symbol or other non-numeric character. Only a decimal allowed. I think USD isn't allowed. – Ritesh Nov 07 '17 at 11:28
  • When you charge someone 60 USD, does it charge 1 $ something or 60 USD ? (with set currency USD) – Anirudha Gupta Nov 07 '17 at 11:38
  • It charges Rs. 60.00 for 60USD. – Ritesh Nov 07 '17 at 11:43
  • @Ritesh it's look like USD is allowed in Gold and Platinum plan check https://www.payubiz.in/pricing – Anirudha Gupta Nov 07 '17 at 12:06
  • I think solution is to convert USD to INR and then pass to payumoney – Ritesh Nov 07 '17 at 12:09
  • Yes, I see some code on github, they use the same trick as you say. check this PHP code https://github.com/payu-india/PayU-Integration-Kit-Drupal-Commerce/blob/master/PayU/commerce_payu/commerce_payu.module#L132 – Anirudha Gupta Nov 07 '17 at 12:16