an ASP.NET Open Source CMS & eCommerce platform
Search:
Last Post 6/30/2009 3:26:45 PM By micahsdad1402. 15 replies.
Page 1 of 2 (16 posts) << First < Prev 1 2 Next > Last >> 
3/16/2009 2:39:12 AM
micahsdad1402
Posts: 31
Joined: 11/2/2008
Location:Melboune Australia
Currency
Hi,
 
Just doing some testing with Paypal sandbox.
 
Using opensource version 2.0
 
When it went to Paypal it specified USD pricing based on the pricing I had in the shop.
 
I actually need my pricing to be in AUD.
 
 
Where do I specify this? or do I need to do a mod.
 
JJ
3/16/2009 9:30:38 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Currency
Which PayPal payment are you using? Standard or Express?
 
If Express, check PayPalExpressPaymentProvider.cs and change "paymentDetails.OrderTotal.currencyID = CurrencyCodeType.USD;" to the proper value.
 
If Standard, check PaypalStandardPaymentProvider.cs and add "currency_code" query string to the url of the method call GetUploadOrderUrl.
DotShoppingCart Staff
3/17/2009 2:22:25 AM
micahsdad1402
Posts: 31
Joined: 11/2/2008
Location:Melboune Australia
Re: Currency
Lukesy,
 
Still a real newby with C#.
 
Added the following line into PaypalStandardPaymentProvider.cs
 
        public string GetUploadOrderUrl(string orderNumber) {
            Order order = Order.Get(orderNumber);
            decimal total = Math.Round(order.OrderTotalAmount, 2);
            StringBuilder url = new StringBuilder();
            url.Append(GetPaypalUrl()).Append("?cmd=_xclick&business=").Append(HttpUtility.UrlEncode(businessEmail));
            url.AppendFormat("&amount={0}", Math.Round(order.OrderTotalAmount, 2));
            url.AppendFormat("&item_name=Order Number {0}", orderNumber);
            url.AppendFormat("&custom={0}", orderNumber);
            url.Append("&no_shipping=1");
            url.AppendFormat("&first_name={0}", order.ShippingAddress.FirstName);
            url.AppendFormat("&last_name={0}", order.ShippingAddress.LastName);
            url.AppendFormat("&address1={0}", order.ShippingAddress.Address1);
            url.AppendFormat("&address2={0}", order.ShippingAddress.Address2);
            url.AppendFormat("&city={0}", order.ShippingAddress.City);
            url.AppendFormat("&state={0}", order.ShippingAddress.State);
            url.AppendFormat("&country={0}", order.ShippingAddress.Country.CodeISO3166);
            url.AppendFormat("&zip={0}", order.ShippingAddress.Zipcode);
            //2009.03.17 JJ Add currency_code parameter
            url.AppendFormat("&currency_code={0}", "AUD");                 // <<<<<<<<<<<<<<<<<<<<<<<<<<<
            url.AppendFormat("&return={0}", HttpUtility.UrlEncode(SiteNavigation.PaypalPDTHandlerPage));
            url.AppendFormat("&cancel_return={0}", HttpUtility.UrlEncode(SiteNavigation.CheckoutPage));

            return url.ToString();
        }
 
Added the following into PaypalExpressProvider.cs
 
        public string SetExpressCheckout(decimal orderTotal, string returnUrl, string cancelUrl, bool AuthOnly) {
            SetExpressCheckoutReq req = new SetExpressCheckoutReq();
            req.SetExpressCheckoutRequest = new SetExpressCheckoutRequestType();
            req.SetExpressCheckoutRequest.Version = PaymentUtils.APIVersion;
            SetExpressCheckoutRequestDetailsType details = new SetExpressCheckoutRequestDetailsType();
            req.SetExpressCheckoutRequest.SetExpressCheckoutRequestDetails = details;

            details.PaymentAction = AuthOnly ? PaymentActionCodeType.Authorization : PaymentActionCodeType.Sale;
            details.PaymentActionSpecified = true;

            details.OrderTotal = new BasicAmountType();
            details.OrderTotal.Value = Math.Round(orderTotal, 2).ToString(); 
            //2009.03.17 JJ Change to AUD
            details.OrderTotal.currencyID = CurrencyCodeType.AUD;  //<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

            details.ReturnURL = returnUrl;
            details.CancelURL = cancelUrl;

            SetExpressCheckoutResponseType response = service2.SetExpressCheckout(req);
            string error;
            if (PaymentUtils.CheckSuccess(response, out error)) {
                return GetPaypalUrl(response.Token);
            }
            throw new PaymentExecption(error);
        }
 
I did a build. For some reason it would only build a debug build, even though I changed the properties on the project.
 
I then copied the DLL and *.pdb files from \bin\debug into the bin folder on my website.
 
Restarted website.
 
Get the following Unhandled Exception
 
<font face="Segoe UI" size="2">Timestamp: 17/03/2009 9:10:26 AM
Message: HandlingInstanceID: 6ccadf27-39aa-40d1-86e6-7594210c4a60
An exception of type 'System.Configuration.ConfigurationErrorsException' occurred and was caught.
-------------------------------------------------------------------------------------------------
03/17/2009 20:10:26
Type : System.Configuration.ConfigurationErrorsException, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Message : Cannot find the requested object.
(C:\inetpub\wwwroot\dsc\DSC.config line 20)
Source : System.Web
Help link :
BareMessage : Cannot find the requested object.

Filename : C:\inetpub\wwwroot\dsc\DSC.config
Line : 20
Errors : System.Configuration.ConfigurationException[]
Data : System.Collections.ListDictionaryInternal
TargetSite : System.Configuration.Provider.ProviderBase InstantiateProvider(System.Configuration.ProviderSettings, System.Type)
Stack Trace :    at System.Web.Configuration.ProvidersHelper.InstantiateProvider(ProviderSettings providerSettings, Type providerType)
  at DotShoppingCart.OpenSource.Payment.PaypalExpressPaymentProvider.GetProvider(String host)
  at DotShoppingCart.OpenSource.Payment.PaypalExpressPaymentProvider.GetProvider()
  at Store_Cart.IsCreditCardAndPaypalEnabled() in c:\inetpub\wwwroot\dsc\Store\Cart.ascx.cs:line 69
  at Store_Cart.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\dsc\Store\Cart.ascx.cs:line 49
  at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
  at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
  at System.Web.UI.Control.OnLoad(EventArgs e)
  at System.Web.UI.Control.LoadRecursive()
  at System.Web.UI.Control.LoadRecursive()
  at System.Web.UI.Control.LoadRecursive()
  at System.Web.UI.Control.LoadRecursive()
  at System.Web.UI.Control.LoadRecursive()
  at System.Web.UI.Control.LoadRecursive()
  at System.Web.UI.Control.LoadRecursive()
  at System.Web.UI.Control.LoadRecursive()
  at System.Web.UI.Control.LoadRecursive()
  at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
  at System.Web.UI.Page.ProcessRequest()
  at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
  at System.Web.UI.Page.ProcessRequest(HttpContext context)
  at ASP.dynamic_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\49a10f32\18934afa\App_Web_jgqcqbhs.0.cs:line 0
  at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
  at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Additional Info:

MachineName : ELIJAH32
TimeStamp : 17/03/2009 9:10:26 AM
FullName : Microsoft.Practices.EnterpriseLibrary.ExceptionHandling, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null
AppDomainName : /LM/W3SVC/2/ROOT-4-128817545575734920
ThreadIdentity : admin
WindowsIdentity : NT AUTHORITY\NETWORK SERVICE

Category: General
Priority: 0
EventId: 100
Severity: Error
Title:Enterprise Library Exception Handling
Machine: ELIJAH32
Application Domain: /LM/W3SVC/2/ROOT-4-128817545575734920
Process Id: 4276
Process Name: c:\windows\system32\inetsrv\w3wp.exe
Win32 Thread Id: 5320
Thread Name:
Extended Properties: Url - http://dsc.goldrush.local/Dynamic.aspx?p=Store/Cart
RawUrl - /Store/Cart.aspx
UseAgent - Mozilla/5.0 (Windows; U; Windows NT 6.0; en-GB; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7 (.NET CLR 3.5.30729)
UrlReferrer - http://dsc.goldrush.local/
IPAddress - 192.168.14.18
 
 
<font face="Segoe UI" size="2">I'm sure I've just missed something basic.
 
<font face="Segoe UI" size="2">Thanks for your help.
3/17/2009 10:58:23 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Currency
Did you restart the app pool?
DotShoppingCart Staff
3/17/2009 12:51:55 PM
micahsdad1402
Posts: 31
Joined: 11/2/2008
Location:Melboune Australia
Re: Currency
Just tried that:
 
same error.
3/17/2009 12:58:44 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Currency
It seems like that issue for PayPal express payment provider. Try reverting it back to the original dll and test the PayPal standard payment provider first.
DotShoppingCart Staff
3/18/2009 12:03:28 AM
micahsdad1402
Posts: 31
Joined: 11/2/2008
Location:Melboune Australia
Re: Currency
Lukesy,
 
Your right. I disabled the PayPal Express payment provider and it work.
 
I was also getting the error without the mods, so it wasn't the changes. Was the fact that I also added Paypal Express as a payment option.
 
The other day you sent me an update to install. It was http://www.dotshoppingcart.com/dbfile.axd?name=SelectPaymentOption.ascx.zip
 
I suspect the problem may be with this!
 
Any ideas what I should look at.
 
By the way, the paypal standard changes worked a treat. thanks.
 
 
3/18/2009 2:57:32 PM
micahsdad1402
Posts: 31
Joined: 11/2/2008
Location:Melboune Australia
Re: Currency
Lukesy,
 
I had a bit of a look, and the selectpaymentoption.ascx seems to ignore paypal express.
 
I had originally thought Paypal Express was the paypal option that accepted credit card without a paypal account. In fact what I need is Website Payment Standard.
 
Can you configure dsc to use this?
3/18/2009 3:07:03 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Currency
What is website payment standard? Is it PayPal Standard? If so, I think you set it up working correctly, no?
DotShoppingCart Staff
3/18/2009 3:11:32 PM
micahsdad1402
Posts: 31
Joined: 11/2/2008
Location:Melboune Australia
Re: Currency
Found the issue.
 
The sandbox doesn't give the option to pay by credit card w/o signing on to paypal.
 
When I removed the sandbox and went through to paypal proper, it was all good.
 
Is there any documentation on adding custom billing options, or do I just have to hack my way through the code?
3/19/2009 9:30:40 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Currency
What custom billing options do you plan to add?
DotShoppingCart Staff
Page 1 of 2 (16 posts) << First < Prev 1 2 Next > Last >>