When I catch the exception from the square charge object, I am returned with [HTTP/1.1 400 Bad Request] {"errors":[{"category":"INVALID_REQUEST_ERROR","code":"CARD_TOKEN_USED","detail":"Card nonce already used; please request new nonce."}]}
I want to extract only "detail" to convey to the user. How do I do this. I tried $e->getDetail()
and $e->getMessage()->getDetail()
and $e['detail']
and $e['errors'][0]['detail']
but nothing is working. How do I do this? Using php connect library