FAQs
InitGateway Issue in Flutter SDK
Hello Team,
I am facing issue while initialising Gateway using ScgatewayFlutterPlugin.
I have set Environment config params: (GatewayEnvironment.DEVELOPMENT, {my_gateway}, true, [])
that returns with Future {"success": true}
Code for initialising Gateway
```
ScgatewayFlutterPlugin.setConfigEnvironment(
GatewayEnvironment.DEVELOPMENT, {my_gateway}, true, []).then((value) {
String authToken =
{my_auth_token};
ScgatewayFlutterPlugin.initGateway(authToken).then((value) {
print("Init gateway complete: $value");
});
});
```
authToken is generated with secret provided, expiresIn time "1d" and {guest: true} using jwt as suggested in documentation.
I am getting output as:
D/Android_Native_Scgateway( 6338): onFailure: internal_error
I/flutter ( 6338): Init response: {"errorCode":2000,"errorMessage":"internal_error"}
I/flutter ( 6338): Init gateway complete: {"errorCode":2000,"errorMessage":"internal_error"}
Please help me with this asap
Thanks
Posted by Rishabh Sharma almost 3 years ago
Not getting proper response
as per docs in tiggertransaction promise if I am using expired transactionId then I should get transactionId expired error .... but always I am getting Error occurred during transaction .
await SmallcaseGateway.triggerTransaction("TRX_792147332a7444aea91bd89885c33f9c")
.then((res) => console.log("res", res))
.catch((err) => console.log("err", err));
Even when I am trying to login and cancel in between then also I just get Error occurred during transaction... not getting error code or any other msg in res...
Posted by Arpit Chandak 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 about 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 about 3 years ago