Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Doesn't work with Braintree, Paypal via Braintree, Paypal Express Checkout #10

Closed
rg-srini opened this issue Aug 27, 2018 · 5 comments
Closed
Assignees
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Milestone

Comments

@rg-srini
Copy link

Thanks for the module first.

We tested with Magento EE 2.1.4 and 2.2.5 CE with the below payment methods. Not working as expected below.

  • Braintree,
  • Braintree Vault
  • Paypal via Braintree (Sandbox)
  • Paypal Express Checkout

Expected output

  • One order should have been split into 3 orders based on the cart item product attribute value (configured)
  • If a user has authorized a payment of $100 for the entire order, based on the cart items, 3 orders are expected to generated as below.
    • Order 1 - $30
    • Order 2 - $30
    • Order 3 - $40
  • The parent payment transaction should be attached to all other 2 orders.
  • Admin user should be able to create separate invoice the for each order and capture.
  • Admin user should be able to create creditmemo from each of the above generated invoices

.

Thanks,
Srini

@williankeller williankeller self-assigned this Aug 28, 2018
@williankeller williankeller added bug Something isn't working help wanted Extra attention is needed labels Aug 28, 2018
@williankeller
Copy link
Owner

Hi @rg-srini, thanks for your comment, we already have this issue tracked. In fact this module don't work properly with external payment methods. We are working pro provide a new version with these fixes.

@rg-srini
Copy link
Author

Thanks a lot. We are also trying at our end.

Ref:
https://webkul.com/blog/create-payment-transaction-in-magento2/

@wsheldon
Copy link

Hi @rg-srini and @williankeller, I forked this and spent a few days trying to get this to work with Braintree. You'll likely run into the same issues I did which is that, for a vaulted Braintree card, it's fairly easy to get a new payment nonce for each split but for non-vaulted card, you've got to temporarily vault the card to get a re-usable token, which may be against customer's wishes. I didn't even get into PayPal once I hit this obstacle. Ideally, you'd have one auth and captures per split but it looks like Braintree uses the order number as part of allowing a capture, so each capture would have to be against a parent order. Gets pretty complicated. One of the devs on the M2 Slack channel said they did this in the past with 'meta' orders, so one parent order holds all of the payment info and there are meta 'child' orders for warehouse. Hope that helps a bit. Good luck!

@williankeller
Copy link
Owner

Thanks for the feedback @wsheldon, I'll look into the meta orders.

@williankeller
Copy link
Owner

The reason this doesn't work is the same reason why all native Magento online payment modules do not work with the multi-address checkout flow.
Credit card authorizations can only be captured once. In the auth-only order flow, the authorization is redeemed when the order is invoiced.
This creates issues when generating multiple invoices for a single order and/or payment authorization.

The Auth.net CIM module that @pmclain made work with multi-address shipping by creating a separate authorization for each order created when the user places an order. Here's a link to the full group of commits https://github.com/pmclain/module-authorizenetcim/pull/2/commits.
Here was the flow I used at a very high-level:

  1. Card information is tokenized via accept.js client side
  2. Card token is passed with the order placement request for redemption as a new authorization, but the token is a one-time use.
  3. The token is converted to a stored payment source in CIM. The CIM API returns the new payment source which is available for future transactions.
  4. The re-usable payment source is stored in a singleton object.
  5. As each order is created the module pulls the payment source from the singleton.

This approach works but is not ideal because you are forced to store the card in CIM even if the user opted to not store the card for future use via the Magento_Vault. This probably creates compliance issues with privacy laws such as GDPR.

Sorry, I don't have a good answer. This has been something that has bothered me for the last months.

@williankeller williankeller changed the title Does not work with Braintree, Paypal via Braintree, Paypal Express Checkout Doesn't work with Braintree, Paypal via Braintree, Paypal Express Checkout Jan 8, 2019
@williankeller williankeller added the wontfix This will not be worked on label Jan 8, 2019
@williankeller williankeller added good first issue Good for newcomers and removed wontfix This will not be worked on labels May 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants