FAQs
Getting error while triggering a transaction
I am getting a `Network Error` while triggering a transaction. The flow is as follows.
1. User login with Smallcase SDK.
2. Got the Smallcase Auth token.
3. User changes the auth token in the cookies and refreshes the page.
4. User clicks on the login button as we already have Smallcase auth token we have initialized the SDK (with the invalid token).
5. The initialization fails, so we have asked the user to log in again.
6. When the user tries to log in we are going `Network Error` at the `triggerTransaction` method of SDK. Moreover, it's not showing any error info except `Network Error`.
Can you help us to resolve this issue?
Posted by Hafeezul Kareem almost 3 years ago
JavaScript SDK
Hi,
Please provide proper documentation, how implement to javascript Sdk.
const scGateway = new scDK({
gateway:gatewayName,
smallcaseAuthId: authToken,
config: {
amo: true
}
})
scGateway.triggerTransaction({
transactionId: 'transactionId'
})
.then(res => res)
.catch(err => err.message);
});
I using this code but no any response.
Posted by Sandeep almost 3 years ago
Guest user is not connected even after completing broker login.
Hi, I am initializing the SDK with guest auth token and then perform broker login, but I am still being prompted to login with a broker if I try to execute buy/sell transaction. This does not happen if I provide an auth token created by signing an auth id.
After transaction workflow is completed I am decoding the authtoken I received and storing the authid. My question is whether I have to reinitialize the client sdk with the auth id I received for the guest user to be authenticated properly and prevent any further login prompts.
I tried reinitializing but when I try to trigger any buy/sell workflows, the sdk still prompts me with login to broker page.
Here is my source code:
https://gist.github.com/BhayanakMoth/db06c9963be521b5d40f62c847ce2514
Posted by Nipun Ramani almost 3 years ago
Javascript SDK Error when login() is called
Hey I am trying to log in using javascript sdk but I am getting an error that says
```text
Uncaught (in promise) TypeError: Cannot read property 'toLowerCase' of undefined
at ie (scdk.js:1)
at e.<anonymous> (scdk.js:1)
at u (scdk.js:1)
```
code:
```javascript
function connect() {
requestOptions = {
method: 'POST'
}
fetch("http://localhost:8080/smallcase/authenticate",requestOptions).then(res => {
res.text().then(async body => {
console.log(body);
const scGateway = new scDK({
gateway: <mygateway>, // Using the gateway that was provided
smallcaseAuthToken: body,
config: {}
});
await scGateway.initPromise; // This promise is fulfilled.
await scGateway.login(); // Error thrown here
});
})
};
```
signup method runs fine and the dialog box for smallcase shows up, is there something else that I need to provide?
Posted by Nipun Ramani almost 3 years ago