You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Got error from omnipay/auth.net code (php didn't throw exception):
"json_decode() expects parameter 1 to be string, array given"
It would be nice if the returned error was a little more appropriate for the cause of the error.
"Card Reference must be this, this or this. You submitted this."
The details:
I am writing code to charge a token through authorize.net. I am storing a previously generated card reference in my database as a json string.
This looks something like this:
{"customerProfileId":"#######","customerPaymentProfileId":"#######"}
When it came time to actually charge it, I decoded it:
Ignore submit data, it is a master array I build, handleErrorReturn is just a method I can format errors in a more use friendly output, and log advanced details.
The problem is that I would land in the catch, and the message would be:
"json_decode() expects parameter 1 to be string, array given"
It isn't php blowing up, it's code inside omnipay or the auth.net plug in and because I was just recently decoding something it took me a second to realize my code was ok, that I didn't need to decode the token.
It would be nice if the returned error was a little more appropriate for the cause of the error.
"Card Reference must be this, this or this. You submitted this."
The text was updated successfully, but these errors were encountered:
TL;DR:
Charge token,
'cardReference' => json_decode($token),
Got error from omnipay/auth.net code (php didn't throw exception):
"json_decode() expects parameter 1 to be string, array given"
It would be nice if the returned error was a little more appropriate for the cause of the error.
"Card Reference must be this, this or this. You submitted this."
The details:
I am writing code to charge a token through authorize.net. I am storing a previously generated card reference in my database as a json string.
This looks something like this:
{"customerProfileId":"#######","customerPaymentProfileId":"#######"}
When it came time to actually charge it, I decoded it:
Than actually sending the charge:
Ignore submit data, it is a master array I build, handleErrorReturn is just a method I can format errors in a more use friendly output, and log advanced details.
The problem is that I would land in the catch, and the message would be:
"json_decode() expects parameter 1 to be string, array given"
It isn't php blowing up, it's code inside omnipay or the auth.net plug in and because I was just recently decoding something it took me a second to realize my code was ok, that I didn't need to decode the token.
It would be nice if the returned error was a little more appropriate for the cause of the error.
"Card Reference must be this, this or this. You submitted this."
The text was updated successfully, but these errors were encountered: