Step 4 – Creating a Cryptobucks object instance

Once the library has been included in the ecommerce code, the CryptoBucks object can be instantiated. the following properties/methods must be set:

Mandatory fields:
For all cases, replace the bold text with the variable that contains the appropriate information

Api Key: Api Key must be generated from the merchant’s CMS whose access is authorized once all the registration data has been uploaded and verified to the platform, in Developers Options. This component will only be visible when it is generated, so it must be safely protected later. In this process you can place an expiration time to the token, (infinite recommended) and a Webhook URL optionally. Copy the following code an replace bold text with the name of the variable that corresponding

CryptoBucks.setApiKey(‘${{accessKey}}’);

 

Amount: It must contain the total amount in dollars that you want to cover with the transaction in cryptocurrencies. The variable must be of type numeric.

CryptoBucks.setAmount(amount);

 

Description: It contains a text identifying the purchase that is being made

CryptoBucks.setDescription(‘${{Description}}’);

 

Optional fields:
User info: The following data related to the person who is making the purchase is optionally placed: name, physical address, email and telephone number. the data entries corresponding to these fields must be handled in the ecommerce checkout form

CryptoBucks.setUser(‘${{name}}’, ‘${{phone}}’, ‘${{email}}’, ‘${{address}}’);