Payment Upon Delivery

payment-upon-delivery@0.10.0 Contract ^0.20.0 ed5c1bc083cde7825aa6609ba8d9cedd240ca7e5b1866f3675f9e1d0f4cc308c

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.

Template Text

Grammar

Upon delivery and acceptance, {{buyer}} shall pay to {{seller}} the cost of goods ({{costOfGoods}}) and the delivery fee ({{deliveryFee}}).

Sample

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

Sample Data

{
    "$class": "org.accordproject.payment.upondelivery.PaymentUponDeliveryContract",
    "contractId": "56c61c00-fab8-4876-9a3f-9d660621d54c",
    "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"
    }
}

Template Model

Model Dependencies

Template Logic

Find the full logic for this template on on GitHub.

State Types

Type Sample JSON
org.accordproject.cicero.contract.AccordContractState
{
    "$class": "org.accordproject.cicero.contract.AccordContractState",
    "stateId": "fcf87f72-ff3e-11e9-b361-efc0ae54bdd6"
}

Request Types

Type Sample JSON
org.accordproject.payment.upondelivery.DeliveryAcceptedRequest
{
    "$class": "org.accordproject.payment.upondelivery.DeliveryAcceptedRequest",
    "transactionId": "fcf87f70-ff3e-11e9-b361-efc0ae54bdd6",
    "timestamp": "2019-11-04T15:09:20.871-05:00"
}

Response Types

Type Sample JSON
org.accordproject.payment.upondelivery.DeliveryAcceptedResponse
{
    "$class": "org.accordproject.payment.upondelivery.DeliveryAcceptedResponse",
    "transactionId": "fcf87f71-ff3e-11e9-b361-efc0ae54bdd6",
    "timestamp": "2019-11-04T15:09:20.871-05:00"
}

Events Types

Type Sample JSON
org.accordproject.cicero.runtime.PaymentObligation
{
    "$class": "org.accordproject.cicero.runtime.PaymentObligation",
    "amount": {
        "$class": "org.accordproject.money.MonetaryAmount",
        "doubleValue": 139.367,
        "currencyCode": "LKR"
    },
    "description": "Est magna.",
    "contract": "resource:org.accordproject.payment.upondelivery.PaymentUponDeliveryContract#6307",
    "promisor": "resource:org.accordproject.cicero.contract.AccordParty#1054",
    "promisee": "resource:org.accordproject.cicero.contract.AccordParty#6576",
    "deadline": "2019-11-04T15:09:20.871-05:00",
    "eventId": "fcf87f73-ff3e-11e9-b361-efc0ae54bdd6",
    "timestamp": "2019-11-04T15:09:20.871-05:00"
}

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 GitHub.