Fork me on GitHub

Template payment-upon-delivery@0.5.1

Contract Ergo ^0.9.1 537fe30c82e7b33f0480c220a1caba421b6f79eac07027ae21fa7fd26ca22979

This is a one time payment contract upon acceptance of delivery.

Download Archive Open in Template Studio

Payment upon delivery

This is a one time payment contract upon acceptance of delivery.

Sample

Upon delivery and acceptance, "Michael" shall pay to "Diana" the cost of goods (9.99 USD) and the delivery fee (1.99 USD).

                

Model Dependencies

Technical Integration

Please refer to the Cicero documentation for details and examples of how to integrate a call to a Cicero template into your application.

View the Latest code for this template on on GitHub.

Sample Instance

{
    "$class": "org.accordproject.payment.upondelivery.PaymentUponDeliveryContract",
    "contractId": "c593dd8a-416d-4edd-bec2-fe887e25413e",
    "buyer": {
        "$class": "org.accordproject.cicero.contract.AccordParty",
        "partyId": "Michael"
    },
    "seller": {
        "$class": "org.accordproject.cicero.contract.AccordParty",
        "partyId": "Diana"
    },
    "costOfGoods": {
        "$class": "org.accordproject.money.MonetaryAmount",
        "doubleValue": 9.99,
        "currencyCode": "USD"
    },
    "deliveryFee": {
        "$class": "org.accordproject.money.MonetaryAmount",
        "doubleValue": 1.99,
        "currencyCode": "USD"
    }
}

State Types

Type Sample JSON
org.accordproject.cicero.contract.AccordContractState
{
    "$class": "org.accordproject.cicero.contract.AccordContractState",
    "stateId": "2a89ff60-ee63-11e8-90b2-8532f3de0ed9"
}

Request Types

Type Sample JSON
org.accordproject.payment.upondelivery.DeliveryAcceptedRequest
{
    "$class": "org.accordproject.payment.upondelivery.DeliveryAcceptedRequest",
    "transactionId": "2a89d850-ee63-11e8-90b2-8532f3de0ed9",
    "timestamp": "2018-11-22T14:30:31.765Z"
}

Response Types

Type Sample JSON
org.accordproject.payment.upondelivery.DeliveryAcceptedResponse
{
    "$class": "org.accordproject.payment.upondelivery.DeliveryAcceptedResponse",
    "transactionId": "2a89d851-ee63-11e8-90b2-8532f3de0ed9",
    "timestamp": "2018-11-22T14:30:31.765Z"
}

Events Types

Type Sample JSON
org.accordproject.cicero.runtime.PaymentObligation
{
    "$class": "org.accordproject.cicero.runtime.PaymentObligation",
    "amount": {
        "$class": "org.accordproject.money.MonetaryAmount",
        "doubleValue": 33.657,
        "currencyCode": "ZMW"
    },
    "description": "Consequat reprehenderit officia qui laboris.",
    "contract": "resource:org.accordproject.payment.upondelivery.PaymentUponDeliveryContract#0280",
    "promisor": "resource:org.accordproject.cicero.contract.AccordParty#9082",
    "promisee": "resource:org.accordproject.cicero.contract.AccordParty#9670",
    "deadline": "2018-11-22T14:30:31.766Z",
    "eventId": "2a89ff61-ee63-11e8-90b2-8532f3de0ed9",
    "timestamp": "2018-11-22T14:30:31.766Z"
}