Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8440155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:12:32+00:00 2026-06-10T08:12:32+00:00

I have a response @response from Sage Pay: VPSProtocol=2.23 Status=OK StatusDetail=Server transaction registered successfully.

  • 0

I have a response @response from Sage Pay:

VPSProtocol=2.23 Status=OK StatusDetail=Server transaction registered successfully. VPSTxId={C9B14A59-1EB7-4A56-A4B1-29B84BE4861B} SecurityKey=VGGPR12XC1 NextURL=https://test.sagepay.com/Simulator/VSPServerPaymentPage.asp?TransactionID={C9B14A59-1EB7-4A56-A4B1-XXXXXXXXXXXXX} 

How can I split this into a hash of:

@response['VPSProtocol'] = "2.23"
@response['Status'] = "OK"
....

?

(Params in the response are newline separate \r\n)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T08:12:33+00:00Added an answer on June 10, 2026 at 8:12 am

    You could do something like this…

    response = "VPSProtocol=2.23\r\nStatus=OK\r\nStatusDetail=Server transaction registered successfully."
    response_hash = {}
    
    response.split("\r\n").map do |value|
      key, value = value.split("=")
      response_hash[key] = value
    end
    
    print response_hash
    

    I’m sure there’s a handy method in ruby to do this kind of mapping, but thats a quick solution. Would love to hear some better ideas from the community!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following array response from a server to an android app. [
I have a response from remote server like this: /home/computer/Downloads |-- /home/computer/Downloads/Apple | `--
I have the following code that reads response from a POP server through Sockets
I have generic async task class which fetches response from server . And i
I have the following scenario: I am parsing a JSON Response from a server
I have these strings as a response from a FTP server: 02-17-11 01:39PM <DIR>
i have this response from a socket server: [DataEvent type=data bubbles=false cancelable=false eventPhase=2 data=Segunda
I have questions about 'Response' from server. 'content in HTTP Response' is same meaning
I have a very large response from server of JSON string. I converted it
I'm getting a JSON response from the server and i have to loop through

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.