paymentpb

package
v0.0.0-...-8b9d747 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PaymentProviderId_name = map[int32]string{
		0: "PROVIDER_Reserved",
		1: "AliPay",
		2: "Paypal",
		3: "WeChat",
	}
	PaymentProviderId_value = map[string]int32{
		"PROVIDER_Reserved": 0,
		"AliPay":            1,
		"Paypal":            2,
		"WeChat":            3,
	}
)

Enum value maps for PaymentProviderId.

View Source
var (
	ChargeStatus_name = map[int32]string{
		0: "Paid",
		1: "Refunded",
	}
	ChargeStatus_value = map[string]int32{
		"Paid":     0,
		"Refunded": 1,
	}
)

Enum value maps for ChargeStatus.

View Source
var (
	RefundReason_name = map[int32]string{
		0: "GeneralError",
		1: "Fraud",
		2: "Duplicate",
		3: "RequestedByCustomer",
	}
	RefundReason_value = map[string]int32{
		"GeneralError":        0,
		"Fraud":               1,
		"Duplicate":           2,
		"RequestedByCustomer": 3,
	}
)

Enum value maps for RefundReason.

View Source
var (
	CardType_name = map[int32]string{
		0: "CARD_Reserved",
		1: "Mastercard",
		2: "Visa",
		3: "AmericanExpress",
		4: "JCB",
		5: "Discover",
		6: "DinersClub",
	}
	CardType_value = map[string]int32{
		"CARD_Reserved":   0,
		"Mastercard":      1,
		"Visa":            2,
		"AmericanExpress": 3,
		"JCB":             4,
		"Discover":        5,
		"DinersClub":      6,
	}
)

Enum value maps for CardType.

View Source
var (
	Currency_name = map[int32]string{}/* 129 elements not displayed */

	Currency_value = map[string]int32{}/* 129 elements not displayed */

)

Enum value maps for Currency.

View Source
var File_paymentpb_payment_proto protoreflect.FileDescriptor

Functions

func RegisterPaymentServiceServer

func RegisterPaymentServiceServer(s *grpc.Server, srv PaymentServiceServer)

Types

type Card

type Card struct {
	Number      string   `protobuf:"bytes,1,opt,name=Number,proto3" json:"Number,omitempty"`
	ExpireMonth string   `protobuf:"bytes,2,opt,name=ExpireMonth,proto3" json:"ExpireMonth,omitempty"`
	ExpireYear  string   `protobuf:"bytes,3,opt,name=ExpireYear,proto3" json:"ExpireYear,omitempty"`
	FirstName   string   `protobuf:"bytes,4,opt,name=FirstName,proto3" json:"FirstName,omitempty"`
	LastName    string   `protobuf:"bytes,5,opt,name=LastName,proto3" json:"LastName,omitempty"`
	CVC         string   `protobuf:"bytes,6,opt,name=CVC,proto3" json:"CVC,omitempty"`
	Type        CardType `protobuf:"varint,8,opt,name=type,proto3,enum=paymentpb.CardType" json:"type,omitempty"`
	// contains filtered or unexported fields
}

func (*Card) Descriptor deprecated

func (*Card) Descriptor() ([]byte, []int)

Deprecated: Use Card.ProtoReflect.Descriptor instead.

func (*Card) GetCVC

func (x *Card) GetCVC() string

func (*Card) GetExpireMonth

func (x *Card) GetExpireMonth() string

func (*Card) GetExpireYear

func (x *Card) GetExpireYear() string

func (*Card) GetFirstName

func (x *Card) GetFirstName() string

func (*Card) GetLastName

func (x *Card) GetLastName() string

func (*Card) GetNumber

func (x *Card) GetNumber() string

func (*Card) GetType

func (x *Card) GetType() CardType

func (*Card) ProtoMessage

func (*Card) ProtoMessage()

func (*Card) ProtoReflect

func (x *Card) ProtoReflect() protoreflect.Message

func (*Card) Reset

func (x *Card) Reset()

func (*Card) String

func (x *Card) String() string

type CardType

type CardType int32
const (
	CardType_CARD_Reserved   CardType = 0
	CardType_Mastercard      CardType = 1
	CardType_Visa            CardType = 2
	CardType_AmericanExpress CardType = 3
	CardType_JCB             CardType = 4
	CardType_Discover        CardType = 5
	CardType_DinersClub      CardType = 6
)

func (CardType) Descriptor

func (CardType) Descriptor() protoreflect.EnumDescriptor

func (CardType) Enum

func (x CardType) Enum() *CardType

func (CardType) EnumDescriptor deprecated

func (CardType) EnumDescriptor() ([]byte, []int)

Deprecated: Use CardType.Descriptor instead.

func (CardType) Number

func (x CardType) Number() protoreflect.EnumNumber

func (CardType) String

func (x CardType) String() string

func (CardType) Type

type Charge

type Charge struct {
	Id           string    `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	MerchantId   string    `protobuf:"bytes,2,opt,name=merchantId,proto3" json:"merchantId,omitempty"`
	ChargeAmount uint64    `protobuf:"varint,3,opt,name=chargeAmount,proto3" json:"chargeAmount,omitempty"`
	RefundAmount uint64    `protobuf:"varint,4,opt,name=refundAmount,proto3" json:"refundAmount,omitempty"`
	Refunds      []*Refund `protobuf:"bytes,5,rep,name=refunds,proto3" json:"refunds,omitempty"`
	Currency     Currency  `protobuf:"varint,6,opt,name=currency,proto3,enum=paymentpb.Currency" json:"currency,omitempty"`
	UserId       string    `protobuf:"bytes,7,opt,name=userId,proto3" json:"userId,omitempty"`
	Paid         bool      `protobuf:"varint,8,opt,name=paid,proto3" json:"paid,omitempty"`
	Refunded     bool      `protobuf:"varint,9,opt,name=refunded,proto3" json:"refunded,omitempty"`
	Created      int64     `protobuf:"varint,998,opt,name=created,proto3" json:"created,omitempty"`
	Updated      int64     `protobuf:"varint,999,opt,name=updated,proto3" json:"updated,omitempty"`
	// contains filtered or unexported fields
}

func (*Charge) Descriptor deprecated

func (*Charge) Descriptor() ([]byte, []int)

Deprecated: Use Charge.ProtoReflect.Descriptor instead.

func (*Charge) GetChargeAmount

func (x *Charge) GetChargeAmount() uint64

func (*Charge) GetCreated

func (x *Charge) GetCreated() int64

func (*Charge) GetCurrency

func (x *Charge) GetCurrency() Currency

func (*Charge) GetId

func (x *Charge) GetId() string

func (*Charge) GetMerchantId

func (x *Charge) GetMerchantId() string

func (*Charge) GetPaid

func (x *Charge) GetPaid() bool

func (*Charge) GetRefundAmount

func (x *Charge) GetRefundAmount() uint64

func (*Charge) GetRefunded

func (x *Charge) GetRefunded() bool

func (*Charge) GetRefunds

func (x *Charge) GetRefunds() []*Refund

func (*Charge) GetUpdated

func (x *Charge) GetUpdated() int64

func (*Charge) GetUserId

func (x *Charge) GetUserId() string

func (*Charge) ProtoMessage

func (*Charge) ProtoMessage()

func (*Charge) ProtoReflect

func (x *Charge) ProtoReflect() protoreflect.Message

func (*Charge) Reset

func (x *Charge) Reset()

func (*Charge) String

func (x *Charge) String() string

type ChargeRequest

type ChargeRequest struct {
	Currency          Currency          `protobuf:"varint,1,opt,name=currency,proto3,enum=paymentpb.Currency" json:"currency,omitempty"`
	Amount            uint64            `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"`
	Card              *Card             `protobuf:"bytes,3,opt,name=Card,proto3" json:"Card,omitempty"`
	UserId            string            `protobuf:"bytes,4,opt,name=userId,proto3" json:"userId,omitempty"`
	Statement         string            `protobuf:"bytes,5,opt,name=statement,proto3" json:"statement,omitempty"`
	PaymentProviderId PaymentProviderId `protobuf:"varint,6,opt,name=paymentProviderId,proto3,enum=paymentpb.PaymentProviderId" json:"paymentProviderId,omitempty"`
	Metadata          map[string]string `` /* 157-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*ChargeRequest) Descriptor deprecated

func (*ChargeRequest) Descriptor() ([]byte, []int)

Deprecated: Use ChargeRequest.ProtoReflect.Descriptor instead.

func (*ChargeRequest) GetAmount

func (x *ChargeRequest) GetAmount() uint64

func (*ChargeRequest) GetCard

func (x *ChargeRequest) GetCard() *Card

func (*ChargeRequest) GetCurrency

func (x *ChargeRequest) GetCurrency() Currency

func (*ChargeRequest) GetMetadata

func (x *ChargeRequest) GetMetadata() map[string]string

func (*ChargeRequest) GetPaymentProviderId

func (x *ChargeRequest) GetPaymentProviderId() PaymentProviderId

func (*ChargeRequest) GetStatement

func (x *ChargeRequest) GetStatement() string

func (*ChargeRequest) GetUserId

func (x *ChargeRequest) GetUserId() string

func (*ChargeRequest) ProtoMessage

func (*ChargeRequest) ProtoMessage()

func (*ChargeRequest) ProtoReflect

func (x *ChargeRequest) ProtoReflect() protoreflect.Message

func (*ChargeRequest) Reset

func (x *ChargeRequest) Reset()

func (*ChargeRequest) String

func (x *ChargeRequest) String() string

type ChargeStatus

type ChargeStatus int32
const (
	ChargeStatus_Paid     ChargeStatus = 0
	ChargeStatus_Refunded ChargeStatus = 1
)

func (ChargeStatus) Descriptor

func (ChargeStatus) Enum

func (x ChargeStatus) Enum() *ChargeStatus

func (ChargeStatus) EnumDescriptor deprecated

func (ChargeStatus) EnumDescriptor() ([]byte, []int)

Deprecated: Use ChargeStatus.Descriptor instead.

func (ChargeStatus) Number

func (ChargeStatus) String

func (x ChargeStatus) String() string

func (ChargeStatus) Type

type Currency

type Currency int32
const (
	Currency_CUR_RESERVED Currency = 0
	Currency_AFN          Currency = 1
	Currency_ALL          Currency = 2
	Currency_AMD          Currency = 3
	Currency_ANG          Currency = 4
	Currency_ARS          Currency = 5
	Currency_AUD          Currency = 6
	Currency_AWG          Currency = 7
	Currency_AZN          Currency = 8
	Currency_BAM          Currency = 9
	Currency_BBD          Currency = 10
	Currency_BGN          Currency = 11
	Currency_BHD          Currency = 12
	Currency_BMD          Currency = 13
	Currency_BND          Currency = 14
	Currency_BOB          Currency = 15
	Currency_BRL          Currency = 16
	Currency_BSD          Currency = 17
	Currency_BWP          Currency = 18
	Currency_BYN          Currency = 19
	Currency_BYR          Currency = 20
	Currency_BZD          Currency = 21
	Currency_CAD          Currency = 22
	Currency_CLP          Currency = 23
	Currency_CNY          Currency = 24
	Currency_COP          Currency = 25
	Currency_CRC          Currency = 26
	Currency_CUP          Currency = 27
	Currency_CZK          Currency = 28
	Currency_DKK          Currency = 29
	Currency_DOP          Currency = 30
	Currency_DZD          Currency = 31
	Currency_EEK          Currency = 32
	Currency_EGP          Currency = 33
	Currency_EUR          Currency = 34
	Currency_FJD          Currency = 35
	Currency_FKP          Currency = 36
	Currency_GBP          Currency = 37
	Currency_GGP          Currency = 38
	Currency_GHC          Currency = 39
	Currency_GIP          Currency = 40
	Currency_GTQ          Currency = 41
	Currency_GYD          Currency = 42
	Currency_HKD          Currency = 43
	Currency_HNL          Currency = 44
	Currency_HRK          Currency = 45
	Currency_HUF          Currency = 46
	Currency_IDR          Currency = 47
	Currency_ILS          Currency = 48
	Currency_IMP          Currency = 49
	Currency_INR          Currency = 50
	Currency_IQD          Currency = 51
	Currency_IRR          Currency = 52
	Currency_ISK          Currency = 53
	Currency_JEP          Currency = 54
	Currency_JMD          Currency = 55
	Currency_JOD          Currency = 56
	Currency_JPY          Currency = 57
	Currency_KES          Currency = 58
	Currency_KGS          Currency = 59
	Currency_KHR          Currency = 60
	Currency_KPW          Currency = 61
	Currency_KRW          Currency = 62
	Currency_KWD          Currency = 63
	Currency_KYD          Currency = 64
	Currency_KZT          Currency = 65
	Currency_LAK          Currency = 66
	Currency_LBP          Currency = 67
	Currency_LKR          Currency = 68
	Currency_LRD          Currency = 69
	Currency_LTL          Currency = 70
	Currency_LVL          Currency = 71
	Currency_LYD          Currency = 72
	Currency_MAD          Currency = 73
	Currency_MKD          Currency = 74
	Currency_MNT          Currency = 75
	Currency_MUR          Currency = 76
	Currency_MXN          Currency = 77
	Currency_MWK          Currency = 78
	Currency_MYR          Currency = 79
	Currency_MZN          Currency = 80
	Currency_NAD          Currency = 81
	Currency_NGN          Currency = 82
	Currency_NIO          Currency = 83
	Currency_NOK          Currency = 84
	Currency_NPR          Currency = 85
	Currency_NZD          Currency = 86
	Currency_OMR          Currency = 87
	Currency_PAB          Currency = 88
	Currency_PEN          Currency = 89
	Currency_PHP          Currency = 90
	Currency_PKR          Currency = 91
	Currency_PLN          Currency = 92
	Currency_PYG          Currency = 93
	Currency_QAR          Currency = 94
	Currency_RON          Currency = 95
	Currency_RSD          Currency = 96
	Currency_RUB          Currency = 97
	Currency_RUR          Currency = 98
	Currency_SAR          Currency = 99
	Currency_SBD          Currency = 100
	Currency_SCR          Currency = 101
	Currency_SEK          Currency = 102
	Currency_SGD          Currency = 103
	Currency_SHP          Currency = 104
	Currency_SOS          Currency = 105
	Currency_SRD          Currency = 106
	Currency_SVC          Currency = 107
	Currency_SYP          Currency = 108
	Currency_THB          Currency = 109
	Currency_TND          Currency = 110
	Currency_TRL          Currency = 111
	Currency_TRY          Currency = 112
	Currency_TTD          Currency = 113
	Currency_TWD          Currency = 114
	Currency_TZS          Currency = 115
	Currency_UAH          Currency = 116
	Currency_UGX          Currency = 117
	Currency_AED          Currency = 118
	Currency_UYU          Currency = 119
	Currency_UZS          Currency = 120
	Currency_VEF          Currency = 121
	Currency_VND          Currency = 122
	Currency_XCD          Currency = 123
	Currency_YER          Currency = 124
	Currency_ZAR          Currency = 125
	Currency_ZMW          Currency = 126
	Currency_ZWD          Currency = 127
	Currency_USD          Currency = 128
)

func (Currency) Descriptor

func (Currency) Descriptor() protoreflect.EnumDescriptor

func (Currency) Enum

func (x Currency) Enum() *Currency

func (Currency) EnumDescriptor deprecated

func (Currency) EnumDescriptor() ([]byte, []int)

Deprecated: Use Currency.Descriptor instead.

func (Currency) Number

func (x Currency) Number() protoreflect.EnumNumber

func (Currency) String

func (x Currency) String() string

func (Currency) Type

type GetRequest

type GetRequest struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetRequest) Descriptor deprecated

func (*GetRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.

func (*GetRequest) GetId

func (x *GetRequest) GetId() string

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) ProtoReflect

func (x *GetRequest) ProtoReflect() protoreflect.Message

func (*GetRequest) Reset

func (x *GetRequest) Reset()

func (*GetRequest) String

func (x *GetRequest) String() string

type PaymentProviderId

type PaymentProviderId int32
const (
	PaymentProviderId_PROVIDER_Reserved PaymentProviderId = 0
	PaymentProviderId_AliPay            PaymentProviderId = 1
	PaymentProviderId_Paypal            PaymentProviderId = 2
	PaymentProviderId_WeChat            PaymentProviderId = 3
)

func (PaymentProviderId) Descriptor

func (PaymentProviderId) Enum

func (PaymentProviderId) EnumDescriptor deprecated

func (PaymentProviderId) EnumDescriptor() ([]byte, []int)

Deprecated: Use PaymentProviderId.Descriptor instead.

func (PaymentProviderId) Number

func (PaymentProviderId) String

func (x PaymentProviderId) String() string

func (PaymentProviderId) Type

type PaymentServiceClient

type PaymentServiceClient interface {
	NewCharge(ctx context.Context, in *ChargeRequest, opts ...grpc.CallOption) (*Charge, error)
	RefundCharge(ctx context.Context, in *RefundRequest, opts ...grpc.CallOption) (*Charge, error)
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*Charge, error)
}

PaymentServiceClient is the client API for PaymentService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

type PaymentServiceServer

type PaymentServiceServer interface {
	NewCharge(context.Context, *ChargeRequest) (*Charge, error)
	RefundCharge(context.Context, *RefundRequest) (*Charge, error)
	Get(context.Context, *GetRequest) (*Charge, error)
}

PaymentServiceServer is the server API for PaymentService service.

type Refund

type Refund struct {
	RefundAmount     uint64       `protobuf:"varint,1,opt,name=refundAmount,proto3" json:"refundAmount,omitempty"`
	ProviderRefundId string       `protobuf:"bytes,2,opt,name=providerRefundId,proto3" json:"providerRefundId,omitempty"`
	Reason           RefundReason `protobuf:"varint,3,opt,name=reason,proto3,enum=paymentpb.RefundReason" json:"reason,omitempty"`
	Created          int64        `protobuf:"varint,4,opt,name=created,proto3" json:"created,omitempty"`
	// contains filtered or unexported fields
}

func (*Refund) Descriptor deprecated

func (*Refund) Descriptor() ([]byte, []int)

Deprecated: Use Refund.ProtoReflect.Descriptor instead.

func (*Refund) GetCreated

func (x *Refund) GetCreated() int64

func (*Refund) GetProviderRefundId

func (x *Refund) GetProviderRefundId() string

func (*Refund) GetReason

func (x *Refund) GetReason() RefundReason

func (*Refund) GetRefundAmount

func (x *Refund) GetRefundAmount() uint64

func (*Refund) ProtoMessage

func (*Refund) ProtoMessage()

func (*Refund) ProtoReflect

func (x *Refund) ProtoReflect() protoreflect.Message

func (*Refund) Reset

func (x *Refund) Reset()

func (*Refund) String

func (x *Refund) String() string

type RefundReason

type RefundReason int32
const (
	RefundReason_GeneralError        RefundReason = 0
	RefundReason_Fraud               RefundReason = 1
	RefundReason_Duplicate           RefundReason = 2
	RefundReason_RequestedByCustomer RefundReason = 3
)

func (RefundReason) Descriptor

func (RefundReason) Enum

func (x RefundReason) Enum() *RefundReason

func (RefundReason) EnumDescriptor deprecated

func (RefundReason) EnumDescriptor() ([]byte, []int)

Deprecated: Use RefundReason.Descriptor instead.

func (RefundReason) Number

func (RefundReason) String

func (x RefundReason) String() string

func (RefundReason) Type

type RefundRequest

type RefundRequest struct {
	Id     string       `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Amount uint64       `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"`
	Reason RefundReason `protobuf:"varint,3,opt,name=reason,proto3,enum=paymentpb.RefundReason" json:"reason,omitempty"`
	// contains filtered or unexported fields
}

func (*RefundRequest) Descriptor deprecated

func (*RefundRequest) Descriptor() ([]byte, []int)

Deprecated: Use RefundRequest.ProtoReflect.Descriptor instead.

func (*RefundRequest) GetAmount

func (x *RefundRequest) GetAmount() uint64

func (*RefundRequest) GetId

func (x *RefundRequest) GetId() string

func (*RefundRequest) GetReason

func (x *RefundRequest) GetReason() RefundReason

func (*RefundRequest) ProtoMessage

func (*RefundRequest) ProtoMessage()

func (*RefundRequest) ProtoReflect

func (x *RefundRequest) ProtoReflect() protoreflect.Message

func (*RefundRequest) Reset

func (x *RefundRequest) Reset()

func (*RefundRequest) String

func (x *RefundRequest) String() string

type UnimplementedPaymentServiceServer

type UnimplementedPaymentServiceServer struct {
}

UnimplementedPaymentServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedPaymentServiceServer) Get

func (*UnimplementedPaymentServiceServer) NewCharge

func (*UnimplementedPaymentServiceServer) RefundCharge

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL