Payment Upon Delivery

Author: Accord Project

payment-upon-delivery@0.12.0 Contract ^0.22.0 44ee986c8467dba6d833529fa7e51289f755352b87d0f5cca209876eb9173826

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": "resource:org.accordproject.party.Party#Michael",
    "seller": "resource:org.accordproject.party.Party#Diana",
    "costOfGoods": {
        "$class": "org.accordproject.money.MonetaryAmount",
        "doubleValue": 9.99,
        "currencyCode": "USD"
    },
    "deliveryFee": {
        "$class": "org.accordproject.money.MonetaryAmount",
        "doubleValue": 1.99,
        "currencyCode": "USD"
    },
    "contractId": "15929c26-0d85-4f62-b6de-2d7775c633be",
    "$identifier": "15929c26-0d85-4f62-b6de-2d7775c633be"
}

Template Model

namespace org.accordproject.payment.upondelivery

import org.accordproject.contract.* from https://models.accordproject.org/accordproject/contract.cto
import org.accordproject.party.* from https://models.accordproject.org/accordproject/party.cto
import org.accordproject.runtime.* from https://models.accordproject.org/accordproject/runtime.cto
import org.accordproject.obligation.* from https://models.accordproject.org/accordproject/obligation.cto
import org.accordproject.money.MonetaryAmount from https://models.accordproject.org/money@0.2.0.cto

/**
 * The template model
 */
asset PaymentUponDeliveryContract extends Contract {
  --> Party buyer
  --> Party 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.runtime.State
{
    "$class": "org.accordproject.runtime.State",
    "$identifier": "899ee500-a77b-11eb-9770-7ddd576a12c2"
}

Request Types

Type Sample JSON
org.accordproject.payment.upondelivery.DeliveryAcceptedRequest
{
    "$class": "org.accordproject.payment.upondelivery.DeliveryAcceptedRequest",
    "$timestamp": "2021-04-27T13:10:59.663-04:00"
}

Response Types

Type Sample JSON
org.accordproject.payment.upondelivery.DeliveryAcceptedResponse
{
    "$class": "org.accordproject.payment.upondelivery.DeliveryAcceptedResponse",
    "$timestamp": "2021-04-27T13:10:59.664-04:00"
}

Events Types

Type Sample JSON
org.accordproject.obligation.PaymentObligation
{
    "$class": "org.accordproject.obligation.PaymentObligation",
    "amount": {
        "$class": "org.accordproject.money.MonetaryAmount",
        "doubleValue": 21.517,
        "currencyCode": "BTN"
    },
    "description": "Aute Lorem exercitation incididunt eu.",
    "$identifier": "899ee501-a77b-11eb-9770-7ddd576a12c2",
    "contract": "resource:org.accordproject.payment.upondelivery.PaymentUponDeliveryContract#3088",
    "promisor": "resource:org.accordproject.party.Party#2826",
    "promisee": "resource:org.accordproject.party.Party#3348",
    "deadline": "2021-04-27T13:10:59.664-04:00",
    "$timestamp": "2021-04-27T13:10:59.664-04:00"
}

Technical Integration

Please refer to the Accord Project documentation for how to use a template or integrate it within your application.

View the Latest code for this template on GitHub.