Open rahuldambare opened 1 day ago
Hi @rahuldambare. Thank you for your report. To speed up processing of this issue, make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce.
@magento I am working on this
Join Magento Community Engineering Slack and ask your questions in #github channel. :warning: According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting. :clock10: You can find the schedule on the Magento Community Calendar page. :telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.
I have one observer which add this custom amount item in cart, I think that is not working for magento 2.4.6
<event name="payment_cart_collect_items_and_amounts">
<observer name="paymentfee" instance="MyModule\CoreCredit\Observer\AddCustomAmountItem" />
</event>
public function execute(Observer $observer)
{
/** @var \Magento\Payment\Model\Cart $cart */
$cart = $observer->getEvent()->getCart();
$customAmount = -(float)$this->helper->calculateCreditbalance();
\Magento\Framework\App\ObjectManager::getInstance()->get('Psr\Log\LoggerInterface')->debug('@@@ >>> Payment Check PartSimple\CoreCredit\Plugin >>> ' . $customAmount);
$cart->addCustomItem(__('Credit Amount'), 1, $customAmount, 'creditamount');
}
Summary
I am working on custom discount for Magento using this blog https://meetanshi.com/blog/add-custom-discount-in-magento-2/, but it is not adding that custom discount while sending request to payment Braintree Request not adding custom discount and customer charged full amount .
For Paypal I have made adjustment as per https://github.com/magento/magento2/issues/5735 , which is working fine . module-paypal/Model/Apiu/Nvp.php function callSetExpressCheckout at Line 812 add before "$response = $this->call(self::SET_EXPRESS_CHECKOUT, $request);" this snipped: $request['ITEMAMT'] = $request['AMT'] - $request['TAXAMT'] - $request['SHIPPINGAMT'];
Only facing issue with Braintree payment where custom discount is applied .
Magento version 2.4.6p3 PHP 8
Please check and provide solution for this as its affecting production sales. ` <?php
namespace MyModule\CoreCredit\Model\Quote\Address\Total;
class CustomDiscount extends \Magento\Quote\Model\Quote\Address\Total\AbstractTotal {
} `
Examples
Proposed solution
Custom Discount should add in braintree request or in discount field for Braintree request and final total should be minus of that discount
Release note
No response
Triage and priority