Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow validatePaymentInstruction() to throw PluginActionRequiredException #79

Open
pluess opened this issue Dec 20, 2012 · 5 comments
Open

Comments

@pluess
Copy link

pluess commented Dec 20, 2012

I'm busy with implementing a payment gateway for saferpay. Since we want to store (a handle to) the credit card information for recurring payments I need a way to do this through the payment controller.

Reading the comments I think PluginControllerInterface::validatePaymentInstruction() would be the method to use.

However, for a complete validation I need to redirect to saferpay two times and wait for a call back url to be called. Looking at PluginController::validatePaymentInstruction() this is not possible right now.

I'd like to have the same mechanism that exists for EntityPluginController::approve() and EntityPluginController::approveAndDeposit() to allow the plugin to throw a PluginActionRequiredException to redirect to a special controller to handle all the saferpay stuff.

Is this something that would make sense for the JMSPaymentCoreBundle?

@schmittjoh
Copy link
Owner

That sounds more as if you'd like to do an approve transaction, validatePaymentInstruction is more intended to verify things like is the credit card number correct, is the cvv number correct etc.

Could you elaborate why an approve transaction does not work here?

@pluess
Copy link
Author

pluess commented Dec 20, 2012

validatePaymentInstruction is more intended to verify things like is the credit card number correct, is the cvv number correct etc.

Well, that is exactly what I need to do. Actually I have to authenticate the credit card and get an anonymized handle for the given credit card data. Using this handle we can charge the user monthly for a subscription.

But I can see your point, I was thinking about approve as well. I could implement this by handling an amount of 0 as an authentication request. But reading the comments at PluginControllerInterface::approve() this doesn't look correct to me. I'm not approving a trasanction, there's no money involved at all. I'm authenticating the credit card and get an anonymized handle for the given credit card.

Since this is a very common operation for payment gatways maybe adding an autenticate() method to the PluginControllerInterface would make sense.

@schmittjoh
Copy link
Owner

It indeed sounds as if we need to provide a special method for this.

I'm wondering whether we need to provide a unified way inside this library (probably via a new interface something like RecurrentPaymentPluginInterface), or whether it is enough if you just add a method to your plugin that you can call from one of your controllers. Are you using the form types of this bundle? How would you integrate this sort of recurrent payment into your payment workflow?

@pluess
Copy link
Author

pluess commented Dec 20, 2012

I checked for this payment gateways:

The least common denominator is that you can request a handle or reference transaction which allows your software to credit money on behalf of the customer. This can be used for all sorts of recurring, online, batch, email, phone payment scenarios.

In addition PayPal Payments Pro lets you set-up a real recurring payments. They will do all the heavy lifting for you, just tell them the amount, period, end date, trial period etc.

I think it would be great to have something like authenticate() or reqeustHandle() on the PluginControllerInterface and PluginInterface. They should behave similar to approve() except that they don't have any amount information.

Since I do have to implement all the heavy lifting for recurring payment anyway, I might find a general solution worth contributing later on. But by now I'm not sure whether this fits into a payment core bundle.

@pluess
Copy link
Author

pluess commented Dec 20, 2012

About the form types: I don't use them. The main reason is that I have to send the credit card information directly to a generated URL of the payment gateway. This means this form will never return to the PluginController.

An other reason is that most checkout processes I'm aware of do have the chooser for the payment method and the form to enter the payment data on seperate pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants