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)
You could do something like this…
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!