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

Inconsistent naming of IPN keys #32

Closed
adamvr opened this issue Jul 24, 2012 · 3 comments
Closed

Inconsistent naming of IPN keys #32

adamvr opened this issue Jul 24, 2012 · 3 comments

Comments

@adamvr
Copy link

adamvr commented Jul 24, 2012

It's :notify_url for preapprovals and :ipn_notification_url for everything else. Also this difference is undocumented.

Cheers!

@jpablobr
Copy link
Owner

Hey thanks! I think this might help with:

#31

😄

@hyperrjas
Copy link

I have this request but it does not work fine for me with :notify_url :

response = gateway.preapprove_payment( 
  :return_url =>  user_orders_url(current_user),
  :cancel_url => user_orders_url(current_user),
  :requestEnvelope => {"errorLanguage" => "en_US"},
  :senderEmail =>"email",
  :start_date => Time.now,
  :end_date => Time.now + (60*60*24) * 30,
  :currency_code =>"USD",
  :max_amount => "20.00",
  :maxNumberOfPayments => "1",
  :notify_url => ipn_notification_user_orders_url(current_user),
  )

  # for redirecting the customer to the actual paypal site to finish the payment.
  redirect_to (gateway.redirect_url_for(response["preapprovalKey"]))
  p response

This is my response output:

#<ActiveMerchant::Billing::AdaptivePaymentResponse:0xda2d3f4 @json="{\"responseEnvelope\":{\"timestamp\":\"2012-07-24T02:47:38.347-07:00\",\"ack\":\"Success\",\"correlationId\":\"4bae8c7434f9d\",\"build\":\"DEV\"},\"preapprovalKey\":\"PA-5YG488225P076813Y\"}", @response=#<Hashie::Rash preapproval_key="PA-5YG488225P076813Y" response_envelope=#<Hashie::Rash ack="Success" build="DEV" correlation_id="4bae8c7434f9d" timestamp="2012-07-24T02:47:38.347-07:00">>, @xml_request="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<PreapprovalRequest>\n  <requestEnvelope>\n    <detailLevel>ReturnAll</detailLevel>\n    <errorLanguage>en_US</errorLanguage>\n    <senderEmail>email</senderEmail>\n  </requestEnvelope>\n  <endingDate>2012-08-23T11:47:36</endingDate>\n  <startingDate>2012-07-24T11:47:36</startingDate>\n  <maxTotalAmountOfAllPayments>20.00</maxTotalAmountOfAllPayments>\n  <maxNumberOfPayments>1</maxNumberOfPayments>\n  <currencyCode>USD</currencyCode>\n  <cancelUrl>http://localhost:3000/en/u/maserranocaceres/orders</cancelUrl>\n  <returnUrl>http://localhost:3000/en/u/maserranocaceres/orders</returnUrl>\n  <ipnNotificationUrl>http://localhost:3000/en/u/maserranocaceres/orders/ipn_notification</ipnNotificationUrl>\n</PreapprovalRequest>\n", @request={"PreapprovalRequest"=>{"requestEnvelope"=>{"detailLevel"=>"ReturnAll", "errorLanguage"=>"en_US", "senderEmail"=>"microf_1342709287_biz@gmail.com"}, "endingDate"=>"2012-08-23T11:47:36", "startingDate"=>"2012-07-24T11:47:36", "maxTotalAmountOfAllPayments"=>"20.00", "maxNumberOfPayments"=>"1", "currencyCode"=>"USD", "cancelUrl"=>"http://localhost:3000/en/u/maserranocaceres/orders", "returnUrl"=>"http://localhost:3000/en/u/maserranocaceres/orders", "ipnNotificationUrl"=>"http://localhost:3000/en/u/maserranocaceres/orders/ipn_notification"}}, @action="Preapproval">

Where have I the error?

@jpablobr
Copy link
Owner

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

3 participants