Reputation: 51
How to use ipn notification with paypal apadaptive payment gem with active merchant? I want to avoid using metal, directly a controller wanna use. rails 3 ruby 1.9.2 Thanks
Upvotes: 0
Views: 411
Reputation: 71
Using like this
response = gateway.setup_purchase(
:return_url => url_for(:action => 'index',:port=>"3001", :only_path => false),
:cancel_url => url_for(:action => 'create',:port=>"3001", :only_path => false),
**:ipn_notification_url => payments_notify_action_url**,
:receiver_list => recipients
)
Here you specify the IPN notification URL and then:
def notify_action
notify = ActiveMerchant::Billing::Integrations::PaypalAdaptivePayment::Notification.new(request.raw_post)
p "Notification object is #{notify}"
if notify.acknowledge
p "Transaction ID is #{notify.transaction_id}"
p "Notification object is #{notify}"
p "Notification status is #{notify.status}"
end
Before that go to the sandbox account.
Upvotes: 1
Reputation: 6132
You may want to check this gem that encapsulates it all for your convenience: https://github.com/jpablobr/active_paypal_adaptive_payment
Upvotes: 0