Invalid source object: must be a dictionary or a non-empty string

InvalidRequest in ApiRequestor.php line 144:
Invalid source object: must be a dictionary or a non-empty string. See API docs at https://stripe.com/docs

e4cf5a315e510b5c1572468944f84f2b

looks like a problem with the stripeToken (source)

Solved by?

c4c6fab68e8468018c00a7c8d6d2f99a

_token is laravel CSRF token not stripeToken.

Check your form id is correct in HTML and script.

7029e9d17864cb02f3b06c41069eb2b2

Check your publish key is there.

unnamed (2)

Check JS errors which may be cleared by page navigation.

cf9d8aceb73ced83219891ca1df2ebab

Check you don’t have mutiple functions of the same name. ie – 2 stripe forms both calling the same event handler.

76f3efe6debfdb469b773eeecad69531

when you fix it you should see the stripeToken in the POST request

282202cbe74eeceb85e5a801fcfa5f58

Sam Deering is a web developer from England (currently living in Australia). In his spare time he enjoys coding, playing chess, reading and investing.

Leave a Reply

Your email address will not be published. Required fields are marked *