magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.5k stars 9.31k forks source link

Payment method based on shipping address #4306

Closed OleksiyOleksiyovych closed 8 years ago

OleksiyOleksiyovych commented 8 years ago

Steps to reproduce

  1. Install Magento from develop or 2.0 branch.
  2. Go to configure any payment method (for ex. "Check / Money Order").
  3. Set "Payment from Applicable Countries" to "Specific Countries"
  4. Select, for example, United States only.
  5. Go to create order on backend or frontend.
  6. Fill shipping address and select country Canada.
  7. Fill billing address and select country United States.

    Expected result

  8. Payment method "Check / Money Order" is available.

    Actual result

  9. Payment method "Check / Money Order" is NOT available.

    Reason

The reason of this issue is method is getCountry in class CountryProvider [app/code/Magento/Payment/Model/Checks/CanUseForCountry/CountryProvider.php] If quote is not virtual you are using shipping address for detect country. Why?

asemenenko commented 8 years ago

Hi @OleksiyOleksiyovych Not all payment methods have a billing address to be asked from a customer - we control only shipping address to allow or disallow orders to be placed for a certain regions with a certain payment method, this is the most common scenario, especially when it comes to international shipping.

OleksiyOleksiyovych commented 8 years ago

Pardon, but I cannot understand this logic. As I understand, this bug is similar with bug https://github.com/magento/magento2/issues/3272

Situation: I live in Ukraine and I have a friend in USA. I want to buy t-shirt in Ukraine's M2 store for my friend. I want to select payment method "Check / Money Order". I go to checkout, enter USA as a country for shipping. But "Check / Money Order" payment allows for Ukraine only. So I can not see "Check / Money Order" in payment methods list. In frontend checkout I can not change payment address for "Check / Money Order" to Ukraine, because I can change payment address only under payment method (but this payment method is not allowed). In backend checkout I can change billing address, but it will not affect to payments, because M2 check shipping address.

Please agree, it's a normal and real scenario. Can you clarify me why it does not work? I should to explain this logic for my clients. Thank you and hove a good day!

miteshdhaduk commented 3 years ago

Payment method based on the shipping address or payment method? Any clarification on this?

It's only working with billing address when (Stores -> Configuration -> Sales -> Checkout -> Checkout Options) is selected to Payment Page. If Payment Method option is set then it's not working.

Magento ver. 2.4.1