I'm setting up Braintree payment In Magento 2 environment through integrated extension provided by Magento.
I have compiled the backend form with my merchant data and i selected sandox option to test all. All seems to work, Braintree payment option appear in my store frontend, I tried to do a payment with credit card datas provided by braintree, but when I click on checkout button, I receive this error message:
There was an error capturing the transaction: Please try again later.
If i debug the request with my browser developer tool I receive a 400 Bad Request response from this API:
http://MYSITE.SITE/rest/default/V1/guest-carts/XXXXXXX/payment-information
with this stack trace into the response request:
/var/www/html/magento2/vendor/magento/module-sales/Model/Order/Payment/Operations/CaptureOperation.php(80): Magento\Braintree\Model\PaymentMethod->capture(Object(Magento\Sales\Model\Order\Payment\Interceptor), '101') n#1 /var/www/html/magento2/vendor/magento/module-sales/Model/Order/Payment/Processor.php(85): Magento\Sales\Model\Order\Payment\Operations\CaptureOperation->capture(Object(Magento\Sales\Model\Order\Payment\Interceptor), Object(Magento\Sales\Model\Order\Invoice)) n#2 /var/www/html/magento2/vendor/magento/module-sales/Model/Order/Payment.php(435): Magento\Sales\Model\Order\Payment\Processor->capture(Object(Magento\Sales\Model\Order\Payment\Interceptor), Object(Magento\Sales\Model\Order\Invoice)) n#3 /var/www/html/magento2/var/generation/Magento/Sales/Model/Order/Payment/Interceptor.php(167): Magento\Sales\Model\Order\Payment->capture(Object(Magento\Sales\Model\Order\Invoice)) n#4 /var/www/html/magento2/vendor/magento/module-sales/Model/Order/Invoice.php(341): Magento\Sales\Model\Order\Payment\Interceptor->capture(Object(Magento\Sales\Model\Order\Invoice)) n#5 /var/www/html/magento2/vendor/magento/module-sales/Model/Order/Payment/Operations/AbstractOperation.php(70): Magento\Sales\Model\Order\Invoice->capture() n#6 /var/www/html/magento2/vendor/magento/module-sales/Model/Order/Payment/Operations/CaptureOperation.php(30): Magento\Sales\Model\Order\Payment\Operations\AbstractOperation->invoice(Object(Magento\Sales\Model\Order\Payment\Interceptor)) n#7 /var/www/html/magento2/vendor/magento/module-sales/Model/Order/Payment/Processor.php(85): Magento\Sales\Model\Order\Payment\Operations\CaptureOperation->capture(Object(Magento\Sales\Model\Order\Payment\Interceptor), NULL) n#8 /var/www/html/magento2/vendor/magento/module-sales/Model/Order/Payment.php(435): Magento\Sales\Model\Order\Payment\Processor->capture(Object(Magento\Sales\Model\Order\Payment\Interceptor), NULL) n#9 /var/www/html/magento2/var/generation/Magento/Sales/Model/Order/Payment/Interceptor.php(167): Magento\Sales\Model\Order\Payment->capture(NULL) n#10 /var/www/html/magento2/vendor/magento/module-sales/Model/Order/Payment.php(416): Magento\Sales\Model\Order\Payment\Interceptor->capture(NULL) n#11 /var/www/html/magento2/vendor/magento/module-sales/Model/Order/Payment.php(336): Magento\Sales\Model\Order\Payment->processAction('authorize_captu...', Object(Magento\Sales\Model\Order)) n#12 /var/www/html/magento2/var/generation/Magento/Sales/Model/Order/Payment/Interceptor.php(154): Magento\Sales\Model\Order\Payment->place() n#13 /var/www/html/magento2/vendor/magento/module-sales/Model/Order.php(871): Magento\Sales\Model\Order\Payment\Interceptor->place() n#14 /var/www/html/magento2/vendor/magento/module-sales/Model/Order.php(1060): Magento\Sales\Model\Order->_placePayment() n#15 /var/www/html/magento2/vendor/magento/module-sales/Model/Service/OrderService.php(190): Magento\Sales\Model\Order->place() n#16 /var/www/html/magento2/vendor/magento/module-quote/Model/QuoteManagement.php(491): Magento\Sales\Model\Service\OrderService->place(Object(Magento\Sales\Model\Order)) n#17 /var/www/html/magento2/vendor/magento/module-quote/Model/QuoteManagement.php(394): Magento\Quote\Model\QuoteManagement->submitQuote(Object(Magento\Quote\Model\Quote), Array) n#18 /var/www/html/magento2/vendor/magento/module-quote/Model/QuoteManagement.php(354): Magento\Quote\Model\QuoteManagement->submit(Object(Magento\Quote\Model\Quote)) n#19 /var/www/html/magento2/vendor/magento/module-quote/Model/GuestCart/GuestCartManagement.php(87): Magento\Quote\Model\QuoteManagement->placeOrder('12', NULL) n#20 /var/www/html/magento2/vendor/magento/module-checkout/Model/GuestPaymentInformationManagement.php(79): Magento\Quote\Model\GuestCart\GuestCartManagement->placeOrder('99fb88573f13cc3...') n#21 [internal function]: Magento\Checkout\Model\GuestPaymentInformationManagement->savePaymentInformationAndPlaceOrder('99fb88573f13cc3...', 'alberto.gardena...', Object(Magento\Quote\Model\Quote\Payment), Object(Magento\Quote\Model\Quote\Address)) n#22 /var/www/html/magento2/vendor/magento/module-webapi/Controller/Rest.php(265): call_user_func_array(Array, Array) n#23 /var/www/html/magento2/vendor/magento/module-webapi/Controller/Rest.php(160): Magento\Webapi\Controller\Rest->processApiRequest() n#24 /var/www/html/magento2/var/generation/Magento/Webapi/Controller/Rest/Interceptor.php(24): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http)) n#25 /var/www/html/magento2/vendor/magento/framework/App/Http.php(115): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http)) n#26 /var/www/html/magento2/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch() n#27 /var/www/html/magento2/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http)) n#28 {main}
Has someone got the solution about this problem?
Thank you!
Solved! Go to Solution.
It was my fault... i entered a wrong merchant account ID.