Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Braintree : Please check the shipping address information #9356

Closed
advcha opened this issue Apr 21, 2017 · 6 comments
Closed

Braintree : Please check the shipping address information #9356

advcha opened this issue Apr 21, 2017 · 6 comments
Labels
bug report Component: Checkout Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@advcha
Copy link

advcha commented Apr 21, 2017

I am developing a website with magento CE 2.1.2. Everything looked fine until I tested a few payment options like paypal and braintree on the checkout page. both with sandbox account. Paypal run well but braintree dont. At first I got an error 400 and a response "An error occurred on the server. Please try to place the order again." then I tried to debug it with modifying /vendor/magento/module-checkout/Model/GuestPaymentInformationManagement.php:

    public function savePaymentInformationAndPlaceOrder(
        $cartId,
        $email,
        \Magento\Quote\Api\Data\PaymentInterface $paymentMethod,
        \Magento\Quote\Api\Data\AddressInterface $billingAddress = null
    ) {
        $this->savePaymentInformation($cartId, $email, $paymentMethod, $billingAddress);
        //try {
            $orderId = $this->cartManagement->placeOrder($cartId);
        /*} catch (\Exception $e) {
            throw new CouldNotSaveException(
                __('An error occurred on the server. Please try to place the order again.'),
                $e
            );
        }*/
        return $orderId;
    }

Then I got a more clear response:

message:"Please check the shipping address information. %1"
parameters:[,…]
0:"Please enter the first name. Please enter the last name. Please enter the street. Please enter the city. Please enter the phone number. Please enter the zip/postal code."
trace:
"#0 /home/ubuntu/projects/magento212/vendor/magento/module-quote/Model/QuoteManagement.php(427): Magento\Quote\Model\QuoteValidator->validateBeforeSubmit(Object(Magento\Quote\Model\Quote))↵#1 /home/ubuntu/projects/magento212/vendor/magento/module-quote/Model/QuoteManagement.php(391): Magento\Quote\Model\QuoteManagement->submitQuote(Object(Magento\Quote\Model\Quote), Array)↵#2 /home/ubuntu/projects/magento212/vendor/magento/module-quote/Model/QuoteManagement.php(349): Magento\Quote\Model\QuoteManagement->submit(Object(Magento\Quote\Model\Quote))↵#3 /home/ubuntu/projects/magento212/vendor/magento/module-quote/Model/GuestCart/GuestCartManagement.php(87): Magento\Quote\Model\QuoteManagement->placeOrder('7324', NULL)↵#4 /home/ubuntu/projects/magento212/var/generation/Magento/Quote/Model/GuestCart/GuestCartManagement/Interceptor.php(50): Magento\Quote\Model\GuestCart\GuestCartManagement->placeOrder('aa9ace51ce9c713...', NULL)↵#5 /home/ubuntu/projects/magento212/vendor/magento/module-checkout/Model/GuestPaymentInformationManagement.php(81): Magento\Quote\Model\GuestCart\GuestCartManagement\Interceptor->placeOrder('aa9ace51ce9c713...')↵#6 [internal function]: Magento\Checkout\Model\GuestPaymentInformationManagement->savePaymentInformationAndPlaceOrder('aa9ace51ce9c713...', '[email protected]...', Object(Magento\Quote\Model\Quote\Payment), Object(Magento\Quote\Model\Quote\Address))↵#7 /home/ubuntu/projects/magento212/vendor/magento/module-webapi/Controller/Rest.php(307): call_user_func_array(Array, Array)↵#8 /home/ubuntu/projects/magento212/vendor/magento/module-webapi/Controller/Rest.php(216): Magento\Webapi\Controller\Rest->processApiRequest()↵#9 /home/ubuntu/projects/magento212/var/generation/Magento/Webapi/Controller/Rest/Interceptor.php(37): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))↵#10 /home/ubuntu/projects/magento212/vendor/magento/framework/App/Http.php(135): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))↵#11 /home/ubuntu/projects/magento212/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()↵#12 /home/ubuntu/projects/magento212/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))↵#13 {main}"

I got confuse with the returned message "Please check the shipping address information" and "Please enter the first name. Please enter the last name. Please enter the street. Please enter the city. Please enter the phone number. Please enter the zip/postal code." because in chrome dev toolbar I posted the correct payload:

billingAddress:{countryId: "AU", regionId: "0", region: "", street: ["First ave."], company: "",…}
city:"Sidney"
company:""
countryId:"AU"
firstname:"First"
lastname:"Last"
postcode:"41523"
region:""
regionId:"0"
saveInAddressBook:1
street:["First ave."]
telephone:"123456789"
cartId:"9cc2a5877b01dea7ec43e30c6e3b59bf"
email:"[email protected]"
paymentMethod:{method: "braintree", additional_data: {payment_method_nonce: "43168114-a07e-0b40-2acb-4711a45f204e"},…}

I've tried to sent some combinations like filling the form with 'My billing and shipping address are the same' checkbox unchecked then click 'Update' button. Also filled all form (shipping and billing form) but its didn't work either.

@YevSent
Copy link
Contributor

YevSent commented Apr 24, 2017

Hi, @advcha, this issue is not related to Braintree payment method and perhaps related to #3789 (internal ticket MAGETWO-58914) - this issue already fixed on develop branch and should be available in Magento 2.1.8 release.

because in chrome dev toolbar I posted the correct payload

You have posted the request for the billing address, not for the shipping.

@YevSent YevSent added 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development bug report Component: Checkout labels Apr 24, 2017
@advcha
Copy link
Author

advcha commented Apr 24, 2017

Hi @joni-jones, I've tried the solutions from @pratikmage (https://github.com/shopgo-magento2/checkout-city) and @horatiubrinza (https://pastebin.com/3GcesL2H) but none is working. I've tried with the shipping form is filled and 'My billing and shipping address are the same' checkbox is checked. then the shipping form is filled and 'My billing and shipping address are the same' checkbox is unchecked (mean I need to fill the billing address form and click 'Update' button). None are working. The same error message "Please check the shipping address information. %1" is appeared.

@YevSent
Copy link
Contributor

YevSent commented Apr 24, 2017

@advcha , I can't comment these solutions.

I've tried with the shipping form is filled and 'My billing and shipping address are the same' checkbox is checked.
'My billing and shipping address are the same'

It will not help because of the issue in the previous checkout step, the shipping address is saving in a quote without all needed details.

You can try to use develop branch and if this issue is still reproducible, please, update this ticket.

@advcha
Copy link
Author

advcha commented Apr 24, 2017

@joni-jones, can you tell me the steps to upgrade to the develop branch? I dont want to break my current magento version.

@advcha
Copy link
Author

advcha commented May 8, 2017

Okay. This is my mistake. I put the email address input in the shipping address form (because the mockup from my client want me to do so) and add an attribute data-role="email-with-possible-login" in the form. I also moved 'Already registered? Click here to login' text. That's way it broke the checkout process and always got a complain "Please check the shipping address information". When I fixed the mistake, the checkout process run well again. Yeah. this is nothing to do with Braintree.

@advcha advcha closed this as completed May 8, 2017
scottsb added a commit to ripenecommerce/magento2-patches that referenced this issue May 16, 2017
@scottsb
Copy link
Member

scottsb commented May 16, 2017

Referenced the wrong PR number in my commit. Please ignore above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Checkout Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

3 participants