Skip to main content

payment.proto

path protobuffet/example/payment/v1/payment.proto

package protobuffet.example.payment.v1


Messages

ChargeRequest

Request to charge a credit card.

NameTypeDescription
amountprotobuffet.example.common.types.v1.MoneyAmount to charge. This is expected to be in the user's preferred currency.
credit_cardCreditCardInfoCredit card to charge.

ChargeResponse

Response of a successful charge.

NameTypeDescription
transaction_idstringIdentifier of this successful charge transaction.

CreditCardInfo

Represents credit card information that we can charge.

NameTypeDescription
credit_card_numberstringNumber of credit card.
credit_card_cvvint32CVV of credit card.
credit_card_expiration_yearint32Card expiration (year). Expected formatting YYYY, eg. 2021.
credit_card_expiration_monthint32Card expiration (month). Expected formatting M, eg. 8, 12.

Services

PaymentService

Payments management service. This should be the only domain that knows how to charge customers to keep a clean audit trail.

Charge

MethodCharge
RequestChargeRequest
ResponseChargeResponse
DescriptionCharge a credit card by the specified amount.