If I am using a private token does that substitute for the access_token needed in the node clobver sdk? also is the Environment variable equivalent to the DEVELOPER_UID you get when calling the pakms endpoint?
If I am using a private token does that substitute for the access_token needed in the node clobver sdk? also is the Environment variable equivalent to the DEVELOPER_UID you get when calling the pakms endpoint?
I just confirmed with the ecomm team, environment should be a string value either "sandbox" or "production" depending on the Clover environment you want to target.
Now I am getting a "CloverAuthenticationError" when I try to call the order.create method. I am using a private token provided by the merchant and set the environment to "production" What can be causing this error?
There is an outstanding issue with ecomm token creation in production. A large percentage of the time the tokens won't work. You can try to have the merchant generate the token a few more times and see if you can get a valid one. Otherwise you will have to wait for the fix which will be deployed in January.
Okay I will try that. When in Jan will they be pushing the update? If this does not work, is there a recommended way to create the order and process payment? would I just use the v3 endpoints?
Yes, the private token is the access_token. Iam not certain what environment variable you are referring to, API_KEY? The API_KEY will be the public key.
The environemnet shown here:
require('dotenv').config(); const Clover = require("clover-ecomm-sdk"); let ACCESS_TOKEN = process.env.ACCESS_TOKEN; let ENVIRONMENT = process.env.ENVIRONMENT; const cloverInst = new Clover(ACCESS_TOKEN, { environment: ENVIRONMENT }); let order = cloverInst.orders.create({ currency: 'usd', email:'sample.email@example.com', items:{ 'amount': 1358, 'currency': 'usd', 'description': 'Lemon cupcake with blackberry frosting', 'quantity': 2, 'tax_rates':{'name':'Sale','rate':1000000} } });
would that be the public_key?
The documentation shows two different way to config the SDK one version is shown above the other is here:
const clover = require('clover-ecomm-sdk')('Bkk312...');
Is this one no longer used?
Where is that code sample from? I am guessing environment is going to specificy sandbox or prod, but I am not certain what the value is supposed to be.
Here:
https://docs.clover.com/docs/creating-and-paying-for-orders-sdk
under the Node tab in the example.
2 People are following this question.