cancel
Showing results for 
Search instead for 
Did you mean: 

Add 3D secure command or make executeCommand protected

0 Kudos

Add 3D secure command or make executeCommand protected

Feature request from rikterbeek, posted on GitHub Jul 26, 2016

Hi,

For an 3D secure payment(creditcard) on Adyen (payment provider) you first do a Authorization call to authorize the card. If the card is enrolled for 3D secure the shopper is redirected to the bank page where he can authentication himself. After authentication the shopper comes back to the shop and a second API call needs to be done to validate the 3D secure payment. The nicest way to do this is using the executeCommand through DI in the same way as authorized,refund,cancel and capture. In the Magento\Payment\Model\Method\Adapter file there is no 3D secure command. Could you add this or could you make executeCommand protected instead of private so you can overwrite this in a custom Adapter for your payment method ?

Regards, Rik Adyen

3 Comments
apiuser
New Member

Comment from joni-jones, posted on GitHub Jul 27, 2016

Hi, @rikterbeek.

In the Magento\Payment\Model\Method\Adapter file there is no 3D secure command. Could you add this

For now, we aren't planning to extend payment adapter, but we want to reduce a count of methods in the adapter. In future, we plan to decouple \Magento\Payment\Model\MethodInterface, but I'm not sure about a separate 3D secure method in the adapter. Because each payment method supports own 3D secure implementation, for example, the Braintree shows 3D secure confirmation popup without any redirects and for us is enough to have a simple builder to send options during authorization request for Braintree gateway and don't need to use some method from the adapter. A second example, PayPal process 3D secure verification on their side. But we are open to discussing and need some time to investigate all use cases before decide should we add this method or implement some another way for 3-td party payment integrations.

could you make executeCommand protected instead of private

Perhaps no, because if we had protected methods, we can't do backward incompatible changes for that code, because, we can broking client code. No, we try to remove all protected method and properties as possible.

However, for now, you can implement authorize/sale strategy to decide process 3D secure validation or just do authorization transaction.

apiuser
New Member

Comment from rikterbeek, posted on GitHub Jul 28, 2016

Hi @joni-jones,

So for Adyen Payment provider I am doing the authorize flow to first authorize the payment. Then I redirect the shopper to 3D secure page and after that I need to do a 3D secure call. Now I am calling this: https://github.com/Adyen/adyen-magento2/blob/develop/Model/Api/PaymentRequest.php#L262-L289 But would be better if I can do the request through the DI in the same way as the authorize call.

It would be great if you could create a new public method called customCommand(..) in the adapter that is calling the private executeCommand(same as for example authorize command but then with your custom command) where you can define your customCommand that you want to implement in the DI. The structure will be the same and you are then still backwards compatible. Would that be possible to add ?

Regards, Rik

apiuser
New Member

Comment from joni-jones, posted on GitHub Jul 28, 2016

Hi, Rik.

The structure will be the same and you are then still backwards compatible.

New customCommand won't be backward compatible and can be added in backward incompatible Magento release (in some critical cases it can be earlier), as I know it will be 2.4.

Would that be possible to add ?

As I said in the previous comment, we need to investigate all use cases and decide how we should provide more flexibility for 3-td party developers, now we have some things how we want to do it and your purposes are useful for us. Unfortunately, right now, I can't say can we add some custom public commands in future or not. I will update this ticket as soon as we will choose some decision.

If you have any questions be free to ask them.

Br.