Documentation ¶
Index ¶
Constants ¶
View Source
const ( EcV1 tokenProtocol = "ECv1" EcV2 tokenProtocol = "ECv2" EcV2SigningOnly tokenProtocol = "ECv2SigningOnly" GoogleSenderId = "Google" Card PaymentMethod = "CARD" TokenizedCard PaymentMethod = "TOKENIZED_CARD" PanOnly AuthMethod = "PAN_ONLY" Cryptogram3ds AuthMethod = "CRYPTOGRAM_3DS" EnvMerchantId = "GOOGLE_PAY_MERCHANT_ID" EnvMerchantPrivateKey = "GOOGLE_PAY_MERCHANT_PRIVATE_KEY" EnvRootSignedKetsFile = "GOOGLE_PAY_ROOT_SIGNED_KEYS_FILE" )
View Source
const ( TestRootKeysUrl = "https://payments.developers.google.com/paymentmethodtoken/test/keys.json" ProductionRootKeysUrl = "https://payments.developers.google.com/paymentmethodtoken/keys.json" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthMethod ¶
type AuthMethod string
func (*AuthMethod) String ¶
func (m *AuthMethod) String() string
func (*AuthMethod) UnmarshalJSON ¶
func (m *AuthMethod) UnmarshalJSON(bytes []byte) error
type GooglePayToken ¶
type GooglePayToken struct { MessageId string `json:"messageId"` MessageExpiration string `json:"messageExpiration"` PaymenMethod PaymentMethod `json:"paymentMethod"` GatewayMerchantId string `json:"gatewayMerchantId,omitempty"` PaymenMethodDetails struct { AuthMethod AuthMethod `json:"authMethod"` Pan string `json:"pan"` ExpirationMonth time.Month `json:"expirationMonth"` ExpirationYear uint `json:"expirationYear"` Cryptogram string `json:"cryptogram,omitempty"` EciIndicator string `json:"eciIndicator,omitempty"` } `json:"paymentMethodDetails"` }
func Decrypt ¶
func Decrypt(data []byte) (*GooglePayToken, error)
func (*GooglePayToken) HasCryptogram ¶
func (t *GooglePayToken) HasCryptogram() bool
type IGooglePayHandler ¶
type IGooglePayHandler interface { Decrypt([]byte) (*GooglePayToken, error) MerchantId() string }
IGooglePayHandler is the interface for Google Pay handlers
type IOption ¶
type IOption func(*googlePayHandler) error
IOption is the interface option functions used when create new handler instance
func LiveMode ¶ added in v1.0.10
func LiveMode() IOption
LiveMode option func to define production mode for tokens
func MerchantPemPrivateKey ¶
MerchantPemPrivateKey option func to define merchant private key from pem encoded data
func MerchantPrivateKey ¶
func MerchantPrivateKey(key *ecdsa.PrivateKey) IOption
MerchantPrivateKey option func to define merchant private key
func MerchantPrivateKeyLocation ¶
MerchantPrivateKeyLocation option func to define merchant private key from file
type PaymentMethod ¶
type PaymentMethod string
func (*PaymentMethod) String ¶
func (m *PaymentMethod) String() string
func (*PaymentMethod) UnmarshalJSON ¶
func (m *PaymentMethod) UnmarshalJSON(bytes []byte) error
Click to show internal directories.
Click to hide internal directories.