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 Open in Template Studio

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": "c47c413e-6c25-469f-ab14-b4836467a8ff",
    "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": "010e4be0-7b6c-11ea-b280-c173749a9e96"
}

Request Types

Type Sample JSON
org.accordproject.payment.upondelivery.DeliveryAcceptedRequest
{
    "$class": "org.accordproject.payment.upondelivery.DeliveryAcceptedRequest",
    "transactionId": "010e24d0-7b6c-11ea-b280-c173749a9e96",
    "timestamp": "2020-04-10T16:43:59.261-04:00"
}

Response Types

Type Sample JSON
org.accordproject.payment.upondelivery.DeliveryAcceptedResponse
{
    "$class": "org.accordproject.payment.upondelivery.DeliveryAcceptedResponse",
    "transactionId": "010e24d1-7b6c-11ea-b280-c173749a9e96",
    "timestamp": "2020-04-10T16:43:59.261-04:00"
}

Events Types

Type Sample JSON
org.accordproject.cicero.runtime.PaymentObligation
{
    "$class": "org.accordproject.cicero.runtime.PaymentObligation",
    "amount": {
        "$class": "org.accordproject.money.MonetaryAmount",
        "doubleValue": 255.786,
        "currencyCode": "PGK"
    },
    "description": "Dolor laboris.",
    "contract": "resource:org.accordproject.payment.upondelivery.PaymentUponDeliveryContract#4819",
    "promisor": "resource:org.accordproject.cicero.contract.AccordParty#7496",
    "promisee": "resource:org.accordproject.cicero.contract.AccordParty#4508",
    "deadline": "2020-04-10T16:43:59.262-04:00",
    "eventId": "010e4be1-7b6c-11ea-b280-c173749a9e96",
    "timestamp": "2020-04-10T16:43:59.262-04: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.