Fork me on GitHub

Template payment-upon-delivery@0.4.0

Contract Ergo ^0.8.0 8981ef45671a49e4e067d10f881e19ff5ea61314eb60055e36793f7761873683

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": "2538e649-4875-4f6d-b1ca-c2cb0777c2ea",
    "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": "099b2e60-b5f5-11e8-98f1-f70046c609b7"
}

Request Types

Type Sample JSON
org.accordproject.payment.upondelivery.DeliveryAcceptedRequest
{
    "$class": "org.accordproject.payment.upondelivery.DeliveryAcceptedRequest",
    "transactionId": "099b0750-b5f5-11e8-98f1-f70046c609b7",
    "timestamp": "2018-09-11T19:01:06.757Z"
}

Response Types

Type Sample JSON
org.accordproject.payment.upondelivery.DeliveryAcceptedResponse
{
    "$class": "org.accordproject.payment.upondelivery.DeliveryAcceptedResponse",
    "transactionId": "099b0751-b5f5-11e8-98f1-f70046c609b7",
    "timestamp": "2018-09-11T19:01:06.758Z"
}

Events Types

Type Sample JSON
org.accordproject.cicero.runtime.PaymentObligation
{
    "$class": "org.accordproject.cicero.runtime.PaymentObligation",
    "amount": {
        "$class": "org.accordproject.money.MonetaryAmount",
        "doubleValue": 22.284,
        "currencyCode": "LYD"
    },
    "description": "Et minim aliquip.",
    "contract": "resource:org.accordproject.payment.upondelivery.PaymentUponDeliveryContract#5779",
    "promisor": "resource:org.accordproject.cicero.contract.AccordParty#0174",
    "promisee": "resource:org.accordproject.cicero.contract.AccordParty#7484",
    "deadline": "2018-09-11T19:01:06.758Z",
    "eventId": "099b2e61-b5f5-11e8-98f1-f70046c609b7",
    "timestamp": "2018-09-11T19:01:06.758Z"
}