Fork me on GitHub

Template payment-upon-delivery@0.1.0

Contract Ergo ^0.5.0 d3208e8b2bce3a6312ed5879a040bb87001e1c98cd76f4d8785cc9094224015c

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

Download Archive

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": "10f9b4dc-5aa3-44ca-9e3c-d7ca62a72977",
    "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": "2bb68ed1-9cdd-11e8-a77f-a399eacd56ec"
}

Request Types

Type Sample JSON
org.accordproject.payment.upondelivery.DeliveryAcceptedRequest
{
    "$class": "org.accordproject.payment.upondelivery.DeliveryAcceptedRequest",
    "transactionId": "2bb619a0-9cdd-11e8-a77f-a399eacd56ec",
    "timestamp": "2018-08-10T20:37:16.986Z"
}

Response Types

Type Sample JSON
org.accordproject.payment.upondelivery.DeliveryAcceptedResponse
{
    "$class": "org.accordproject.payment.upondelivery.DeliveryAcceptedResponse",
    "transactionId": "2bb68ed0-9cdd-11e8-a77f-a399eacd56ec",
    "timestamp": "2018-08-10T20:37:16.989Z"
}

Events Types

Type Sample JSON
org.accordproject.cicero.runtime.PaymentObligation
{
    "$class": "org.accordproject.cicero.runtime.PaymentObligation",
    "amount": {
        "$class": "org.accordproject.money.MonetaryAmount",
        "doubleValue": 109.149,
        "currencyCode": "GYD"
    },
    "description": "Deserunt consectetur aliquip.",
    "contract": "resource:org.accordproject.payment.upondelivery.PaymentUponDeliveryContract#5252",
    "promisor": "resource:org.accordproject.cicero.contract.AccordParty#1362",
    "promisee": "resource:org.accordproject.cicero.contract.AccordParty#7026",
    "deadline": "2018-08-10T20:37:16.990Z",
    "eventId": "2bb6b5e0-9cdd-11e8-a77f-a399eacd56ec",
    "timestamp": "2018-08-10T20:37:16.990Z"
}