和logger.info response.inspect
我得到:
#<ActiveMerchant::Billing::AdaptivePaymentResponse:0x0000000599dc48 @json="{\"responseEnvelope\":{\"timestamp\":\"2012-09-24T04:34:36.888-07:00\",\"ack\":\"Failure\",\"correlationId\":\"22d02b45ed143\",\"build\":\"3692562\"},\"error\":[{\"errorId\":\"540031\",\"domain\":\"PLATFORM\",\"subdomain\":\"Application\",\"severity\":\"Error\",\"category\":\"Application\",\"message\":\"You do not have permission to issue this refund\"}]}", @response=#<Hashie::Rash error=[#<Hashie::Rash category="Application" domain="PLATFORM" error_id="540031" message="You do not have permission to issue this refund" severity="Error" subdomain="Application">] response_envelope=#<Hashie::Rash ack="Failure" build="3692562" correlation_id="22d02b45ed143" timestamp="2012-09-24T04:34:36.888-07:00">>, @xml_request="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<RefundRequest>\n <requestEnvelope>\n <detailLevel>ReturnAll</detailLevel>\n <errorLanguage>en_US</errorLanguage>\n </requestEnvelope>\n <actionType>REFUND</actionType>\n <payKey>AP-2JV97573KK140871P</payKey>\n <currencyCode>USD</currencyCode>\n <feesPayer>EACHRECEIVER</feesPayer>\n</RefundRequest>\n", @request={"RefundRequest"=>{"requestEnvelope"=>{"detailLevel"=>"ReturnAll", "errorLanguage"=>"en_US"}, "actionType"=>"REFUND", "payKey"=>"AP-2JV97573KK140871P", "currencyCode"=>"USD", "feesPayer"=>"EACHRECEIVER"}}, @action="Refund">
response.ack
我得到"Failure"
如果我写logger.info response.error.inspect
,我会得到:
[#<Hashie::Rash category="Application" domain="PLATFORM" error_id="540031" message="You do not have permission to issue this refund" severity="Error" subdomain="Application">]
例如,我如何访问或获得error_id
价值?
谢谢!