Comments (5)
Step 1: Create Agreeemnt
id: 46210999-206c-419d-8072-8422d5b3a437
Step 2: Create allocation
curl -X POST -s -H "Accept: application/json" -H "Content-type: application/json" --data '{"totalAmount": 50, "timeout": null, "makeDeposit": false }' http://127.0.0.1:2001/payment-api/v1/requestor/allocations
{"allocationId":"012e0acb-e137-4fbf-9127-5f2c9e961b3d",
"totalAmount":"50",
"spentAmount":"0",
"remainingAmount":"50",
"makeDeposit":false}
Step 3: Create Actiivity
result: 6b905bf711504c0ab334c95e8b4995bf
Step 4: Issue invoice
curl -X POST -s -H "Accept: application/json" -H "Content-type: application/json" \
--data '{"agreementId": "46210999-206c-419d-8072-8422d5b3a437",
"activityIds": ["6b905bf711504c0ab334c95e8b4995bf"],
"amount": 10, "creditAccountId": "0x0a92dd80ed3d4bcb7448e7f0a5e70acfb8662c1f",
"paymentDueDate": "2030-01-01T00:00:00Z"}' \
http://127.0.0.1:2011/payment-api/v1/provider/invoices
{
"invoiceId": "cec4c8c1-6658-4918-b2f1-45a0461414fa",
"issuerId": "0x0a92dd80ed3d4bcb7448e7f0a5e70acfb8662c1f",
"recipientId": "0x4563845390a720f93f57dfef1f4f24fc66729ff9",
"timestamp": "2020-03-02T09:54:10Z",
"agreementId": "46210999-206c-419d-8072-8422d5b3a437",
"activityIds": [
"6b905bf711504c0ab334c95e8b4995bf"
],
"amount": "10",
"creditAccountId": "0x0a92dd80ed3d4bcb7448e7f0a5e70acfb8662c1f",
"paymentDueDate": "2030-01-01T00:00:00Z",
"status": "ISSUED"
}
from yagna.
Step 5: Send invoice to requestor
-H "Content-type: application/json" \
--data '{}' \
http://127.0.0.1:2011/payment-api/v1/provider/invoices/cec4c8c1-6658-4918-b2f1-45a0461414fa/send
{
"invoiceId": "cec4c8c1-6658-4918-b2f1-45a0461414fa",
"issuerId": "0x0a92dd80ed3d4bcb7448e7f0a5e70acfb8662c1f",
"recipientId": "0x4563845390a720f93f57dfef1f4f24fc66729ff9",
"timestamp": "2020-03-02T09:54:10Z",
"agreementId": "46210999-206c-419d-8072-8422d5b3a437",
"activityIds": [
"6b905bf711504c0ab334c95e8b4995bf"
],
"amount": "10",
"creditAccountId": "0x0a92dd80ed3d4bcb7448e7f0a5e70acfb8662c1f",
"paymentDueDate": "2030-01-01T00:00:00Z",
"status": "RECEIVED"
}
from yagna.
Step 6: Invoice event on reqeuestor
FAIL
curl -H 'Accept: application/json' 'http://127.0.0.1:2001/payment-api/v1/requestor/invoiceEvents'
result: HTTP/1.1 501 Not Implemented
curl http://127.0.0.1:2001/payment-api/v1/requestor/invoices
[
{
"invoiceId": "cec4c8c1-6658-4918-b2f1-45a0461414fa",
"issuerId": "0x0a92dd80ed3d4bcb7448e7f0a5e70acfb8662c1f",
"recipientId": "0x4563845390a720f93f57dfef1f4f24fc66729ff9",
"timestamp": "2020-03-02T09:54:10Z",
"agreementId": "46210999-206c-419d-8072-8422d5b3a437",
"activityIds": [
"6b905bf711504c0ab334c95e8b4995bf"
],
"amount": "10",
"creditAccountId": "0x0a92dd80ed3d4bcb7448e7f0a5e70acfb8662c1f",
"paymentDueDate": "2030-01-01T00:00:00Z",
"status": "RECEIVED"
}
]
from yagna.
Step 7: Requestor accepts invoice and sends InvoiceAccepted
-H "Accept: application/json" \
-H "Content-type: application/json" \
--data '{"totalAmountAccepted": "10",
"allocationId": "012e0acb-e137-4fbf-9127-5f2c9e961b3d"}' \
http://127.0.0.1:2001/payment-api/v1/requestor/invoices/cec4c8c1-6658-4918-b2f1-45a0461414fa/accept
From a provider perspective:
'http://127.0.0.1:2011/payment-api/v1/provider/invoices/cec4c8c1-6658-4918-b2f1-45a0461414fa'
{
"invoiceId": "cec4c8c1-6658-4918-b2f1-45a0461414fa",
"issuerId": "0x0a92dd80ed3d4bcb7448e7f0a5e70acfb8662c1f",
"recipientId": "0x4563845390a720f93f57dfef1f4f24fc66729ff9",
"timestamp": "2020-03-02T09:54:10Z",
"agreementId": "46210999-206c-419d-8072-8422d5b3a437",
"activityIds": [
"6b905bf711504c0ab334c95e8b4995bf"
],
"amount": "10",
"creditAccountId": "0x0a92dd80ed3d4bcb7448e7f0a5e70acfb8662c1f",
"paymentDueDate": "2030-01-01T00:00:00Z",
"status": "SETTLED"
}
from yagna.
curl -v -H 'Authorization: Bearer 49acf3568f5542a29ad37f75adcecdc6' -H 'Accept: application/json' 'http://127.0.0.1:2001/payment-api/v1/provider/invoiceEvents'
501 Not Implemented
cli not implemented
from yagna.
Related Issues (20)
- Add Deposit Verification in Yagna HOT 1
- Design deposit validation HOT 7
- Remove "Handbook" references from Yagna codebase
- `/proxy-http` API request matching HOT 1
- Allocation REST API returns confusing errors when deposit balance is exceeded
- Goth improvements - Make Goth Great Again
- Reference the proposal in the agreement JSON returned by the API
- Fix errors in mid_agreement_test in GOTH HOT 2
- VM runtime doesn't catch all VM issues upon start of provider
- Extend Yagna Onboarding Command for Mainnet/Ethereum
- Improvement when getting balance HOT 7
- Bump payment protocol.version for deposit payments
- Gasless transactions - server issues
- Working on golem-js progress, python and json drivers HOT 2
- Provider doesn't update hardware profile after change
- Provider reports remaining RAM not available
- pioneer proper error structuring on allocation create endpoint
- Yagna: Add support for sepolia & amoy Testnets
- Its possible to crete two alloction with same deposit.
- Fix allocation validation according to feedback HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yagna.