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 Open in VSCode Web

Payment upon delivery

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

Template Text

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

Upon delivery and acceptance, "Michael" shall pay to "Diana" the cost of goods (9.99 USD) and the delivery fee (1.99 USD).
Upon delivery and acceptance, {{buyer}} shall pay to {{seller}} the cost of goods ({{costOfGoods}}) and the delivery fee ({{deliveryFee}}).
{
    "$class": "org.accordproject.payment.upondelivery.PaymentUponDeliveryContract",
    "contractId": "222239e7-9b73-4701-bb18-0446f5268155",
    "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

namespace org.accordproject.payment.upondelivery

import org.accordproject.cicero.contract.* from https://models.accordproject.org/cicero/contract.cto
import org.accordproject.cicero.runtime.* from https://models.accordproject.org/cicero/runtime.cto
import org.accordproject.money.MonetaryAmount from https://models.accordproject.org/money.cto

/**
 * The template model
 */
asset PaymentUponDeliveryContract extends AccordContract {
  o AccordParty buyer
  o AccordParty seller
  o MonetaryAmount costOfGoods
  o MonetaryAmount deliveryFee  
}

transaction DeliveryAcceptedRequest extends Request {}
transaction DeliveryAcceptedResponse extends Response {}

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": "73b32941-42fa-11ea-8b78-dde257dbceb0"
}

Request Types

Type Sample JSON
org.accordproject.payment.upondelivery.DeliveryAcceptedRequest
{
    "$class": "org.accordproject.payment.upondelivery.DeliveryAcceptedRequest",
    "transactionId": "73b30230-42fa-11ea-8b78-dde257dbceb0",
    "timestamp": "2020-01-29T19:50:03.859-05:00"
}

Response Types

Type Sample JSON
org.accordproject.payment.upondelivery.DeliveryAcceptedResponse
{
    "$class": "org.accordproject.payment.upondelivery.DeliveryAcceptedResponse",
    "transactionId": "73b32940-42fa-11ea-8b78-dde257dbceb0",
    "timestamp": "2020-01-29T19:50:03.860-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": 112.548,
        "currencyCode": "HUF"
    },
    "description": "Amet.",
    "contract": "resource:org.accordproject.payment.upondelivery.PaymentUponDeliveryContract#9550",
    "promisor": "resource:org.accordproject.cicero.contract.AccordParty#5326",
    "promisee": "resource:org.accordproject.cicero.contract.AccordParty#9627",
    "deadline": "2020-01-29T19:50:03.860-05:00",
    "eventId": "73b32942-42fa-11ea-8b78-dde257dbceb0",
    "timestamp": "2020-01-29T19:50:03.860-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.