EmpyrNetwork / empyr_web

This repository contains both the Empyr Tracking and Hosted Fields libraries.
1 stars 3 forks source link

Which method/function will call and get params on submit? Angular implementation #11

Closed saqibRafique closed 3 years ago

saqibRafique commented 3 years ago

I have read the whole documentation and understood the information which is required to submit form. I had developed user token, client_id, and client_secret. Now I am not understanding which javascript function will call and get param and get me back success or failure call?

jcuzens commented 3 years ago

There two callbacks you can specify in the setup call: onRegistered: undefined, // The method to call when we have successfully registered. onError: undefined, // The method to call in the event of an error,

If you don't specify an onError callback then the underlying implementation will default to doing a javascript alert. If you don't specify an onRegistered then the form will submit and will include a field REGISTER_DETAILS.

In the event of an onRegistered you'll get a response object that has a details parameter or if you use the field you will get the details in that hidden input element. The format is:

userToken + ':' + cardId + ':' + nonce + ':' + BASE64( sha512( userToken + ':' + cardId + ':' + nonce + ':' + key ) );

saqibRafique commented 3 years ago

Alright Thanks.