payment.proto
path protobuffet/example/payment/v1/payment.proto
package protobuffet.example.payment.v1
Messages
ChargeRequest
Request to charge a credit card.
Name | Type | Description |
---|---|---|
amount | protobuffet.example.common.types.v1.Money | Amount to charge. This is expected to be in the user's preferred currency. |
credit_card | CreditCardInfo | Credit card to charge. |
ChargeResponse
Response of a successful charge.
Name | Type | Description |
---|---|---|
transaction_id | string | Identifier of this successful charge transaction. |
CreditCardInfo
Represents credit card information that we can charge.
Name | Type | Description |
---|---|---|
credit_card_number | string | Number of credit card. |
credit_card_cvv | int32 | CVV of credit card. |
credit_card_expiration_year | int32 | Card expiration (year). Expected formatting YYYY, eg. 2021. |
credit_card_expiration_month | int32 | Card 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
Method | Charge |
---|---|
Request | ChargeRequest |
Response | ChargeResponse |
Description | Charge a credit card by the specified amount. |