TBD54566975 / tbdex

56 stars 26 forks source link

add `min` and `max` to `PaymentMethod` #262

Closed mistermoe closed 8 months ago

mistermoe commented 8 months ago

PaymentMethod is the type used for the elements within Offering.payinMethods[] and Offering.payoutMethods[]. it's quite possible that the min and max amounts can vary based on the payment method.

Proposing that we add optional min and max properties to PaymentMethod in addition to min and max that already exist in CurrencyDetails.

PaymentMethod min & max would take precedence over CurrencyDetails min & max in situations where both are present.

selfissued commented 8 months ago

I'd try to mimic existing practices in the payments industry on this point. I'm not an expert in those. But maybe you have someone among your circle of experts who is?

decentralgabe commented 8 months ago

I believe a construct like this is useful but I am worried about confusion / overlap between PaymentMethod and CurrencyDetails, specifically for the case where a PaymentMethod supports multiple currencies (e.g. a credit card that can pay with USD or EUR).

Should instead each PaymentMethod be associated with a set of CurrencyDetails?

Also, when would CurrencyDetails not be present? If CurrencyDetails are required to be present for both payin and payout then we could deduce that the PaymentMethod specified must support the currency for the associated txn.

So...perhaps just requiring CurrencyDetails is sufficient?

mistermoe commented 8 months ago

@decentralgabe i believe your concern may be resolved by https://github.com/TBD54566975/tbdex/issues/260 ? lmk if i'm misunderstanding

mistermoe commented 8 months ago

also, an offering only ever has a single payin currency and a single payout currency. so that makes things easier

decentralgabe commented 8 months ago

if there can only ever be one single payin/payout then yes min/max makes sense to me