【发布时间】:2015-02-24 11:46:59
【问题描述】:
我收到了来自授权宝石的以下回复,我想提取牵引号码,即 2226171485
#<AuthorizeNet::CIM::Response:0xc0eafb8 @raw_response=#<Net::HTTPOK 200 OK readbody=true>, @transaction=#<AuthorizeNet::CIM::Transaction:0xbffe21c @fields={:customer_profile_id=>"30751733", :customer_payment_profile_id=>"27849165", :line_items=>[], :amount=>150}, @api_login_id="2yC2cP8t5HEf", @api_transaction_key="2nr96MZ2Bdmu8S3V", @response=#<AuthorizeNet::CIM::Response:0xc0eafb8 ...>, @type="createCustomerProfileTransactionRequest", @verify_ssl=false, @reference_id=nil, @gateway="https://apitest.authorize.net/xml/v1/request.api", @delim_char=",", @encap_char=nil, @custom_fields={}, @transaction_type=:auth_capture, @xml="<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<createCustomerProfileTransactionRequest xmlns=\"AnetApi/xml/v1/schema/AnetApiSchema.xsd\">\n <merchantAuthentication>\n <name>2yC2cP8t5HEf</name>\n <transactionKey>2nr96MZ2Bdmu8S3V</transactionKey>\n </merchantAuthentication>\n <transaction>\n <profileTransAuthCapture>\n <amount>150</amount>\n <customerProfileId>30751733</customerProfileId>\n <customerPaymentProfileId>27849165</customerPaymentProfileId>\n </profileTransAuthCapture>\n </transaction>\n</createCustomerProfileTransactionRequest>\n">, @root=#<Nokogiri::XML::Element:0x607575a name="createCustomerProfileTransactionResponse" namespace=#<Nokogiri::XML::Namespace:0x60756e2 href="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> children=[#<Nokogiri::XML::Element:0x606c3ee name="messages" namespace=#<Nokogiri::XML::Namespace:0x60756e2 href="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> children=[#<Nokogiri::XML::Element:0x60750a2 name="resultCode" namespace=#<Nokogiri::XML::Namespace:0x60756e2 href="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> children=[#<Nokogiri::XML::Text:0x606c060 "Ok">]>, #<Nokogiri::XML::Element:0x606bf84 name="message" namespace=#<Nokogiri::XML::Namespace:0x60756e2 href="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> children=[#<Nokogiri::XML::Element:0x60749f4 name="code" namespace=#<Nokogiri::XML::Namespace:0x60756e2 href="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> children=[#<Nokogiri::XML::Text:0x606bbf6 "I00001">]>, #<Nokogiri::XML::Element:0x6074346 name="text" namespace=#<Nokogiri::XML::Namespace:0x60756e2 href="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> children=[#<Nokogiri::XML::Text:0x606b976 "Successful.">]>]>]>, #<Nokogiri::XML::Element:0x606d9b0 name="directResponse" namespace=#<Nokogiri::XML::Namespace:0x60756e2 href="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> children=[#<Nokogiri::XML::Text:0x606b61a "1,1,1,This transaction has been approved.,XVJDGT,Y,2226171485,,,150.00,CC,auth_capture,36,,,,,,,,,,,baran.khan@ccjk.com,,,,,,,,,,,,,,D16E802BF6C1854F220DF0C88900557A,,2,,,,,,,,,,,XXXX0012,Discover,,,,,,,,,,,,,,,,">]>]>, @result_code="Ok", @message_code="I00001", @message_text="Successful.", @reference_id=nil, @customer_profile_id=nil, @customer_payment_profile_id=nil, @customer_payment_profile_id_list=nil, @customer_shipping_address_id_list=nil, @customer_address_id=nil, @validation_direct_response_list=nil, @validation_direct_response=nil, @direct_response=#<Nokogiri::XML::Element:0x606d9b0 name="directResponse" namespace=#<Nokogiri::XML::Namespace:0x60756e2 href="AnetApi/xml/v1/schema/AnetApiSchema.xsd"> children=[#<Nokogiri::XML::Text:0x606b61a "1,1,1,This transaction has been approved.,XVJDGT,Y,2226171485,,,150.00,CC,auth_capture,36,,,,,,,,,,,baran.khan@ccjk.com,,,,,,,,,,,,,,D16E802BF6C1854F220DF0C88900557A,,2,,,,,,,,,,,XXXX0012,Discover,,,,,,,,,,,,,,,,">]>, @customer_profile_id_list=nil, @address=nil, @payment_profile=nil, @profile=nil>
【问题讨论】:
标签: ruby-on-rails ruby authorize.net