![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
github.com/MarinX/kit-payment
Clone the repo
git clone https://github.com/MarinX/kit-payment
Fetch dependencies
go get ./...
Build as any other go project
go build
Usage of ./kit-payment:
-http.addr string
HTTP listen address (default ":8080")
Kit-payment is using embedded key/value database called boltdb.
curl -H "Content-Type: application/json" -X POST http://localhost:8080/accounts
curl -H "Content-Type: application/json" -X GET http://localhost:8080/accounts
Example addding $100 to account id 3479d3a8-42c4-4b40-8a1d-1b1661d7b6ef
curl -d '{"currency":"USD", "amount":100}' -H "Content-Type: application/json" -X POST http://localhost:8080/accounts/3479d3a8-42c4-4b40-8a1d-1b1661d7b6ef/balances
curl -H "Content-Type: application/json" -X GET http://localhost:8080/transactions
Example of moving $50 from account 3479d3a8-42c4-4b40-8a1d-1b1661d7b6ef
to account 06e39e77-776a-4694-bc59-fea69bc8afd8
curl -d '{"from":"3479d3a8-42c4-4b40-8a1d-1b1661d7b6ef", "to":"06e39e77-776a-4694-bc59-fea69bc8afd8", "currency":"USD", "amount":50}' -H "Content-Type: application/json" -X POST http://localhost:8080/transactions
If success, it will return a created transaction object
{"transaction":{"id":"fecf39a1-c4f2-4706-8eca-bc71f310eeb6","from":"3479d3a8-42c4-4b40-8a1d-1b1661d7b6ef","to":"06e39e77-776a-4694-bc59-fea69bc8afd8","status":"created","amount":50,"currency":"USD"}}
Example of getting single transaction by id fecf39a1-c4f2-4706-8eca-bc71f310eeb6
curl -H "Content-Type: application/json" -X GET http://localhost:8080/transactions/fecf39a1-c4f2-4706-8eca-bc71f310eeb6
Once the transaction is created, you need to commit.
Example is commiting created transaction fecf39a1-c4f2-4706-8eca-bc71f310eeb6
curl -H "Content-Type: application/json" -X PUT http://localhost:8080/transactions/fecf39a1-c4f2-4706-8eca-bc71f310eeb6/commit
Now you can check the status with Get Transaction
method.
If account has enough balance, you will see the change on amount when listing accounts.
It provides a interface for merkle tree so we can check if all transactions are verified.
Example of checking our last transaction fecf39a1-c4f2-4706-8eca-bc71f310eeb6
curl -H "Content-Type: application/json" -X GET http://localhost:8080/transactions/fecf39a1-c4f2-4706-8eca-bc71f310eeb6/hash
will return the hash for verification
{"hash":"fdf227bade5496e59824a4c9ef59ec992c61b4521fe0003c5be4d79cec3c885c"}
Nothing fancy, just run
go test -v ./...
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.