I am designing a script to interpret the results returned from a payment gateway.
The returned information is in the form of a text string with the information I require forming part of the string in a field=value pairs.
I cannot seem to come up with an expression to effectively extract these pairs to an array. Ideally I would like to put these values into an associative array (array[field]=value). If possible extracting the information above the pairs as form of receipt.
Here is an example of the string I am dealing with -
declined 00015X366539 Transaction No: 00xxxxxx ------------------------ COUNTRY CODE AU 14/11/07 23:51 RRN 00015X366539 VISA XXXXXXXXXXX CREDIT A/C 11/07 AUTHORISATION NO: DECLINED 31 PURCHASE $155.00 TOTAL AUD $155.00 (SUBJECT TO CARDHOLDER'S ACCEPTANCE) ------------------------ . settlement_date=15/11/07 card_desc=VISA status=declined txn_ref=XXXXXXXXXXXXXXX refund_mode=0 transaction_no=XXXXXXX rrn=00015X366539 response_text=INVALID CARD pld=0 total_amount=15500 card_no=XXXXXXXXXXX version=V1.0 merchant_index=1096 card_expiry=xx/xx training_mode=0 operator_no=xxxxxxx response_code=31 card_type=6 approved=0 cashout_amount=0 receipt_array=ARRAY(0x834f8ac) account_type=CREDIT A/C result=0
Can anyone help with this?
Cheers