Inconsistent naming of IPN keys #32

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

Projects

None yet

3 participants

@adamvr
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
Owner

Hey thanks! I think this might help with:

#31

😄

@hyperrjas

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 jpablobr closed this Jul 31, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment