Payment Upon Delivery

Author: Accord Project

payment-upon-delivery@0.10.1 Contract ^0.20.10 17ba222a41a7ad71c2beb492e46e9aaebff0189b8808ed83329a32ff609f4c38

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

Download Archive Download Compiled 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": "4a53b8e1-596b-4f93-a3c5-588e76437530",
    "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": "e7be1a41-c07a-11ea-ad77-8b5ce7c057ac"
}

Request Types

Type Sample JSON
org.accordproject.payment.upondelivery.DeliveryAcceptedRequest
{
    "$class": "org.accordproject.payment.upondelivery.DeliveryAcceptedRequest",
    "transactionId": "e7bdf330-c07a-11ea-ad77-8b5ce7c057ac",
    "timestamp": "2020-07-07T18:54:29.475+01:00"
}

Response Types

Type Sample JSON
org.accordproject.payment.upondelivery.DeliveryAcceptedResponse
{
    "$class": "org.accordproject.payment.upondelivery.DeliveryAcceptedResponse",
    "transactionId": "e7be1a40-c07a-11ea-ad77-8b5ce7c057ac",
    "timestamp": "2020-07-07T18:54:29.476+01:00"
}

Events Types

Type Sample JSON
org.accordproject.cicero.runtime.PaymentObligation
{
    "$class": "org.accordproject.cicero.runtime.PaymentObligation",
    "amount": {
        "$class": "org.accordproject.money.MonetaryAmount",
        "doubleValue": 207.091,
        "currencyCode": "KGS"
    },
    "description": "Velit labore.",
    "contract": "resource:org.accordproject.payment.upondelivery.PaymentUponDeliveryContract#6556",
    "promisor": "resource:org.accordproject.cicero.contract.AccordParty#6139",
    "promisee": "resource:org.accordproject.cicero.contract.AccordParty#9156",
    "deadline": "2020-07-07T18:54:29.476+01:00",
    "eventId": "e7be1a42-c07a-11ea-ad77-8b5ce7c057ac",
    "timestamp": "2020-07-07T18:54:29.476+01: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.