curblr / curblr-spec

An open, linear-referenced data standard for curb regulations
https://curblr.org/
Other
72 stars 15 forks source link

Potential gaps/modifications for payment profiles (payment.md) #20

Open emilyeros opened 4 years ago

emilyeros commented 4 years ago

Based on feedback from payment company. Cases to consider handling:

emilyeros commented 4 years ago

What we already have

The regulation and manifest already communicate the following info:

image

What the payment object can store

In addition, the payment object could hold the following info:

Screen Shot 2020-03-13 at 4 49 16 PM

In this model, the payment object can contain a set of rates as well as a set of conditions when those rates apply.

This means that we can specify a rate(s) that apply to conditions like the time of day, time of entry, user permit, or vehicle type. A payment profile can include multiple sets of these rate-condition pairs. For example, it could assign a $2/hr charge for weekday parking during business hours, and a $10/8 hr charge for early bird parkers that arrive before 9am. The payment profile can also describe what forms of payment are accepted, and the name and contact of the parking operator.

Conditions could hold the following properties:

Other, city-wide info about payment terms

Additional info can be included in the payment object or the manifest to determine the area-wide specifics of how rates are calculated. (e.g. what math rules apply)

Screen Shot 2020-03-13 at 4 53 17 PM

Other payment properties, such as operator may be suitable for bundling into the manifest as well.

Which uncommon use cases does this handle?

Below, I've repeated the list of exceptions we discussed, with a comment about whether or not this spec handles the use case.

emilyeros commented 4 years ago

Summary of where we ended up on this:

Small changes could be made that would allow payment transaction processors to more easily consume CurbLR data, particularly for edge cases. If the pricing schedule varies according to the time of day, a timespan object could be embedded within the rate object.

Waiting on this until a transaction processor or other entity wants to start consuming this data.

See below for an example of what this could look like, and the type of use case it would address.

Payment example: Flat-rate tier, varies based on time of day

Describes a parking meter. From 9am to 5pm, the fee is $1 for the first 30 mins and $2 per 15 mins. From 5pm to 10pm, the fee is $1 per hour.

{
  "payment": {
    "rates": [
      {
        "fees": [1, 2],
        "durations": [60, 60],
        "timeSpans": [
          {
            "timeOfDay": {
              "from": "09:00",
              "to": "17:00"
            }
          }
        ]
      },
      {
        "fees": [1],
        "durations": [60],
        "timeSpans": [
          {
            "timesOfDay": [
              {
                "from": "17:00",
                "to": "22:00"
              }
            ]
          }
        ]
      }
    ],
    "methods": ["meter", "digital"],
    "forms": ["coins", "Mastercard", "Visa", "American Express", "Discover", "ApplePay", "AndroidPay"],
    "operator": "LADOT",
    "phone": "+15552225039",
    "deviceIds": ["MB-0028"]
  }
}