Install rotp gem
In my case I am using an user model to add google 2fa.
References: https://github.com/Dynamoid/dynamoid
install gem 'dynamoid' and 'aws-sdk'.
References: https://github.com/mongodb/mongoid | |
mongoid is one of the best ODMs | |
Install mongodb - Reference: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ | |
Ruby and Ruby on Rails version- | |
Rails - 5+ | |
Ruby - 2.5+ |
References: https://www.npmjs.com/package/dynamoose and https://dynamoosejs.com/api | |
Steps to start with dynamoose- | |
install dynamoose | |
npm install dynamoose | |
configure your dynamodb under aws DynamoDB service. |
References: https://mongoosejs.com/ | |
Steps to start with mongoose- | |
install mongoose | |
npm install mongoose | |
create file config/dynamodb.rb |
container_commands: | |
00_node_binary: | |
command: "ln -sf `ls -td /opt/elasticbeanstalk/node-install/node-* | head -1`/bin/node /bin/node" | |
00_npm_binary: | |
command: "ln -sf `ls -td /opt/elasticbeanstalk/node-install/node-* | head -1`/bin/npm /bin/npm" | |
50-run-database-migrations: | |
command: "./node_modules/.bin/sequelize db:migrate" | |
leader_only: true |
Object is of type 'unknown'. | |
for ex - | |
catch (err) { | |
logger.error("CoindcxVpcAPI", url, err); | |
if (err.response) { | |
throw new ServiceError( | |
err.response.data && err.response.data.message || "Invalid Request", | |
err.response.status, |
@api_key = '099eb0cd-02cf-4e2a-8aca-3e6c6aff0399' | |
@merchant_id = 'PGTESTPAYUAT' | |
@key_index = 1 | |
# Step 2 | |
@payment_params = { | |
'merchantId' => @merchant_id, | |
'merchantTransactionId' => "MT7850590068188104", |