#vpellicano

1 messages · Page 1 of 1 (latest)

slow ploverBOT
timber folio
simple jewel
#

That is the weird thing. No error gets logged

#

But I get a return of this:
struct
Charset [empty string]
Errordetail I/O Exception: peer not authenticated
Filecontent Connection Failure
Header [empty string]
Mimetype Unable to determine MIME type of file.
Responseheader
struct [empty]
Statuscode Connection Failure. Status code unavailable.
Text YES

#

then I refresh and it is fine

lilac mist
#

What does "reload the page" mean exactly? This call can only be made server-side in your code

simple jewel
#

Using Coldfusion, when the page loads it checks to see if the user has a customer created.

<cfhttp method="GET" 
        result="httpResp" 
        url='https://api.stripe.com/v1/customers/search'>
    <cfhttpparam type="HEADER" name="Accept" value="*/*">
    <cfhttpparam type="HEADER" name="Content-Type" value="application/json; charset=utf-8">
    <cfhttpparam type="HEADER" name="Authorization" value="Bearer #stripe_apiSecret#" />
    <cfhttpparam type="FORMFIELD" name="query" value="email~'#lcase(getCompanyInfo.ar_email)#'"/>
</cfhttp>
#

if it does not return any results, I do a POST to create one.

lilac mist
#

but you really should never be making that call client-side in a browser

simple jewel
#

oh, ok

lilac mist
#

Sorry I've never used Coldfusion but I assume that if you catch that error and immediately retry (no reload, just 2 sequential calls) it works and it's some weird caching?

simple jewel
#

yeah. Thank you for your help. I will read this article and try another approach at it.