Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recurly_TransactionError getMessage function returns a malformed xml string #21

Closed
steve-obrien opened this issue Dec 5, 2011 · 2 comments
Labels
V2 V2 Client

Comments

@steve-obrien
Copy link

<Recurly_TransactionError error_code="invalid_card_number" error_category="hard" customer_message="Your card number is not valid. Please update your card number." transaction_error="The credit card number is not valid. The customer needs to try a different number.">, credit card number is not valid, <Recurly_Transaction[href=https://api.recurly.com/v2/transactions/6151034b49074dd3be280632b657f46e] account=<Recurly_Stub[account] href=https://api.recurly.com/v2/accounts/steve@studio123.com>, action="authorization", amount_in_cents=0, created_at="2011-12-05 18:42:29 +00:00", currency="GBP", details=[<Recurly_Account[new] account_code="steve@studio123.com", billing_info="<Recurly_BillingInfo[new] card_type="Visa", first_six="400000", last_four="0051", month=1, year=2012>", email="steve@studio123.com">], recurring=false, refundable=false, status="declined", tax_in_cents=0, test=true, transaction_error="<Recurly_TransactionError error_code="invalid_card_number" error_category="hard" customer_message="Your card number is not valid. Please update your card number." transaction_error="The credit card number is not valid. The customer needs to try a different number.">", uuid="6151034b49074dd3be280632b657f46e", voidable=false>.

Is this correct or should it just return the customer message? Or maybe an array of customer message, merchant message

@steve-obrien
Copy link
Author

This seems true for all tansaction errors handled by the Recurly_TransactionError class.

The error message returned is correct but the xml string returned by the exception is malformed and is not possible to parse.

<Recurly_TransactionError error_code="invalid_card_number" error_category="hard" customer_message="Your card number is not valid. Please update your card number." transaction_error="The credit card number is not valid. The customer needs to try a different number.">, credit card number is not valid, <Recurly_Transaction[href=https://api.recurly.com/v2/transactions/81f6d5cdc24345a5a4498d508f09398c] account=<Recurly_Stub[account] href=https://api.recurly.com/v2/accounts/steve@studio123.com>, action="authorization", amount_in_cents=0, created_at="2011-12-06 10:31:05 +00:00", currency="GBP", details=[<Recurly_Account[new] account_code="steve@studio123.com", billing_info="<Recurly_BillingInfo[new] card_type="Visa", first_six="400000", last_four="0051", month=1, year=2012>", email="steve@studio123.com">], recurring=false, refundable=false, status="declined", tax_in_cents=0, test=true, transaction_error="<Recurly_TransactionError error_code="invalid_card_number" error_category="hard" customer_message="Your card number is not valid. Please update your card number." transaction_error="The credit card number is not valid. The customer needs to try a different number.">", uuid="81f6d5cdc24345a5a4498d508f09398c", voidable=false>.

@drewish
Copy link

drewish commented Feb 8, 2013

Sorry this sat for so long without a response. I'm really not sure why we have all the various __toString() methods that generate XML-esq strings. In some instances we use it to serialize the objects for submission to the server but since we never serialize TransactionErrors it really has no use. So sort version is, just use the properties ($customer_message, $error_code, etc) and ignore the to string version.

@drewish drewish closed this as completed Feb 8, 2013
@bhelx bhelx added the V2 V2 Client label Mar 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V2 V2 Client
Projects
None yet
Development

No branches or pull requests

3 participants