-
Notifications
You must be signed in to change notification settings - Fork 70
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
Instant Payment Notifications (IPN) #56
Comments
@schmittjoh After struggling for a few days, I've finally been able to integrate paypal's IPN with this bundle. I have updated this issue's description to reflect the problems I had and I'm reopening it. For whoever is interested, I created a Service that you can drop into your application and automagically have IPN notifications handled for you. With this Service, you simply do: <?php namespace Acme\SomeBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller
class OrdersController extends Controller
{
public function paypalIpnAction ()
{
$notification = $this->getRequest()->request->all();
$ipnHandler = $this->get('acme.paypal_ipn.handler');
// This will trigger calls to the correct JMSPaymentCore methods
// according to the type of notification. After this call, the
// JMSPaymentCore DB tables will have been updated.
$ipnHandler->process($notification);
}
} It uses two dirty hacks to workaround the current architecture but it's functional. You can get it here: https://gist.github.com/4600319 |
@regularjack why you don't do a pull request with that changes? |
@CayetanoSoriano Because this is not a clean solution for the problem. The correct way is for the bundle to expose an API for payment notifications. |
Add a default_method option to the Choose form
AFAICT there is no clean way of handling payment notifications with the JMSPayment bundles. The current architecture assumes that any change in a Payment's state will be originated by the bundle itself. However, this is not always true: for instance, in the case of Paypal, a Refund will arguably almost always be done in Paypal's own web interface.
I should be able to easily tell the bundle that a certain payment was refunded as opposed to asking it to Refund it. There is a subtle but important difference. A concrete example of what I mean follows.
If I call
there will always be an external API call that will ask Paypal for a refund. However, what I need is something functionally equivalent to
that will only update the local model and make no external API calls.
Is something like this part of the future plans for this bundle?
The text was updated successfully, but these errors were encountered: