Hi,
I am using Active merchnat plugin in my Rails Application .When I am specifying the notify_url,after successful transaction it is not called.
Here is my notify url action's Code.
Controller:-
if (notify = Paypal::Notification.new(request.raw_post)).acknowledge
if credit = Credit.find_by_id(notify.invoice)
if notify.complete? && credit.amount == notify.gross.to_f * 100
credit.account.add_credit(credit, notify.transaction_id)
else
logger.info("NotifyId: #{notify.item_id} Status: #{notify.complete?}")
logger.info("Notify details: #{notify.inspect}")
logger.error("Failed to verify Paypal's notification, please investigate")
end
end
end
render :nothing => true
View:-
<% payment_service_for @credit.id, AppConfig["paypal_account"], :amount => @amount, :currency => 'USD', :service => :paypal, :html => { :id => 'paypal_form' } do |service|
service.item_name "Amsapp Credit Balance"
service.invoice @credit.id
service.item_id @credit.id
service.notify_url url_for(:only_path => false, :action => 'credit_notify')
service.return_url url_for(:only_path => false, :action => 'credit_return')
service.cancel_return_url url_for(:only_path => false, :action => 'dashboard') %>
<% end %>
Submitting to PayPal, please wait...
document.getElementById('paypal_form').submit();Thanks in Advance.