I have not found nowhere a solution for my problem, so i'll ask to this beautiful community directly. I'm trying to customize the Paypal Express Checkout cause for our payments we have a Different Payment Provider from Magento, so all I need is to peel off the BAID ( Billing Agreement Identification ) code from Paypal and pass it to my Payment Provider that will sent all the payments directly on the Paypal account of the client.
I've already configure Paypal Express on my site, I've configure Paypal Express Checkout with Payment Action -> Authorization and in Advanced setting Billing Agreement Signup -> Auto , cause i want only to take the Billing Agreement ID from Paypal. I have sandbox credentials for now.
What I want to do is to display the product in the cart without change his price, after a customer click on Paypal Express Checkout button and the Paypal pop-up shows up, i want that the Authorization order of Paypal set product price at 0, so after that I can send that authorization order and detach the BAID, after which I will send it to my Payment Provider who will continue with everything else.
I've tryed different solutions, like :
https://webkul.com/blog/add-custom-pricefee-order-total-magento2/ -> setting a custom Price Fee but i recieved this error :
[2021-03-11 14:16:56] main.CRITICAL: PayPal NVP gateway errors: The totals of the cart item amounts do not match order amounts (#10413: Transaction refused because of an invalid argument. See additional error messages for details). Correlation ID: 1630fdd2edef9. Version: 72.0
so after that i've tried this : https://webkul.com/blog/manage-custom-amount-paypal-magento2/ -> but it doesn't work for me cause I receive the same error and it's also not a solution that suite my case.
I also tried to modify the paypal sdk code to be able to insert the value of the product to 0 manually, although it is not an optimal solution, but it doesn't work that way either.
Someone could help me to find a solution?
Thanks in advice for everyone!