Files
sendico/api/proto/common/payment/v1/card.proto
2026-02-18 22:06:51 +01:00

72 lines
1.6 KiB
Protocol Buffer
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
syntax = "proto3";
package common.payment.v1;
option go_package = "github.com/tech/sendico/pkg/proto/common/payment/v1;paymentv1";
// -------------------------
// Card network (payment system)
// -------------------------
enum CardNetwork {
CARD_NETWORK_UNSPECIFIED = 0;
CARD_NETWORK_VISA = 1;
CARD_NETWORK_MASTERCARD = 2;
CARD_NETWORK_MIR = 3;
CARD_NETWORK_AMEX = 4;
CARD_NETWORK_UNIONPAY = 5;
CARD_NETWORK_JCB = 6;
CARD_NETWORK_DISCOVER = 7;
}
enum CardFundingType {
CARD_FUNDING_UNSPECIFIED = 0;
CARD_FUNDING_DEBIT = 1;
CARD_FUNDING_CREDIT = 2;
CARD_FUNDING_PREPAID = 3;
}
// -------------------------
// PCI scope: raw card details
// -------------------------
message RawCardData {
string pan = 1;
uint32 exp_month = 2; // 112
uint32 exp_year = 3; // YYYY
string cvv = 4; // optional; often omitted for payouts
}
// -------------------------
// Safe metadata (display / routing hints)
// -------------------------
message CardMetadata {
string masked_pan = 1; // e.g. 411111******1111
CardNetwork network = 2; // Visa/Mastercard/Mir/...
CardFundingType funding = 3; // debit/credit/prepaid (if known)
string issuing_country = 4; // ISO 3166-1 alpha-2 (if known)
string issuer_name = 5; // display only (if known)
}
// -------------------------
// Card details
// Either inline credentials OR reference to stored payment method
// -------------------------
message CardDetails {
string id = 1;
oneof source {
RawCardData raw = 2;
string payment_method_id = 3;
}
string cardholder_name = 4;
string cardholder_surname = 5;
string billing_country = 6; // ISO 3166-1 alpha-2, if you need it per operation
}