# 4.2 Adding the wallet client
To add the wallet client, please load the following script:
Test environment:
<link href="https://wallet-sdk-v3-test.mycheckapp.com/latest/static/css/main.css" rel="stylesheet"></link>
<script src="https://wallet-sdk-v3-test.mycheckapp.com/latest/static/js/main.js"></script>
Sandbox environment:
<link href="https://wallet-sdk-v3-sandbox.mycheckapp.com/latest/static/css/main.css" rel="stylesheet"></link>
<script src="https://wallet-sdk-v3-sandbox.mycheckapp.com/latest/static/js/main.js"></script>
Production environment:
<link href="https://wallet-sdk-v3.mycheckapp.com/latest/static/css/main.css" rel="stylesheet"></link>
<script src="https://wallet-sdk-v3.mycheckapp.com/latest/static/js/main.js"></script>
# 4.2.1 Authorizing the wallet:
To authorize your wallet, you need to call connect. The connect method can accept 2 parameters:
publishableKey - a public authorization key received from Shiji
refreshToken – a token created by authorizing a new user (by calling POST usersUrl/api/v1/createRefresh)
Connect: (authorization)
mycheck.auth.connect({
publishableKey: '<Ask Shiji for a publishable key>',
refreshToken: '<Created using the createRefresh call>'
});
# Important note
Wallet placeholder:
<div id="mycheck-wallet-v3"></div>
To initialize Shiji’s wallet, we require to add the div above with a mycheck-wallet-v3 ID. It prevents a collision between the code of the wrapping client (created by the customer) and the wallet’s code.
# 4.2.2 Initializing the wallet:
mycheck.wallet.init(
{
"settings": {
"locale": "es", //optional-default is en (language code in ISO 639-1)
"merchant_id": 3877, //required
"view": "CHECKOUT" //required - can be either CHECKOUT or MANAGE
},
"payment_details": { // required when loading with view=CHECKOUT
"currency": "string", // required
"amount": "string", // required
"return_url": "string", // optional - the return URL to be redirected to in case of an instant payment
"callback_url": "string", // optional -the callback URL to be notified about a an instant payment results
"metadata": {} // optional - metadata (more information) to be added to the transaction recorded by mycheck - should be an object of a key => value
}
}
);
To initialize the wallet, you need to call the init method. The init method can accept 4 parameters:
view – (required)
Accepts either “CHECKOUT” or “MANAGE” Sets whether the wallet should initialize in a checkout view (payment view) or in a manage payment view (used for payment management for returning customers, usually under its profile settings page)locale – (optional – while default is en) sets the language of the wallet’s UI.
The accepted language should be of type ISO 639-1.Supported languages
Code Language en_US English de_DE German es_ES Spanish fr_FR French pt_PT Portuguese ru_RU Russian ko_KR Korean zh_CN, zh_HK Chinese ja_JP Japanese merchant_id – (required) Used for specific card verification. For further details, please contact Shiji’s team.
payment_details – (required for CHECKOUT view only) Sets payment information. Required for Alternative payment methods for adding a card. Always supply this information on init on CHECKOUT view.