Payment Upon Delivery

Author: Accord Project

payment-upon-delivery@0.11.0 Contract ^0.21.0 3dabef97c1771a8e6a51f292dcf4c0cb71496da7f25514e6cb5ddb43af1aa3f2

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",
    "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"
    },
    "contractId": "5cc90ce7-fcf5-4e85-add4-f295d6117b29"
}

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": "89bdbb80-cd1d-11ea-920c-ade26666d144"
}

Request Types

Type Sample JSON
org.accordproject.payment.upondelivery.DeliveryAcceptedRequest
{
    "$class": "org.accordproject.payment.upondelivery.DeliveryAcceptedRequest",
    "transactionId": "89bd9470-cd1d-11ea-920c-ade26666d144",
    "timestamp": "2020-07-23T15:48:53.687-04:00"
}

Response Types

Type Sample JSON
org.accordproject.payment.upondelivery.DeliveryAcceptedResponse
{
    "$class": "org.accordproject.payment.upondelivery.DeliveryAcceptedResponse",
    "transactionId": "89bd9471-cd1d-11ea-920c-ade26666d144",
    "timestamp": "2020-07-23T15:48:53.688-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": 210.11,
        "currencyCode": "TMT"
    },
    "description": "Minim ad enim enim voluptate.",
    "contract": "resource:org.accordproject.payment.upondelivery.PaymentUponDeliveryContract#5161",
    "promisor": "resource:org.accordproject.cicero.contract.AccordParty#8309",
    "promisee": "resource:org.accordproject.cicero.contract.AccordParty#1266",
    "deadline": "2020-07-23T15:48:53.688-04:00",
    "eventId": "89bdbb81-cd1d-11ea-920c-ade26666d144",
    "timestamp": "2020-07-23T15:48:53.688-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.