Page 1 of 2

Zooz Payment JS lib integration problem

Posted: Mon Aug 12, 2013 10:48 am
by Ram

Dear All,

I'm straggling with the implementation of Zooz payment JS lib, from zooz developer guide:

Image

on the server side all is working well but the client return an error:

ReferenceError: zoozStartCheckout is not defined

i tried to add the JS script src to the head of the HTML file... no success.
i tried to add the JS script src to the JavaScript itself... no success.
i tried to add the file through "Create from URL"

Image

can anyone help me figure this out please?


Zooz Payment JS lib integration problem

Posted: Mon Aug 12, 2013 12:02 pm
by Oleg Danchenkov

It's really strange. It works fine for me.
You can try to insert js code manually. (create empty JS asset and insert code from https://app.zooz.com/mobile/js/zooz-e... in it)


Zooz Payment JS lib integration problem

Posted: Mon Aug 12, 2013 12:18 pm
by Ram

Thx Oleg for your reply!
i managed to add the content of the file using "Create from URL" using your link, now, where did you add the JS reference source line:

Image

thx much once again!


Zooz Payment JS lib integration problem

Posted: Mon Aug 12, 2013 12:26 pm
by Oleg Danchenkov

You dont need this line. JS code is already in your project. And it's available from all pages


Zooz Payment JS lib integration problem

Posted: Mon Aug 12, 2013 12:40 pm
by Ram

then i'm missing something here... just to make sure we are on the same page here, my application is a web app, i'm not using any of zooz's native libs...

so, to recap, new web app project, one page and one JS file with the content of the JS file from your link above, one button that invoke a rest service and get in response the token form zooz followed by this JS code on Success event:

var myToken = localStorage.getItem('ZoozToken');
alert (myToken);
zoozStartCheckout({
token: myToken, // Session token recieved from server
uniqueId: "com.xxxx.yyyy", // unique ID as registered in the developer portal
isSandbox: true, // true = Sandbox environment
returnUrl: "http://50.19.xxx.yyy/ZoozCSSample/Ret...", // return page URL
cancelUrl: "http://50.19.xxx.yyy/ZoozCSSample/Fai..." // cancel page URL
});

and this is the result after i get the token:

Image


Zooz Payment JS lib integration problem

Posted: Mon Aug 12, 2013 3:50 pm
by Ram

this isnt working for me... any thoughts? please....


Zooz Payment JS lib integration problem

Posted: Mon Aug 12, 2013 4:06 pm
by Kateryna Grynko

Hi Ram,

Maybe you changed some files on Source tab. Please try deleting them and then clicking "Undo all source changes".


Zooz Payment JS lib integration problem

Posted: Mon Aug 12, 2013 7:18 pm
by Ram

Thx Katya,

unfortunately i dont have any good news, in fact, there's something very disturbing here:

by design, you contact zooz with an amount and in return you get a token, using that token you call "zoozStartCheckout" function, now, i created a rest service that successfully connect to my server and in response i receive the token from zooz via my server

Image

then i need to call to the function "zoozStartCheckout" and pass it the relevant params, so far so good, however, once i put the content of the JS file https://app.zooz.com/mobile/js/zooz-e... into a new JS asset then the service stop working, no error raised, no script errors, no service events fired... nothing... nada :)

needless to say that i cleared all history/cashe/data/etc from browser and still i get the same result.

so... any thoughts? many thanks in advance!!!


Zooz Payment JS lib integration problem

Posted: Mon Aug 12, 2013 8:27 pm
by Kateryna Grynko

Hi Ram,

Please share your app with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a


Zooz Payment JS lib integration problem

Posted: Mon Aug 12, 2013 9:34 pm
by Ram

i just did, thx much in advance!