I wanted to put this here as I see a lot of users who I know will probably show me exactly what I am missing (though it doesn't pertain to the DocuSign API but rather Stripe)..
I have been very successful in implementing using stripe for subscriptions using Alphas cURL genie but today I saw 5 different people try to subscribe (I send myself an email when they click the button that on my site opens the a5w page that has the stripe checkout html on it so I know someone attempted to subscribe) but I never got an email saying their subscription was set up (which occurs when they submit the stripe checkout and the token is sent to another a5w page that contains all the cURL code and xBasic that updates my database). The issue I am running into is with the below xBasic generated by the genie:
I expected that flag would be true if the call succeeded and the card was charged and false if it failed and there was an error from stripe (which would end up in ce.error()), however instead the flag_1 returns true no matter what if there was an error (i.e. card declined). I'm fine with this but the problem is the returned JSON (and resulting dot variable in response) from stripe doesn't always have an error property so I am trying to figure out how I can check if the error property exists so that if it does I can show an error to the user and if it doesn't I can tell the user their card was charged. If the error property returned as null when a successful charge occurred I would be fine but the issue I run into is when there is an error my error checking works but when there isn't an error my xBasic fails because it can't find the "response.error" property. I thought I might be able to use variable_exists() but this didn't work so any ideas on what I can do here?
I have been very successful in implementing using stripe for subscriptions using Alphas cURL genie but today I saw 5 different people try to subscribe (I send myself an email when they click the button that on my site opens the a5w page that has the stripe checkout html on it so I know someone attempted to subscribe) but I never got an email saying their subscription was set up (which occurs when they submit the stripe checkout and the token is sent to another a5w page that contains all the cURL code and xBasic that updates my database). The issue I am running into is with the below xBasic generated by the genie:
Code:
flag_1 = ce.Exec() if flag_1 then dim headers as c dim contents as c dim response as p headers = cf_1.GetHeaders() contents = cf_1.GetContent() response = json_parse(contents) else errors = ce.error() end if ce.close()
Comment