spree-contrib / spree-adyen

Adyen payment gateway integration for Spree.
http://guides.spreecommerce.org
MIT License
12 stars 47 forks source link

Adyen Hpp always return payment state as 'balance_due' #25

Open dinshawr opened 8 years ago

dinshawr commented 8 years ago

Hii I am using adyen hpp payment method and in that when I used to do payment. It first goes in a adyen_notification controller and then in adyen_redirect controller why this is happening and because of this my order.payment_state = 'balance_due'. I have set my result url for adyen skin like this

screen shot 2016-02-29 at 3 41 24 pm

and i fetching given logs in staging


2016-02-29T09:52:34.933933+00:00 app[web.1]: Started POST "/adyen/notify" for 82.199.90.162 at 2016-02-29 09:52:34 +0000
2016-02-29T09:52:34.995395+00:00 app[web.1]: #<AdyenNotification id: 123, live: false, event_code: "AUTHORISATION", psp_reference: "8814567395543364", original_reference: nil, merchant_reference: "R004763822", merchant_account_code: "SkinnyMint", event_date: "2016-02-29 09:52:34", success: true, payment_method: "cup", operations: "CANCEL,CAPTURE,REFUND", reason: "97113:0001:6/2016", currency: "USD", value: 2990, processed: false, created_at: "2016-02-29 09:52:34", updated_at: "2016-02-29 09:52:34">
2016-02-29T09:52:34.998896+00:00 app[web.1]: #<Spree::Order id: 190, number: "R004763822", item_total: #<BigDecimal:7f1cfdbbb040,'0.299E2',18(18)>, total: #<BigDecimal:7f1cfdbbaed8,'0.299E2',18(18)>, state: "payment", adjustment_total: #<BigDecimal:7f1cfdbbabb8,'0.0',9(18)>, user_id: 1, completed_at: nil, bill_address_id: 1490, ship_address_id: 1491, payment_total: #<BigDecimal:7f1cfdbba708,'0.0',9(18)>, shipping_method_id: nil, shipment_state: nil, payment_state: nil, email: "admin@skinnymint.com", special_instructions: nil, created_at: "2016-02-29 09:51:05", updated_at: "2016-02-29 09:51:54", currency: "USD", last_ip_address: "14.98.244.177", created_by_id: 1, shipment_total: #<BigDecimal:7f1cfdbb87c8,'0.0',9(18)>, additional_tax_total: #<BigDecimal:7f1cfdbb8610,'0.0',9(18)>, promo_total: #<BigDecimal:7f1cfdbb8390,'0.0',9(18)>, channel: "spree", included_tax_total: #<BigDecimal:7f1cfdbb80e8,'0.0',9(18)>, item_count: 1, approver_id: nil, approved_at: nil, confirmation_delivered: false, considered_risky: false, guest_token: "vFVPL0Z-YqauH29M4j3lPg", locale: nil, state_lock_version: 0, cod_pay: false, cod_amount: nil>
2016-02-29T09:52:34.998901+00:00 app[web.1]: "================="
2016-02-29T09:52:35.040056+00:00 app[web.1]: true
2016-02-29T09:52:35.071314+00:00 app[web.1]: Completed 200 OK in 129ms (Views: 1.3ms | ActiveRecord: 37.8ms)
2016-02-29T09:52:34.942513+00:00 app[web.1]: Processing by Spree::AdyenNotificationsController#notify as HTML
2016-02-29T09:52:34.942547+00:00 app[web.1]:   Parameters: {"originalReference"=>"", "reason"=>"97113:0001:6/2016", "merchantAccountCode"=>"SkinnyMint", "eventCode"=>"AUTHORISATION", "operations"=>"CANCEL,CAPTURE,REFUND", "success"=>"true", "paymentMethod"=>"cup", "currency"=>"USD", "pspReference"=>"8814567395543364", "merchantReference"=>"R004763822", "value"=>"2990", "live"=>"false", "eventDate"=>"2016-02-29T09:52:34.67Z"}
2016-02-29T09:52:34.994935+00:00 app[web.1]: "****************"
2016-02-29T09:52:34.998095+00:00 app[web.1]: "-----------------"
2016-02-29T09:52:35.070862+00:00 app[web.1]:   Rendered text template (0.1ms)
2016-02-29T09:52:35.072485+00:00 heroku[router]: at=info method=POST path="/adyen/notify" host=skinnymint-staging.herokuapp.com request_id=fa482dfe-185d-4860-a7b1-087104e269e7 fwd="82.199.90.162" dyno=web.1 connect=1ms service=144ms status=200 bytes=1095
2016-02-29T09:52:35.257705+00:00 app[web.1]: Started GET "/checkout/payment/adyen?merchantReference=R004763822&skinCode=Ht6pEehJ&shopperLocale=en_GB&paymentMethod=cup&authResult=AUTHORISED&pspReference=8814567395543364&merchantSig=6iGFzqpQGzC%2BN5S8Ka40HzJnc2I%3D" for 14.98.244.177 at 2016-02-29 09:52:35 +0000
2016-02-29T09:52:35.426005+00:00 heroku[worker.1]: source=worker.1 dyno=heroku.27467940.951f889c-bd3d-4776-878d-39a9cb8273c0 sample#load_avg_1m=0.00
2016-02-29T09:52:35.426102+00:00 heroku[worker.1]: source=worker.1 dyno=heroku.27467940.951f889c-bd3d-4776-878d-39a9cb8273c0 sample#memory_total=198.16MB sample#memory_rss=198.15MB sample#memory_cache=0.02MB sample#memory_swap=0.00MB sample#memory_pgpgin=54733pages sample#memory_pgpgout=4003pages
2016-02-29T09:52:35.456552+00:00 app[web.1]: Processing by Spree::AdyenRedirectController#confirm as HTML
2016-02-29T09:52:35.456592+00:00 app[web.1]:   Parameters: {"merchantReference"=>"R004763822", "skinCode"=>"Ht6pEehJ", "shopperLocale"=>"en_GB", "paymentMethod"=>"cup", "authResult"=>"AUTHORISED", "pspReference"=>"8814567395543364", "merchantSig"=>"6iGFzqpQGzC+N5S8Ka40HzJnc2I="}
2016-02-29T09:52:36.025014+00:00 heroku[router]: at=info method=GET path="/checkout/payment/adyen?merchantReference=R004763822&skinCode=Ht6pEehJ&shopperLocale=en_GB&paymentMethod=cup&authResult=AUTHORISED&pspReference=8814567395543364&merchantSig=6iGFzqpQGzC%2BN5S8Ka40HzJnc2I%3D" host=skinnymint-staging.herokuapp.com request_id=95aeeaf2-abac-4491-9ca1-b2bceb39f7aa fwd="14.98.244.177" dyno=web.1 connect=0ms service=804ms status=302 bytes=1472
2016-02-29T09:52:36.022699+00:00 app[web.1]: Completed 302 Found in 566ms (ActiveRecord: 90.1ms)
2016-02-29T09:52:36.022193+00:00 app[web.1]: Redirected to https://skinnymint-staging.herokuapp.com/orders/R004763822?token=vFVPL0Z-YqauH29M4j3lPg

Please help me out where I am wrong.

priyank-gupta commented 8 years ago

@dinshawr I think this is related to https://github.com/spree-contrib/spree-adyen/issues/14