Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Matt Taylor 873 posts 2086 karma points
    Aug 12, 2011 @ 13:51
    Matt Taylor
    0

    Problem changing the current country not changing the payment method

    I've got two countries set up:

        United Kingdom
        Australia

    and I've also set up different VAT rules for each one where the UK pays VAT and Oz does not.

    I've also got two payment methods set up:

        Account
        PayPal Sandbox

    There isn't a step that allows the selection of the payment method in my cart as in reality there will be only one in use for now, but for testing purposes:

    The 'Standard payment method' for the UK is set to Account (as per the starter kit).
    The 'Standard payment method' for Australia is set to PayPal Sandbox.

    So I'm expecting these defaults to be used.

    On my customer information page I ask the user to select their country and I then set the current country accordingly using the following .Net code.

    protected void saveLinkButton_Click(object sender, EventArgs e)
            {     
                    if (Page.IsValid)
                    {
                        TeaCommerce.Base.UpdateOrderProperty("company", companyTextBox.Text);
                        TeaCommerce.Base.UpdateOrderProperty("firstName", firstNameTextBox.Text);
                        TeaCommerce.Base.UpdateOrderProperty("lastName", lastNameTextBox.Text);
                        TeaCommerce.Base.UpdateOrderProperty("email", emailTextBox.Text);
                        TeaCommerce.Base.UpdateOrderProperty("telephone", telephoneTextBox.Text);
                        TeaCommerce.Base.UpdateOrderProperty("streetAddress", addressStreetTextBox.Text);
                        TeaCommerce.Base.UpdateOrderProperty("zipCode", addressPostcodeTextBox.Text);
                        TeaCommerce.Base.UpdateOrderProperty("city", addressCityTextBox.Text);
                        TeaCommerce.Base.UpdateOrderProperty("country", addressCountryDropDownList.SelectedItem.Text);
                        TeaCommerce.Base.UpdateOrderProperty("countryID", addressCountryDropDownList.SelectedValue);
                        Country selectedCountry = TeaCommerce.Data.Country.GetCountry(long.Parse(addressCountryDropDownList.SelectedValue));
                        TeaCommerce.Base.UpdateOrderProperty("ISOCountryCode", selectedCountry.CountryCode);
                        TeaCommerce.Base.UpdateOrderProperty("comments", commentsTextBox.Text);

                        TeaCommerce.Base.SetCurrentCountry(selectedCountry.Id);

                        Response.Redirect(new Node(_continuePageID).Url);

                    }              
            }

    If I select Australia as the country, no VAT is added as expected and when calling

    TeaCommerce.goToPayment();

    I'm sent to the Sandox OK.

    If I then exit out of the Sandbox, and go back to the customer information page and select the UK as the country, the VAT gets added as expected but I'm still being re-directed to the PayPal Sandbox.

    It's doesn't seem to be taking into account the payment method for the country.

  • Anders Burla 2560 posts 8256 karma points
    Aug 12, 2011 @ 14:59
    Anders Burla
    0

    Hi Matt

    Which countries is enabled at the different payment methods - the possible "available in these countries"? If Paypal is enabled in the UK then when you change country the order will still have the same payment method attached. Make sence?

  • Matt Taylor 873 posts 2086 karma points
    Aug 12, 2011 @ 15:28
    Matt Taylor
    0

    Ah, yes that does make sense. Both payment methods are enabled for both countries.

    Thanks,

    Matt

Please Sign in or register to post replies

Write your reply to:

Draft