Documentation
¶
Index ¶
- Constants
- Variables
- func ErrorNameKebabToCamel(src string) string
- func ErrorNameSnakeToCamel(src string) string
- func IsTokenNil(src xml.Token) bool
- func SetURLForEnv(name string) (string, error)
- func StripNilElements(data []byte) ([]byte, error)
- type APIClient
- func (c *APIClient) Accept(ctx context.Context, disputeID string) error
- func (c *APIClient) AddTextEvidence(ctx context.Context, disputeID string, evidence *DisputeTextEvidenceRequest) (*DisputeEvidence, error)
- func (c *APIClient) AllDiscounts(ctx context.Context) ([]Discount, error)
- func (c *APIClient) CancelRelease(ctx context.Context, id string) (*Tx, error)
- func (c *APIClient) CancelSubscription(ctx context.Context, subId string) (*Subscription, error)
- func (c *APIClient) Clone(ctx context.Context, id string, tx *TxCloneRequest) (*Tx, error)
- func (c *APIClient) CreateAddress(ctx context.Context, custID string, request *AddressRequest) (*Address, error)
- func (c *APIClient) CreateCard(ctx context.Context, card *CreditCard) (*CreditCard, error)
- func (c *APIClient) CreateCustomer(ctx context.Context, request *CustomerRequest) (*Customer, error)
- func (c *APIClient) CreateMerchantAccount(ctx context.Context, account *MerchantAccount) (*MerchantAccount, error)
- func (c *APIClient) CreatePayMethod(ctx context.Context, paymentMethodRequest *PaymentMethodRequest) (*PaymentMethod, error)
- func (c *APIClient) CreatePaymentMethodNonce(ctx context.Context, token string) (*PaymentMethodNonce, error)
- func (c *APIClient) CreateSubscription(ctx context.Context, sub *SubscriptionRequest) (*Subscription, error)
- func (c *APIClient) DeleteAddress(ctx context.Context, custID, id string) error
- func (c *APIClient) DeleteCard(ctx context.Context, card *CreditCard) error
- func (c *APIClient) DeleteCustomer(ctx context.Context, id string) error
- func (c *APIClient) DeletePayMethod(ctx context.Context, token string) error
- func (c *APIClient) DeletePaypalAccount(ctx context.Context, paypalAccount *PayPalAccount) error
- func (c *APIClient) ExpiringBetween(ctx context.Context, fromDate, toDate time.Time) (*SearchResult, error)
- func (c *APIClient) ExpiringBetweenPaged(ctx context.Context, fromDate, toDate time.Time, result *SearchResult) (*CreditCardSearchResult, error)
- func (c *APIClient) FetchSubscriptions(ctx context.Context, query *Search) ([]*Subscription, error)
- func (c *APIClient) FetchTx(ctx context.Context, query *Search) ([]*Tx, error)
- func (c *APIClient) Finalize(ctx context.Context, disputeID string) error
- func (c *APIClient) FindCard(ctx context.Context, token string) (*CreditCard, error)
- func (c *APIClient) FindCustomer(ctx context.Context, id string) (*Customer, error)
- func (c *APIClient) FindDispute(ctx context.Context, disputeID string) (*Dispute, error)
- func (c *APIClient) FindMerchantAccount(ctx context.Context, id string) (*MerchantAccount, error)
- func (c *APIClient) FindPayMethod(ctx context.Context, token string) (*PaymentMethod, error)
- func (c *APIClient) FindPaymentMethodNonce(ctx context.Context, nonce string) (*PaymentMethodNonce, error)
- func (c *APIClient) FindPlan(ctx context.Context, id string) (*Plan, error)
- func (c *APIClient) FindSubscription(ctx context.Context, subId string) (*Subscription, error)
- func (c *APIClient) FindTransaction(ctx context.Context, id string) (*Tx, error)
- func (c *APIClient) FindTransactionLineItem(ctx context.Context, txId string) (LineItems, error)
- func (c *APIClient) GenerateSettlement(ctx context.Context, s *Settlement) (*SettlementBatchSummary, error)
- func (c *APIClient) GenerateToken(ctx context.Context) (string, error)
- func (c *APIClient) GenerateWithCustomer(ctx context.Context, custID string) (string, error)
- func (c *APIClient) GenerateWithRequest(ctx context.Context, request *TokenRequest) (string, error)
- func (c *APIClient) HoldInEscrow(ctx context.Context, id string) (*Tx, error)
- func (c *APIClient) ListAddons(ctx context.Context) ([]AddOn, error)
- func (c *APIClient) ListPlans(ctx context.Context) ([]*Plan, error)
- func (c *APIClient) Parse(signature, payload string) (*Notification, error)
- func (c *APIClient) ParseRequest(r *http.Request) (*Notification, error)
- func (c *APIClient) Pay(ctx context.Context, tx *TxRequest) (*Tx, error)
- func (c *APIClient) Refund(ctx context.Context, id string, amount ...*Decimal) (*Tx, error)
- func (c *APIClient) RefundWithRequest(ctx context.Context, id string, request *RefundRequest) (*Tx, error)
- func (c *APIClient) ReleaseFromEscrow(ctx context.Context, id string) (*Tx, error)
- func (c *APIClient) RemoveEvidence(ctx context.Context, disputeID string, id string) error
- func (c *APIClient) RetryCharge(ctx context.Context, txReq *SubscriptionTransactionRequest) error
- func (c *APIClient) SamplePayload(kind, id string) string
- func (c *APIClient) SandboxRequest(kind, id string) (*http.Request, error)
- func (c *APIClient) SandboxSettle(ctx context.Context, transactionID string) (*Tx, error)
- func (c *APIClient) SandboxSettlementConfirm(ctx context.Context, transactionID string) (*Tx, error)
- func (c *APIClient) SandboxSettlementDecline(ctx context.Context, transactionID string) (*Tx, error)
- func (c *APIClient) SandboxSettlementPending(ctx context.Context, transactionID string) (*Tx, error)
- func (c *APIClient) SearchCustomer(ctx context.Context, query *Search, result *SearchResult) (*CustomerSearchResult, error)
- func (c *APIClient) SearchCustomersByIDs(ctx context.Context, query *Search) (*SearchResult, error)
- func (c *APIClient) SearchPaypalAccount(ctx context.Context, token string) (*PayPalAccount, error)
- func (c *APIClient) SearchSubscription(ctx context.Context, query *Search, searchResult *SearchResult) (*SubscriptionSearchResult, error)
- func (c *APIClient) SearchSubscriptions(ctx context.Context, query *Search) (*SearchResult, error)
- func (c *APIClient) SearchTx(ctx context.Context, query *Search, searchResult *SearchResult) (*TransactionSearchResult, error)
- func (c *APIClient) SearchTxs(ctx context.Context, query *Search) (*SearchResult, error)
- func (c *APIClient) SignPayload(src string) (string, error)
- func (c *APIClient) SubmitForSettlement(ctx context.Context, id string, amounts ...*Decimal) (*Tx, error)
- func (c *APIClient) UpdateAddress(ctx context.Context, custID, id string, request *AddressRequest) (*Address, error)
- func (c *APIClient) UpdateCard(ctx context.Context, card *CreditCard) (*CreditCard, error)
- func (c *APIClient) UpdateCustomer(ctx context.Context, request *CustomerRequest) (*Customer, error)
- func (c *APIClient) UpdateMerchantAccount(ctx context.Context, account *MerchantAccount) (*MerchantAccount, error)
- func (c *APIClient) UpdatePayMethod(ctx context.Context, token string, method *PaymentMethodRequest) (*PaymentMethod, error)
- func (c *APIClient) UpdatePaypalAccount(ctx context.Context, paypalAccount *PayPalAccount) (*PayPalAccount, error)
- func (c *APIClient) UpdateSubscription(ctx context.Context, subId string, sub *SubscriptionRequest) (*Subscription, error)
- func (c *APIClient) Verify(challenge string) (string, error)
- func (c *APIClient) Void(ctx context.Context, id string) (*Tx, error)
- type APIError
- type AVSResponseCode
- type AddModificationRequest
- type AddOn
- type AddOnList
- type Address
- type AddressRequest
- type Addresses
- type AndroidPayCard
- type AndroidPayCards
- type AndroidPayDetail
- type ApplePayCard
- type ApplePayCards
- type ApplePayDetail
- type CVVResponseCode
- type CreditCard
- type CreditCardOptions
- type CreditCardSearchResult
- type CreditCards
- type CustomFields
- type Customer
- type CustomerRequest
- type CustomerSearchResult
- type DailyReport
- type Date
- type Decimal
- type Descriptor
- type Disbursement
- type DisbursementDetail
- type Discount
- type DiscountList
- type Dispute
- type DisputeCategory
- type DisputeEvidence
- type DisputeKind
- type DisputeReason
- type DisputeStatus
- type DisputeStatusHistoryEvent
- type DisputeTextEvidenceRequest
- type DisputeTransaction
- type EscrowStatus
- type IAPIError
- type InvalidResponseError
- type Key
- type LineItem
- type LineItemKind
- type LineItemRequest
- type LineItemRequests
- type LineItems
- type MerchantAccount
- type MerchantAccountBusiness
- type MerchantAccountFundingOptions
- type MerchantAccountPerson
- type Modification
- type ModificationRequest
- type ModificationsRequest
- type MultiField
- type Notification
- type Options
- type PayPalAccount
- type PayPalAccountOptions
- type PayPalAccounts
- type PayPalDetail
- type PaymentMethod
- type PaymentMethodNonce
- type PaymentMethodNonceDetails
- type PaymentMethodRequest
- type PaymentMethodRequestOptions
- type PaymentType
- type Plan
- type Plans
- type RangeField
- type Record
- type RefundRequest
- type RejectionReason
- type Response
- type ResponseCode
- type ResponseType
- type RiskData
- type RiskDataRequest
- type Search
- func (s *Search) AddMultiField(field string) *MultiField
- func (s *Search) AddRangeField(field string) *RangeField
- func (s *Search) AddTextField(field string) *TextField
- func (s *Search) AddTimeField(field string) *TimeField
- func (s *Search) MarshalXML(e *xml.Encoder, start xml.StartElement) error
- func (s *Search) ShallowCopy() *Search
- type SearchResult
- type Secret
- type Settlement
- type SettlementBatchSummary
- type SignatureError
- type Status
- type Subject
- type Subscription
- type SubscriptionDetail
- type SubscriptionOpts
- type SubscriptionRequest
- type SubscriptionSearchResult
- type SubscriptionStatus
- type SubscriptionStatusEvent
- type SubscriptionTransactionOptionsRequest
- type SubscriptionTransactionRequest
- type Subscriptions
- type TextField
- type ThreeDSecureEnrolled
- type ThreeDSecureInfo
- type ThreeDSecureStatus
- type TimeField
- type TokenRequest
- type TransactionSearchResult
- type Transactions
- type Tx
- type TxCloneOpts
- type TxCloneRequest
- type TxOpts
- type TxPaypalOptsRequest
- type TxRequest
- type TxSource
- type TxThreeDSecureOptsRequest
- type UpdateModificationRequest
- type ValidationError
- type ValidationErrors
- func (r *ValidationErrors) All() []ValidationError
- func (r *ValidationErrors) AllDeep() []ValidationError
- func (r *ValidationErrors) For(name string) *ValidationErrors
- func (r *ValidationErrors) ForIndex(i int) *ValidationErrors
- func (r *ValidationErrors) On(name string) []ValidationError
- func (r *ValidationErrors) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
- type VenmoAccount
- type VenmoAccountDetail
- type VenmoAccounts
- type XMLRecords
Constants ¶
View Source
const ( ModificationKindDiscount = "discount" ModificationKindAddOn = "add_on" )
View Source
const ( HdrContentEncoding = "Content-Encoding" HdrContentType = "Content-Type" HdrAccept = "Accept" HdrAcceptEncoding = "Accept-Encoding" HdrUserAgent = "User-Agent" HdrAuthorization = "Authorization" HdrApplicationXML = "application/xml" )
View Source
const ( DevURL = "http://localhost:3000" SandboxURL = "https://api.sandbox.braintreegateway.com:443" ProductionURL = "https://api.braintreegateway.com:443" )
View Source
const ( FundingDestBank = "bank" FundingDestMobilePhone = "mobile_phone" FundingDestEmail = "email" )
View Source
const ( Day = "day" Month = "month" )
View Source
const ( CheckWH = "check" DisbursementWH = "disbursement" DisbursementExceptionWH = "disbursement_exception" SubscriptionCanceledWH = "subscription_canceled" SubscriptionChargedSuccessfullyWH = "subscription_charged_successfully" SubscriptionChargedUnsuccessfullyWH = "subscription_charged_unsuccessfully" SubscriptionExpiredWH = "subscription_expired" SubscriptionTrialEndedWH = "subscription_trial_ended" SubscriptionWentActiveWH = "subscription_went_active" SubscriptionWentPastDueWH = "subscription_went_past_due" SubMerchantAccountApprovedWH = "sub_merchant_account_approved" SubMerchantAccountDeclinedWH = "sub_merchant_account_declined" PartnerMerchantConnectedWH = "partner_merchant_connected" PartnerMerchantDisconnectedWH = "partner_merchant_disconnected" PartnerMerchantDeclinedWH = "partner_merchant_declined" TransactionSettledWH = "transaction_settled" TransactionSettlementDeclinedWH = "transaction_settlement_declined" TransactionDisbursedWH = "transaction_disbursed" DisputeOpenedWH = "dispute_opened" DisputeLostWH = "dispute_lost" DisputeWonWH = "dispute_won" AccountUpdaterDailyReportWH = "account_updater_daily_report" )
View Source
const ( // Exception messages BankRejected = "bank_rejected" InsufficientFunds = "insuffient_funds" AccountNotAuthorized = "account_not_authorized" // Followup actions ContactUs = "contact_us" UpdateFundingInformation = "update_funding_information" None = "none" )
View Source
const DateFormat = "2006-01-02"
Variables ¶
View Source
var (
DefaultClient = &http.Client{
Timeout: defaultTimeout,
Transport: defaultTransport,
}
)
Functions ¶
func ErrorNameKebabToCamel ¶
func ErrorNameSnakeToCamel ¶
func IsTokenNil ¶
func SetURLForEnv ¶
func StripNilElements ¶
StripNilElements parses the xml input, removing any elements that are decorated with the `nil="true"` attribute returning the XML without those elements.
Types ¶
type APIClient ¶
func NewWithAccessToken ¶
func NewWithHttpClient ¶
func (*APIClient) AddTextEvidence ¶
func (c *APIClient) AddTextEvidence(ctx context.Context, disputeID string, evidence *DisputeTextEvidenceRequest) (*DisputeEvidence, error)
func (*APIClient) AllDiscounts ¶
func (*APIClient) CancelRelease ¶
func (*APIClient) CancelSubscription ¶
func (*APIClient) CreateAddress ¶
func (*APIClient) CreateCard ¶
func (c *APIClient) CreateCard(ctx context.Context, card *CreditCard) (*CreditCard, error)
func (*APIClient) CreateCustomer ¶
func (*APIClient) CreateMerchantAccount ¶
func (c *APIClient) CreateMerchantAccount(ctx context.Context, account *MerchantAccount) (*MerchantAccount, error)
func (*APIClient) CreatePayMethod ¶
func (c *APIClient) CreatePayMethod(ctx context.Context, paymentMethodRequest *PaymentMethodRequest) (*PaymentMethod, error)
func (*APIClient) CreatePaymentMethodNonce ¶
func (*APIClient) CreateSubscription ¶
func (c *APIClient) CreateSubscription(ctx context.Context, sub *SubscriptionRequest) (*Subscription, error)
func (*APIClient) DeleteAddress ¶
func (*APIClient) DeleteCard ¶
func (c *APIClient) DeleteCard(ctx context.Context, card *CreditCard) error
func (*APIClient) DeleteCustomer ¶
func (*APIClient) DeletePayMethod ¶
func (*APIClient) DeletePaypalAccount ¶
func (c *APIClient) DeletePaypalAccount(ctx context.Context, paypalAccount *PayPalAccount) error
func (*APIClient) ExpiringBetween ¶
func (*APIClient) ExpiringBetweenPaged ¶
func (c *APIClient) ExpiringBetweenPaged(ctx context.Context, fromDate, toDate time.Time, result *SearchResult) (*CreditCardSearchResult, error)
func (*APIClient) FetchSubscriptions ¶
func (*APIClient) FindCustomer ¶
func (*APIClient) FindDispute ¶
func (*APIClient) FindMerchantAccount ¶
func (*APIClient) FindPayMethod ¶
func (*APIClient) FindPaymentMethodNonce ¶
func (*APIClient) FindSubscription ¶
func (*APIClient) FindTransaction ¶
func (*APIClient) FindTransactionLineItem ¶
func (*APIClient) GenerateSettlement ¶
func (c *APIClient) GenerateSettlement(ctx context.Context, s *Settlement) (*SettlementBatchSummary, error)
func (*APIClient) GenerateToken ¶
func (*APIClient) GenerateWithCustomer ¶
func (*APIClient) GenerateWithRequest ¶
func (*APIClient) HoldInEscrow ¶
func (*APIClient) Parse ¶
func (c *APIClient) Parse(signature, payload string) (*Notification, error)
func (*APIClient) ParseRequest ¶
func (c *APIClient) ParseRequest(r *http.Request) (*Notification, error)
func (*APIClient) RefundWithRequest ¶
func (*APIClient) ReleaseFromEscrow ¶
func (*APIClient) RemoveEvidence ¶
func (*APIClient) RetryCharge ¶
func (c *APIClient) RetryCharge(ctx context.Context, txReq *SubscriptionTransactionRequest) error
func (*APIClient) SamplePayload ¶
func (*APIClient) SandboxRequest ¶
func (*APIClient) SandboxSettle ¶
func (*APIClient) SandboxSettlementConfirm ¶
func (*APIClient) SandboxSettlementDecline ¶
func (*APIClient) SandboxSettlementPending ¶
func (*APIClient) SearchCustomer ¶
func (c *APIClient) SearchCustomer(ctx context.Context, query *Search, result *SearchResult) (*CustomerSearchResult, error)
func (*APIClient) SearchCustomersByIDs ¶
func (*APIClient) SearchPaypalAccount ¶
func (*APIClient) SearchSubscription ¶
func (c *APIClient) SearchSubscription(ctx context.Context, query *Search, searchResult *SearchResult) (*SubscriptionSearchResult, error)
func (*APIClient) SearchSubscriptions ¶
func (*APIClient) SearchTx ¶
func (c *APIClient) SearchTx(ctx context.Context, query *Search, searchResult *SearchResult) (*TransactionSearchResult, error)
func (*APIClient) SubmitForSettlement ¶
func (*APIClient) UpdateAddress ¶
func (*APIClient) UpdateCard ¶
func (c *APIClient) UpdateCard(ctx context.Context, card *CreditCard) (*CreditCard, error)
func (*APIClient) UpdateCustomer ¶
func (*APIClient) UpdateMerchantAccount ¶
func (c *APIClient) UpdateMerchantAccount(ctx context.Context, account *MerchantAccount) (*MerchantAccount, error)
func (*APIClient) UpdatePayMethod ¶
func (c *APIClient) UpdatePayMethod(ctx context.Context, token string, method *PaymentMethodRequest) (*PaymentMethod, error)
func (*APIClient) UpdatePaypalAccount ¶
func (c *APIClient) UpdatePaypalAccount(ctx context.Context, paypalAccount *PayPalAccount) (*PayPalAccount, error)
func (*APIClient) UpdateSubscription ¶
func (c *APIClient) UpdateSubscription(ctx context.Context, subId string, sub *SubscriptionRequest) (*Subscription, error)
type APIError ¶
type APIError struct { ErrorMessage string MerchantAccount *MerchantAccount Transaction *Tx // contains filtered or unexported fields }
func (*APIError) All ¶
func (e *APIError) All() []ValidationError
func (*APIError) For ¶
func (e *APIError) For(name string) *ValidationErrors
func (*APIError) StatusCode ¶
func (*APIError) UnmarshalXML ¶
type AVSResponseCode ¶
type AVSResponseCode string
const ( AVSResponseCodeMatches AVSResponseCode = "M" // The postal code or street address provided matches the information on file with the cardholder's bank. AVSResponseCodeDoesNotMatch AVSResponseCode = "N" // The postal code or street address provided does not match the information on file with the cardholder's bank. AVSResponseCodeNotVerified AVSResponseCode = "U" // The card-issuing bank received the postal code or street address but did not verify whether it was correct. This typically happens if the processor declines an authorization before the bank evaluates the postal code. AVSResponseCodeNotProvided AVSResponseCode = "I" // No postal code or street address was provided. AVSResponseCodeNotSupported AVSResponseCode = "S" // AVS information was provided but the card-issuing bank does not participate in address verification. This typically indicates a card-issuing bank outside of the US, Canada, and the UK. AVSResponseCodeSystemError AVSResponseCode = "E" // A system error prevented any verification of street address or postal code. AVSResponseCodeNotApplicable AVSResponseCode = "A" // AVS information was provided but this type of transaction does not support address verification. )
type AddModificationRequest ¶
type AddModificationRequest struct { ModificationRequest InheritedFromID string `xml:"inherited-from-id,omitempty"` }
type AddOn ¶
type AddOn struct { XMLName string `xml:"add-on"` Modification }
type Address ¶
type Address struct { XMLName xml.Name Id string `xml:"id,omitempty"` CustomerId string `xml:"customer-id,omitempty"` FirstName string `xml:"first-name,omitempty"` LastName string `xml:"last-name,omitempty"` Company string `xml:"company,omitempty"` StreetAddress string `xml:"street-address,omitempty"` ExtendedAddress string `xml:"extended-address,omitempty"` Locality string `xml:"locality,omitempty"` Region string `xml:"region,omitempty"` PostalCode string `xml:"postal-code,omitempty"` CountryCodeAlpha2 string `xml:"country-code-alpha2,omitempty"` CountryCodeAlpha3 string `xml:"country-code-alpha3,omitempty"` CountryCodeNumeric string `xml:"country-code-numeric,omitempty"` CountryName string `xml:"country-name,omitempty"` CreatedAt *time.Time `xml:"created-at,omitempty"` UpdatedAt *time.Time `xml:"updated-at,omitempty"` }
type AddressRequest ¶
type AddressRequest struct { XMLName xml.Name `xml:"address"` FirstName string `xml:"first-name,omitempty"` LastName string `xml:"last-name,omitempty"` Company string `xml:"company,omitempty"` StreetAddress string `xml:"street-address,omitempty"` ExtendedAddress string `xml:"extended-address,omitempty"` Locality string `xml:"locality,omitempty"` Region string `xml:"region,omitempty"` PostalCode string `xml:"postal-code,omitempty"` CountryCodeAlpha2 string `xml:"country-code-alpha2,omitempty"` CountryCodeAlpha3 string `xml:"country-code-alpha3,omitempty"` CountryCodeNumeric string `xml:"country-code-numeric,omitempty"` CountryName string `xml:"country-name,omitempty"` }
type AndroidPayCard ¶
type AndroidPayCard struct { XMLName xml.Name `xml:"android-pay-card"` Token string `xml:"token"` CardType string `xml:"-"` Last4 string `xml:"-"` SourceCardType string `xml:"source-card-type"` SourceCardLast4 string `xml:"source-card-last-4"` SourceDescription string `xml:"source-description"` VirtualCardType string `xml:"virtual-card-type"` VirtualCardLast4 string `xml:"virtual-card-last-4"` ExpirationMonth string `xml:"expiration-month"` ExpirationYear string `xml:"expiration-year"` BIN string `xml:"bin"` GoogleTransactionID string `xml:"google-transaction-id"` ImageURL string `xml:"image-url"` Default bool `xml:"default"` CustomerId string `xml:"customer-id"` CreatedAt *time.Time `xml:"created-at"` UpdatedAt *time.Time `xml:"updated-at"` Subscriptions *Subscriptions `xml:"subscriptions"` }
func (*AndroidPayCard) AllSubscriptions ¶
func (a *AndroidPayCard) AllSubscriptions() []*Subscription
func (*AndroidPayCard) ToPaymentMethod ¶
func (a *AndroidPayCard) ToPaymentMethod() *PaymentMethod
func (*AndroidPayCard) UnmarshalXML ¶
func (a *AndroidPayCard) UnmarshalXML(decoder *xml.Decoder, start xml.StartElement) error
type AndroidPayCards ¶
type AndroidPayCards struct {
AndroidPayCard []*AndroidPayCard `xml:"android-pay-card"`
}
func (*AndroidPayCards) PaymentMethods ¶
func (a *AndroidPayCards) PaymentMethods() []PaymentMethod
type AndroidPayDetail ¶
type AndroidPayDetail struct { Token string `xml:"token"` CardType string `xml:"-"` Last4 string `xml:"-"` SourceCardType string `xml:"source-card-type"` SourceCardLast4 string `xml:"source-card-last-4"` SourceDescription string `xml:"source-description"` VirtualCardType string `xml:"virtual-card-type"` VirtualCardLast4 string `xml:"virtual-card-last-4"` ExpirationMonth string `xml:"expiration-month"` ExpirationYear string `xml:"expiration-year"` BIN string `xml:"bin"` GoogleTransactionID string `xml:"google-transaction-id"` ImageURL string `xml:"image-url"` }
func (*AndroidPayDetail) UnmarshalXML ¶
func (a *AndroidPayDetail) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
type ApplePayCard ¶
type ApplePayCard struct { XMLName xml.Name `xml:"apple-pay-card"` Token string `xml:"token"` ImageURL string `xml:"image-url"` CardType string `xml:"card-type"` PaymentInstrumentName string `xml:"payment-instrument-name"` SourceDescription string `xml:"source-description"` BIN string `xml:"bin"` Last4 string `xml:"last-4"` ExpirationMonth string `xml:"expiration-month"` ExpirationYear string `xml:"expiration-year"` Expired bool `xml:"expired"` Default bool `xml:"default"` CustomerId string `xml:"customer-id"` CreatedAt *time.Time `xml:"created-at"` UpdatedAt *time.Time `xml:"updated-at"` Subscriptions *Subscriptions `xml:"subscriptions"` }
func (*ApplePayCard) AllSubscriptions ¶
func (a *ApplePayCard) AllSubscriptions() []*Subscription
func (*ApplePayCard) ToPaymentMethod ¶
func (a *ApplePayCard) ToPaymentMethod() *PaymentMethod
type ApplePayCards ¶
type ApplePayCards struct {
Cards []*ApplePayCard `xml:"apple-pay-card"`
}
func (*ApplePayCards) PaymentMethods ¶
func (a *ApplePayCards) PaymentMethods() []PaymentMethod
type ApplePayDetail ¶
type ApplePayDetail struct { Token string `xml:"token"` CardType string `xml:"card-type"` PaymentInstrumentName string `xml:"payment-instrument-name"` SourceDescription string `xml:"source-description"` CardholderName string `xml:"cardholder-name"` ExpirationMonth string `xml:"expiration-month"` ExpirationYear string `xml:"expiration-year"` Last4 string `xml:"last-4"` BIN string `xml:"bin"` }
type CVVResponseCode ¶
type CVVResponseCode string
const ( CVVResponseCodeMatches CVVResponseCode = "M" // CVVResponseCodeMatches means the CVV provided matches the information on file with the cardholder's bank. CVVResponseCodeDoesNotMatch CVVResponseCode = "N" // CVVResponseCodeDoesNotMatch means the The CVV provided does not match the information on file with the cardholder's bank. CVVResponseCodeNotVerified CVVResponseCode = "U" // CVVResponseCodeNotVerified means the the card-issuing bank received the CVV but did not verify whether it was correct. This typically happens if the processor declines an authorization before the bank evaluates the CVV. CVVResponseCodeNotProvided CVVResponseCode = "I" // CVVResponseCodeNotProvided means the no CVV was provided. CVVResponseCodeIssuerDoesNotParticipate CVVResponseCode = "S" // CVVResponseCodeIssuerDoesNotParticipate means the the CVV was provided but the card-issuing bank does not participate in card verification. CVVResponseCodeNotApplicable CVVResponseCode = "A" // CVVResponseCodeNotApplicable means the the CVV was provided but this type of transaction does not support card verification. )
type CreditCard ¶
type CreditCard struct { XMLName xml.Name `xml:"credit-card"` CustomerId string `xml:"customer-id,omitempty"` Token string `xml:"token,omitempty"` PaymentMethodNonce string `xml:"payment-method-nonce,omitempty"` Number string `xml:"number,omitempty"` ExpirationDate string `xml:"expiration-date,omitempty"` ExpirationMonth string `xml:"expiration-month,omitempty"` ExpirationYear string `xml:"expiration-year,omitempty"` CVV string `xml:"cvv,omitempty"` VenmoSDKPaymentMethodCode string `xml:"venmo-sdk-payment-method-code,omitempty"` Last4 string `xml:"last-4,omitempty"` Commercial string `xml:"commercial,omitempty"` Debit string `xml:"debit,omitempty"` DurbinRegulated string `xml:"durbin-regulated,omitempty"` Healthcare string `xml:"healthcare,omitempty"` Payroll string `xml:"payroll,omitempty"` Prepaid string `xml:"prepaid,omitempty"` CountryOfIssuance string `xml:"country-of-issuance,omitempty"` IssuingBank string `xml:"issuing-bank,omitempty"` UniqueNumberIdentifier string `xml:"unique-number-identifier,omitempty"` Bin string `xml:"bin,omitempty"` CardType string `xml:"card-type,omitempty"` CardholderName string `xml:"cardholder-name,omitempty"` CustomerLocation string `xml:"customer-location,omitempty"` ImageURL string `xml:"image-url,omitempty"` ProductID string `xml:"product-id,omitempty"` VenmoSDK bool `xml:"venmo-sdk,omitempty"` Default bool `xml:"default,omitempty"` Expired bool `xml:"expired,omitempty"` Options *CreditCardOptions `xml:"options,omitempty"` UpdatedAt *time.Time `xml:"updated-at,omitempty"` CreatedAt *time.Time `xml:"created-at,omitempty"` BillingAddress *Address `xml:"billing-address,omitempty"` Subscriptions *Subscriptions `xml:"subscriptions,omitempty"` }
func (*CreditCard) AllSubscriptions ¶
func (c *CreditCard) AllSubscriptions() []*Subscription
func (*CreditCard) ToPaymentMethod ¶
func (cc *CreditCard) ToPaymentMethod() *PaymentMethod
type CreditCardOptions ¶
type CreditCardOptions struct { VenmoSDKSession string `xml:"venmo-sdk-session,omitempty"` VerificationMerchantAccountId string `xml:"verification-merchant-account-id,omitempty"` UpdateExistingToken string `xml:"update-existing-token,omitempty"` MakeDefault bool `xml:"make-default,omitempty"` FailOnDuplicatePaymentMethod bool `xml:"fail-on-duplicate-payment-method,omitempty"` VerifyCard *bool `xml:"verify-card,omitempty"` }
type CreditCardSearchResult ¶
type CreditCardSearchResult struct { TotalItems int CurrentPageNumber int PageSize int TotalIDs []string CreditCards []*CreditCard }
type CreditCards ¶
type CreditCards struct {
CreditCard []*CreditCard `xml:"credit-card"`
}
func (*CreditCards) PaymentMethods ¶
func (c *CreditCards) PaymentMethods() []PaymentMethod
type CustomFields ¶
func (CustomFields) MarshalXML ¶
func (c CustomFields) MarshalXML(encoder *xml.Encoder, start xml.StartElement) error
func (*CustomFields) UnmarshalXML ¶
func (c *CustomFields) UnmarshalXML(decoder *xml.Decoder, start xml.StartElement) error
type Customer ¶
type Customer struct { XMLName string `xml:"customer"` Id string `xml:"id"` FirstName string `xml:"first-name"` LastName string `xml:"last-name"` Company string `xml:"company"` Email string `xml:"email"` Phone string `xml:"phone"` Fax string `xml:"fax"` Website string `xml:"website"` PaymentMethodNonce string `xml:"payment-method-nonce"` CustomFields CustomFields `xml:"custom-fields"` CreditCard *CreditCard `xml:"credit-card"` CreditCards *CreditCards `xml:"credit-cards"` PayPalAccounts *PayPalAccounts `xml:"paypal-accounts"` VenmoAccounts *VenmoAccounts `xml:"venmo-accounts"` AndroidPayCards *AndroidPayCards `xml:"android-pay-cards"` ApplePayCards *ApplePayCards `xml:"apple-pay-cards"` Addresses *Addresses `xml:"addresses"` CreatedAt *time.Time `xml:"created-at"` UpdatedAt *time.Time `xml:"updated-at"` }
func (*Customer) DefaultCreditCard ¶
func (c *Customer) DefaultCreditCard() *CreditCard
func (*Customer) DefaultPaymentMethod ¶
func (c *Customer) DefaultPaymentMethod() *PaymentMethod
func (*Customer) PaymentMethods ¶
func (c *Customer) PaymentMethods() []PaymentMethod
type CustomerRequest ¶
type CustomerRequest struct { XMLName string `xml:"customer"` ID string `xml:"id,omitempty"` FirstName string `xml:"first-name,omitempty"` LastName string `xml:"last-name,omitempty"` Company string `xml:"company,omitempty"` Email string `xml:"email,omitempty"` Phone string `xml:"phone,omitempty"` Fax string `xml:"fax,omitempty"` Website string `xml:"website,omitempty"` PaymentMethodNonce string `xml:"payment-method-nonce,omitempty"` CustomFields CustomFields `xml:"custom-fields,omitempty"` CreditCard *CreditCard `xml:"credit-card,omitempty"` }
type CustomerSearchResult ¶
type DailyReport ¶
type Descriptor ¶
type Disbursement ¶
type Disbursement struct { XMLName xml.Name `xml:"disbursement"` Id string `xml:"id"` ExceptionMessage string `xml:"exception-message"` CurrencyIsoCode string `xml:"currency-iso-code"` Status string `xml:"status"` FollowUpAction string `xml:"follow-up-action"` Success bool `xml:"success"` Retry bool `xml:"retry"` IsSubmerchant bool `xml:"sub-merchant-account"` TransactionIds []string `xml:"transaction-ids>item"` DisbursementDate *Date `xml:"disbursement-date"` Amount *Decimal `xml:"amount"` MerchantAccount *MerchantAccount `xml:"merchant-account"` }
func (*Disbursement) Transactions ¶
func (d *Disbursement) Transactions(ctx context.Context, c *APIClient) (*TransactionSearchResult, error)
type DisbursementDetail ¶
type DisbursementDetail struct { XMLName xml.Name `xml:"disbursement-details"` DisbursementDate string `xml:"disbursement-date"` SettlementAmount *Decimal `xml:"settlement-amount"` SettlementCurrencyIsoCode string `xml:"settlement-currency-iso-code"` SettlementCurrencyExchangeRate *Decimal `xml:"settlement-currency-exchange-rate"` FundsHeld bool `xml:"funds-held"` Success bool `xml:"success"` }
type Discount ¶
type Discount struct { XMLName string `xml:"discount"` Modification }
type DiscountList ¶
type Dispute ¶
type Dispute struct { XMLName string `xml:"dispute"` CaseNumber string `xml:"case-number"` CurrencyISOCode string `xml:"currency-iso-code"` ID string `xml:"id"` MerchantAccountID string `xml:"merchant-account-id"` OriginalDisputeID string `xml:"original-dispute-id"` ProcessorComments string `xml:"processor-comments"` ReturnCode string `xml:"return-code"` ReceivedDate string `xml:"received-date"` ReferenceNumber string `xml:"reference-number"` ReplyByDate string `xml:"reply-by-date"` Kind DisputeKind `xml:"kind"` Reason DisputeReason `xml:"reason"` Status DisputeStatus `xml:"status"` AmountDisputed *Decimal `xml:"amount-disputed"` AmountWon *Decimal `xml:"amount-won"` UpdatedAt *time.Time `xml:"updated-at"` CreatedAt *time.Time `xml:"created-at"` Evidence []*DisputeEvidence `xml:"evidence>evidence"` StatusHistory []*DisputeStatusHistoryEvent `xml:"status-history>status-history"` Transaction *DisputeTransaction `xml:"transaction"` }
type DisputeCategory ¶
type DisputeCategory string
const ( DisputeDeviceId DisputeCategory = "DEVICE_ID" DisputeDeviceName DisputeCategory = "DEVICE_NAME" DisputePriorDigitalGoodsTransactionArn DisputeCategory = "PRIOR_DIGITAL_GOODS_TRANSACTION_ARN" DisputePriorDigitalGoodsTransactionDateTime DisputeCategory = "PRIOR_DIGITAL_GOODS_TRANSACTION_DATE_TIME" DisputeDownloadDateTime DisputeCategory = "DOWNLOAD_DATE_TIME" DisputeGeographicalLocation DisputeCategory = "GEOGRAPHICAL_LOCATION" DisputeLegitPaymentsForSameMerchandise DisputeCategory = "LEGIT_PAYMENTS_FOR_SAME_MERCHANDISE" DisputeMerchantWebsiteOrAppAccess DisputeCategory = "MERCHANT_WEBSITE_OR_APP_ACCESS" DisputePriorNonDisputedTransactionArn DisputeCategory = "PRIOR_NON_DISPUTED_TRANSACTION_ARN" DisputePriorNonDisputedTransactionDateTime DisputeCategory = "PRIOR_NON_DISPUTED_TRANSACTION_DATE_TIME" DisputePriorNonDisputedTransactionEmailAddress DisputeCategory = "PRIOR_NON_DISPUTED_TRANSACTION_EMAIL_ADDRESS" DisputePriorNonDisputedTransactionIpAddress DisputeCategory = "PRIOR_NON_DISPUTED_TRANSACTION_IP_ADDRESS" DisputePriorNonDisputedTransactionPhoneNumber DisputeCategory = "PRIOR_NON_DISPUTED_TRANSACTION_PHONE_NUMBER" DisputePriorNonDisputedTransactionPhysicalAddress DisputeCategory = "PRIOR_NON_DISPUTED_TRANSACTION_PHYSICAL_ADDRESS" DisputeProfileSetupOrAppAccess DisputeCategory = "PROFILE_SETUP_OR_APP_ACCESS" DisputeProofOfAuthorizedSigner DisputeCategory = "PROOF_OF_AUTHORIZED_SIGNER" DisputeProofOfDeliveryEmpAddress DisputeCategory = "PROOF_OF_DELIVERY_EMP_ADDRESS" DisputeProofOfDelivery DisputeCategory = "PROOF_OF_DELIVERY" DisputeProofOfPossessionOrUsage DisputeCategory = "PROOF_OF_POSSESSION_OR_USAGE" DisputePurchaserEmailAddress DisputeCategory = "PURCHASER_EMAIL_ADDRESS" DisputePurchaserIpAddress DisputeCategory = "PURCHASER_IP_ADDRESS" DisputePurchaserName DisputeCategory = "PURCHASER_NAME" DisputeRecurringTransactionArn DisputeCategory = "RECURRING_TRANSACTION_ARN" DisputeRecurringTransactionDateTime DisputeCategory = "RECURRING_TRANSACTION_DATE_TIME" DisputeSignedDeliveryForm DisputeCategory = "SIGNED_DELIVERY_FORM" DisputeSignedOrderForm DisputeCategory = "SIGNED_ORDER_FORM" DisputeTicketProof DisputeCategory = "TICKET_PROOF" )
type DisputeEvidence ¶
type DisputeEvidence struct { XMLName string `xml:"evidence"` Comment string `xml:"comment"` CreatedAt *time.Time `xml:"created-at"` ID string `xml:"id"` SentToProcessorAt string `xml:"sent-to-processor-at"` URL string `xml:"url"` Category DisputeCategory `xml:"category"` SequenceNumber string `xml:"sequence-number"` }
type DisputeKind ¶
type DisputeKind string
const ( DisputeChargeback DisputeKind = "chargeback" DisputePreArbitration DisputeKind = "pre_arbitration" DisputeRetrieval DisputeKind = "retrieval" )
type DisputeReason ¶
type DisputeReason string
const ( CancelledRecurringTransactionReason DisputeReason = "cancelled_recurring_transaction" CreditNotProcessedReason DisputeReason = "credit_not_processed" DuplicateDisputeReason DisputeReason = "duplicate" FraudDisputeReason DisputeReason = "fraud" GeneralReason DisputeReason = "general" InvalidAccountReason DisputeReason = "invalid_account" NotRecognizedReason DisputeReason = "not_recognized" ProductNotReceivedReason DisputeReason = "product_not_received" ProductUnsatisfactoryReason DisputeReason = "product_unsatisfactory" TransactionAmountDiffersReason DisputeReason = "transaction_amount_differs" )
type DisputeStatus ¶
type DisputeStatus string
const ( DisputeStatusAccepted DisputeStatus = "accepted" DisputeStatusDisputed DisputeStatus = "disputed" DisputeStatusExpired DisputeStatus = "expired" DisputeStatusOpen DisputeStatus = "open" DisputeStatusLost DisputeStatus = "lost" DisputeStatusWon DisputeStatus = "won" )
type DisputeTextEvidenceRequest ¶
type DisputeTextEvidenceRequest struct { XMLName xml.Name `xml:"evidence"` Content string `xml:"comments"` Category DisputeCategory `xml:"category,omitempty"` SequenceNumber string `xml:"sequence-number,omitempty"` }
type DisputeTransaction ¶
type DisputeTransaction struct { XMLName string `xml:"transaction"` ID string `xml:"id"` OrderID string `xml:"order-id"` PaymentInstrumentSubtype string `xml:"payment-instrument-subtype"` PurchaseOrderNumber string `xml:"purchase-order-number"` Amount *Decimal `xml:"amount"` CreatedAt *time.Time `xml:"created-at"` }
type EscrowStatus ¶
type EscrowStatus string
const ( EscrowHoldPending EscrowStatus = "hold_pending" EscrowHeld EscrowStatus = "held" EscrowReleasePending EscrowStatus = "release_pending" EscrowReleased EscrowStatus = "released" EscrowRefunded EscrowStatus = "refunded" )
type InvalidResponseError ¶
type LineItem ¶
type LineItem struct { Kind LineItemKind `xml:"kind"` Name string `xml:"name"` Description string `xml:"description"` UnitOfMeasure string `xml:"unit-of-measure"` ProductCode string `xml:"product-code"` CommodityCode string `xml:"commodity-code"` URL string `xml:"url"` Quantity *Decimal `xml:"quantity"` UnitAmount *Decimal `xml:"unit-amount"` UnitTaxAmount *Decimal `xml:"unit-tax-amount"` TotalAmount *Decimal `xml:"total-amount"` TaxAmount *Decimal `xml:"tax-amount"` DiscountAmount *Decimal `xml:"discount-amount"` }
type LineItemKind ¶
type LineItemKind string
const ( LineItemDebitKind LineItemKind = "debit" LineItemCreditKind LineItemKind = "credit" )
type LineItemRequest ¶
type LineItemRequest struct { Kind LineItemKind `xml:"kind"` Name string `xml:"name"` Description string `xml:"description,omitempty"` UnitOfMeasure string `xml:"unit-of-measure,omitempty"` ProductCode string `xml:"product-code,omitempty"` CommodityCode string `xml:"commodity-code,omitempty"` URL string `xml:"url,omitempty"` Quantity *Decimal `xml:"quantity"` UnitAmount *Decimal `xml:"unit-amount"` UnitTaxAmount *Decimal `xml:"unit-tax-amount,omitempty"` TotalAmount *Decimal `xml:"total-amount"` TaxAmount *Decimal `xml:"tax-amount,omitempty"` DiscountAmount *Decimal `xml:"discount-amount,omitempty"` }
type LineItemRequests ¶
type LineItemRequests []*LineItemRequest
func (LineItemRequests) MarshalXML ¶
func (r LineItemRequests) MarshalXML(e *xml.Encoder, start xml.StartElement) error
type MerchantAccount ¶
type MerchantAccount struct { XMLName string `xml:"merchant-account,omitempty"` Id string `xml:"id,omitempty"` MasterMerchantAccountId string `xml:"master-merchant-account-id,omitempty"` TOSAccepted bool `xml:"tos_accepted,omitempty"` Individual *MerchantAccountPerson `xml:"individual,omitempty"` Business *MerchantAccountBusiness `xml:"business,omitempty"` FundingOptions *MerchantAccountFundingOptions `xml:"funding,omitempty"` Status string `xml:"status,omitempty"` }
type MerchantAccountBusiness ¶
type MerchantAccountPerson ¶
type MerchantAccountPerson struct { FirstName string `xml:"first-name,omitempty"` LastName string `xml:"last-name,omitempty"` Email string `xml:"email,omitempty"` Phone string `xml:"phone,omitempty"` DateOfBirth string `xml:"date-of-birth,omitempty"` SSN string `xml:"ssn,omitempty"` Address *Address `xml:"address,omitempty"` }
type Modification ¶
type Modification struct { Id string `xml:"id"` Amount *Decimal `xml:"amount"` Description string `xml:"description"` Kind string `xml:"kind"` Name string `xml:"name"` NeverExpires bool `xml:"never-expires"` Quantity int `xml:"quantity"` NumberOfBillingCycles int `xml:"number-of-billing-cycles"` CurrentBillingCycle int `xml:"current-billing-cycle"` UpdatedAt *time.Time `xml:"updated_at"` }
type ModificationRequest ¶
type ModificationsRequest ¶
type ModificationsRequest struct { Add []AddModificationRequest Update []UpdateModificationRequest RemoveExistingIDs []string }
func (ModificationsRequest) MarshalXML ¶
func (m ModificationsRequest) MarshalXML(e *xml.Encoder, start xml.StartElement) error
type MultiField ¶
type Notification ¶
type Notification struct { XMLName xml.Name `xml:"notification"` Kind string `xml:"kind"` Timestamp time.Time `xml:"timestamp"` Subject *Subject `xml:"subject"` }
func (*Notification) AccountUpdaterDailyReport ¶
func (n *Notification) AccountUpdaterDailyReport() *DailyReport
func (*Notification) Disbursement ¶
func (n *Notification) Disbursement() *Disbursement
func (*Notification) Dispute ¶
func (n *Notification) Dispute() *Dispute
func (*Notification) MerchantAccount ¶
func (n *Notification) MerchantAccount() *MerchantAccount
type PayPalAccount ¶
type PayPalAccount struct { XMLName xml.Name `xml:"paypal-account"` CustomerId string `xml:"customer-id,omitempty"` Token string `xml:"token,omitempty"` Email string `xml:"email,omitempty"` ImageURL string `xml:"image-url,omitempty"` Default bool `xml:"default,omitempty"` CreatedAt *time.Time `xml:"created-at,omitempty"` UpdatedAt *time.Time `xml:"updated-at,omitempty"` Subscriptions *Subscriptions `xml:"subscriptions,omitempty"` Options *PayPalAccountOptions `xml:"options,omitempty"` }
func (*PayPalAccount) AllSubscriptions ¶
func (a *PayPalAccount) AllSubscriptions() []*Subscription
func (*PayPalAccount) ToPaymentMethod ¶
func (a *PayPalAccount) ToPaymentMethod() *PaymentMethod
type PayPalAccountOptions ¶
type PayPalAccountOptions struct {
MakeDefault bool `xml:"make-default,omitempty"`
}
type PayPalAccounts ¶
type PayPalAccounts struct {
Accounts []*PayPalAccount `xml:"paypal-account"`
}
func (*PayPalAccounts) PaymentMethods ¶
func (a *PayPalAccounts) PaymentMethods() []PaymentMethod
type PayPalDetail ¶
type PayPalDetail struct { PayerEmail string `xml:"payer-email,omitempty"` PaymentID string `xml:"payment-id,omitempty"` AuthorizationID string `xml:"authorization-id,omitempty"` Token string `xml:"token,omitempty"` ImageURL string `xml:"image-url,omitempty"` DebugID string `xml:"debug-id,omitempty"` PayeeEmail string `xml:"payee-email,omitempty"` CustomField string `xml:"custom-field,omitempty"` PayerID string `xml:"payer-id,omitempty"` PayerFirstName string `xml:"payer-first-name,omitempty"` PayerLastName string `xml:"payer-last-name,omitempty"` PayerStatus string `xml:"payer-status,omitempty"` SellerProtectionStatus string `xml:"seller-protection-status,omitempty"` RefundID string `xml:"refund-id,omitempty"` CaptureID string `xml:"capture-id,omitempty"` TransactionFeeAmount string `xml:"transaction-fee-amount,omitempty"` TransactionFeeCurrencyISOCode string `xml:"transaction-fee-currency-iso-code,omitempty"` Description string `xml:"description,omitempty"` }
type PaymentMethod ¶
type PaymentMethodNonce ¶
type PaymentMethodNonce struct { Type string `xml:"type"` Nonce string `xml:"nonce"` Details *PaymentMethodNonceDetails `xml:"details"` ThreeDSecureInfo *ThreeDSecureInfo `xml:"three-d-secure-info"` }
type PaymentMethodRequest ¶
type PaymentMethodRequestOptions ¶
type PaymentMethodRequestOptions struct { VerificationMerchantAccountId string `xml:"verification-merchant-account-id,omitempty"` MakeDefault bool `xml:"make-default,omitempty"` FailOnDuplicatePaymentMethod bool `xml:"fail-on-duplicate-payment-method,omitempty"` VerifyCard *bool `xml:"verify-card,omitempty"` }
type PaymentType ¶
type PaymentType string
const ( AndroidPayCardType PaymentType = "android_pay_card" ApplePayCardType PaymentType = "apple_pay_card" CreditCardType PaymentType = "credit_card" MasterpassCardType PaymentType = "masterpass_card" PaypalAccountType PaymentType = "paypal_account" VenmoAccountType PaymentType = "venmo_account" VisaCheckoutCardType PaymentType = "visa_checkout_card" )
type Plan ¶
type Plan struct { XMLName string `xml:"plan"` Id string `xml:"id"` MerchantId string `xml:"merchant-id"` BillingDayOfMonth *int `xml:"billing-day-of-month"` BillingFrequency *int `xml:"billing-frequency"` CurrencyISOCode string `xml:"currency-iso-code"` Description string `xml:"description"` Name string `xml:"name"` NumberOfBillingCycles *int `xml:"number-of-billing-cycles"` Price *Decimal `xml:"price"` TrialDuration *int `xml:"trial-duration"` TrialDurationUnit string `xml:"trial-duration-unit"` TrialPeriod bool `xml:"trial-period"` CreatedAt *time.Time `xml:"created-at"` UpdatedAt *time.Time `xml:"updated-at"` AddOns AddOnList `xml:"add-ons"` Discounts DiscountList `xml:"discounts"` }
type RangeField ¶
type RefundRequest ¶
type RejectionReason ¶
type RejectionReason string
const ( ApplicationIncompleteReason RejectionReason = "application_incomplete" AVSReason RejectionReason = "avs" AVSAndCVVReason RejectionReason = "avs_and_cvv" CVVReason RejectionReason = "cvv" DuplicateReason RejectionReason = "duplicate" FraudReason RejectionReason = "fraud" ThreeDSecureReason RejectionReason = "three_d_secure" UnknownReason RejectionReason = "unrecognized" )
type ResponseCode ¶
type ResponseCode int
func (ResponseCode) Int ¶
func (rc ResponseCode) Int() int
func (ResponseCode) MarshalText ¶
func (rc ResponseCode) MarshalText() ([]byte, error)
func (*ResponseCode) UnmarshalText ¶
func (rc *ResponseCode) UnmarshalText(text []byte) error
type ResponseType ¶
type ResponseType string
const ( ResponseTypeApproved ResponseType = "approved" ResponseTypeSoftDeclined ResponseType = "soft_declined" ResponseTypeHardDeclined ResponseType = "hard_declined" )
type RiskDataRequest ¶
type Search ¶
type Search struct {
// contains filtered or unexported fields
}
func (*Search) AddMultiField ¶
func (s *Search) AddMultiField(field string) *MultiField
func (*Search) AddRangeField ¶
func (s *Search) AddRangeField(field string) *RangeField
func (*Search) AddTextField ¶
func (*Search) AddTimeField ¶
func (*Search) MarshalXML ¶
func (*Search) ShallowCopy ¶
type Settlement ¶
type SettlementBatchSummary ¶
type SettlementBatchSummary struct { XMLName string `xml:"settlement-batch-summary"` Records XMLRecords `xml:"records"` }
type SignatureError ¶
type SignatureError struct {
Message string
}
func (SignatureError) Error ¶
func (i SignatureError) Error() string
type Status ¶
type Status string
const ( StatusAuthorizationExpired Status = "authorization_expired" StatusAuthorizing Status = "authorizing" StatusAuthorized Status = "authorized" StatusGatewayRejected Status = "gateway_rejected" StatusFailed Status = "failed" StatusProcessorDeclined Status = "processor_declined" StatusSettled Status = "settled" StatusSettlementConfirmed Status = "settlement_confirmed" StatusSettlementDeclined Status = "settlement_declined" StatusSettlementPending Status = "settlement_pending" StatusSettling Status = "settling" StatusSubmittedForSettlement Status = "submitted_for_settlement" StatusVoided Status = "voided" StatusUnknown Status = "unrecognized" )
type Subject ¶
type Subject struct { XMLName xml.Name `xml:"subject"` APIErrorResponse *APIError `xml:"api-error-response,omitempty"` Disbursement *Disbursement `xml:"disbursement,omitempty"` Subscription *Subscription `xml:",omitempty"` MerchantAccount *MerchantAccount `xml:"merchant-account,omitempty"` Transaction *Tx `xml:",omitempty"` Dispute *Dispute `xml:"dispute,omitempty"` AccountUpdaterDailyReport *DailyReport `xml:"account-updater-daily-report,omitempty"` }
type Subscription ¶
type Subscription struct { XMLName string `xml:"subscription"` Id string `xml:"id"` BillingDayOfMonth string `xml:"billing-day-of-month"` BillingPeriodEndDate string `xml:"billing-period-end-date"` BillingPeriodStartDate string `xml:"billing-period-start-date"` CurrentBillingCycle string `xml:"current-billing-cycle"` DaysPastDue string `xml:"days-past-due"` FailureCount string `xml:"failure-count"` FirstBillingDate string `xml:"first-billing-date"` MerchantAccountId string `xml:"merchant-account-id"` NextBillingDate string `xml:"next-billing-date"` PaidThroughDate string `xml:"paid-through-date"` PaymentMethodToken string `xml:"payment-method-token"` PlanId string `xml:"plan-id"` TrialDurationUnit string `xml:"trial-duration-unit"` TrialDuration string `xml:"trial-duration"` Status SubscriptionStatus `xml:"status"` NeverExpires bool `xml:"never-expires"` TrialPeriod bool `xml:"trial-period"` Balance *Decimal `xml:"balance"` NextBillAmount *Decimal `xml:"next-bill-amount"` NextBillingPeriodAmount *Decimal `xml:"next-billing-period-amount"` Price *Decimal `xml:"price"` Transactions *Transactions `xml:"transactions"` Options *SubscriptionOpts `xml:"options"` Descriptor *Descriptor `xml:"descriptor"` AddOns *AddOnList `xml:"add-ons"` Discounts *DiscountList `xml:"discounts"` NumberOfBillingCycles *int `xml:"number-of-billing-cycles"` CreatedAt *time.Time `xml:"created-at,omitempty"` UpdatedAt *time.Time `xml:"updated-at,omitempty"` StatusEvents []*SubscriptionStatusEvent `xml:"status-history>status-event"` }
type SubscriptionDetail ¶
type SubscriptionOpts ¶
type SubscriptionOpts struct { DoNotInheritAddOnsOrDiscounts bool `xml:"do-not-inherit-add-ons-or-discounts,omitempty"` ProrateCharges bool `xml:"prorate-charges,omitempty"` ReplaceAllAddOnsAndDiscounts bool `xml:"replace-all-add-ons-and-discounts,omitempty"` RevertSubscriptionOnProrationFailure bool `xml:"revert-subscription-on-proration-failure,omitempty"` StartImmediately bool `xml:"start-immediately,omitempty"` }
type SubscriptionRequest ¶
type SubscriptionRequest struct { XMLName string `xml:"subscription"` Id string `xml:"id,omitempty"` FailureCount string `xml:"failure-count,omitempty"` FirstBillingDate string `xml:"first-billing-date,omitempty"` MerchantAccountId string `xml:"merchant-account-id,omitempty"` PaymentMethodNonce string `xml:"paymentMethodNonce,omitempty"` PaymentMethodToken string `xml:"paymentMethodToken,omitempty"` PlanId string `xml:"planId,omitempty"` TrialDuration string `xml:"trial-duration,omitempty"` TrialDurationUnit string `xml:"trial-duration-unit,omitempty"` NeverExpires *bool `xml:"never-expires,omitempty"` BillingDayOfMonth *int `xml:"billing-day-of-month,omitempty"` NumberOfBillingCycles *int `xml:"number-of-billing-cycles,omitempty"` Options *SubscriptionOpts `xml:"options,omitempty"` Price *Decimal `xml:"price,omitempty"` TrialPeriod *bool `xml:"trial-period,omitempty"` Descriptor *Descriptor `xml:"descriptor,omitempty"` AddOns *ModificationsRequest `xml:"add-ons,omitempty"` Discounts *ModificationsRequest `xml:"discounts,omitempty"` }
type SubscriptionSearchResult ¶
type SubscriptionSearchResult struct { TotalItems int CurrentPageNumber int PageSize int TotalIDs []string Subscriptions []*Subscription }
type SubscriptionStatus ¶
type SubscriptionStatus string
const ( SubscriptionStatusActive SubscriptionStatus = "Active" SubscriptionStatusCanceled SubscriptionStatus = "Canceled" SubscriptionStatusExpired SubscriptionStatus = "Expired" SubscriptionStatusPastDue SubscriptionStatus = "Past Due" SubscriptionStatusPending SubscriptionStatus = "Pending" SubscriptionStatusUnrecognized SubscriptionStatus = "Unrecognized" )
type SubscriptionStatusEvent ¶
type SubscriptionStatusEvent struct { Timestamp time.Time `xml:"timestamp"` Status SubscriptionStatus `xml:"status"` CurrencyISOCode string `xml:"currency-iso-code"` User string `xml:"user"` PlanID string `xml:"plan-id"` SubscriptionSource string `xml:"subscription-source"` Balance *Decimal `xml:"balance"` Price *Decimal `xml:"price"` }
type SubscriptionTransactionOptionsRequest ¶
type SubscriptionTransactionOptionsRequest struct {
SubmitForSettlement bool `xml:"submit-for-settlement"`
}
type SubscriptionTransactionRequest ¶
type SubscriptionTransactionRequest struct { SubscriptionID string Amount *Decimal Options *SubscriptionTransactionOptionsRequest }
func (*SubscriptionTransactionRequest) MarshalXML ¶
func (s *SubscriptionTransactionRequest) MarshalXML(e *xml.Encoder, start xml.StartElement) error
type Subscriptions ¶
type Subscriptions struct {
Subscription []*Subscription `xml:"subscription"`
}
type ThreeDSecureEnrolled ¶
type ThreeDSecureEnrolled string
const ( EnrolledYes ThreeDSecureEnrolled = "Y" EnrolledNo ThreeDSecureEnrolled = "N" EnrolledBypass ThreeDSecureEnrolled = "B" EnrolledRequestFailure ThreeDSecureEnrolled = "E" )
type ThreeDSecureInfo ¶
type ThreeDSecureInfo struct { Status ThreeDSecureStatus `xml:"status"` Enrolled ThreeDSecureEnrolled `xml:"enrolled"` LiabilityShiftPossible bool `xml:"liability-shift-possible"` LiabilityShifted bool `xml:"liability-shifted"` }
type ThreeDSecureStatus ¶
type ThreeDSecureStatus string
const ( ThreeDSecureUnsupportedCard ThreeDSecureStatus = "unsupported_card" ThreeDSecureLookupError ThreeDSecureStatus = "lookup_error" ThreeDSecureLookupEnrolled ThreeDSecureStatus = "lookup_enrolled" ThreeDSecureLookupNotEnrolled ThreeDSecureStatus = "lookup_not_enrolled" ThreeDSecureAuthenticateSuccessfulIssuerNotParticipating ThreeDSecureStatus = "authenticate_successful_issuer_not_participating" ThreeDSecureAuthenticateSignatureVerificationFailed ThreeDSecureStatus = "authenticate_signature_verification_failed" ThreeDSecureAuthenticateSuccessful ThreeDSecureStatus = "authenticate_successful" ThreeDSecureAuthenticateAttemptSuccessful ThreeDSecureStatus = "authenticate_attempt_successful" ThreeDSecureAuthenticateFailed ThreeDSecureStatus = "authenticate_failed" ThreeDSecureAuthenticateUnableToAuthenticate ThreeDSecureStatus = "authenticate_unable_to_authenticate" ThreeDSecureAuthenticateError ThreeDSecureStatus = "authenticate_error" )
type TimeField ¶
func (TimeField) MarshalXML ¶
type TokenRequest ¶
type TransactionSearchResult ¶
type Transactions ¶
type Transactions struct {
Transaction []*Tx `xml:"transaction"`
}
type Tx ¶
type Tx struct { ProcessorResponseCode ResponseCode `xml:"processor-response-code"` ProcessorResponseType ResponseType `xml:"processor-response-type"` EscrowStatus EscrowStatus `xml:"escrow-status"` PaymentInstrumentType PaymentType `xml:"payment-instrument-type"` AVSErrorResponseCode AVSResponseCode `xml:"avs-error-response-code"` AVSPostalCodeResponseCode AVSResponseCode `xml:"avs-postal-code-response-code"` AVSStreetAddressResponseCode AVSResponseCode `xml:"avs-street-address-response-code"` CVVResponseCode CVVResponseCode `xml:"cvv-response-code"` GatewayRejectionReason RejectionReason `xml:"gateway-rejection-reason"` CustomFields CustomFields `xml:"custom-fields"` ProcessorAuthorizationCode string `xml:"processor-authorization-code"` SettlementBatchId string `xml:"settlement-batch-id"` XMLName string `xml:"transaction"` Id string `xml:"id"` Status Status `xml:"status"` Type string `xml:"type"` CurrencyISOCode string `xml:"currency-iso-code"` OrderId string `xml:"order-id"` PaymentMethodToken string `xml:"payment-method-token"` PaymentMethodNonce string `xml:"payment-method-nonce"` MerchantAccountId string `xml:"merchant-account-id"` PlanId string `xml:"plan-id"` SubscriptionId string `xml:"subscription-id"` DeviceData string `xml:"device-data"` RefundId string `xml:"refund-id"` ProcessorResponseText string `xml:"processor-response-text"` AdditionalProcessorResponse string `xml:"additional-processor-response"` Channel string `xml:"channel"` PurchaseOrderNumber string `xml:"purchase-order-number"` TaxExempt bool `xml:"tax-exempt"` CreatedAt *time.Time `xml:"created-at"` UpdatedAt *time.Time `xml:"updated-at"` AuthorizationExpiresAt *time.Time `xml:"authorization-expires-at"` ThreeDSecureInfo *ThreeDSecureInfo `xml:"three-d-secure-info,omitempty"` Amount *Decimal `xml:"amount"` SubscriptionDetails *SubscriptionDetail `xml:"subscription"` CreditCard *CreditCard `xml:"credit-card"` Customer *Customer `xml:"customer"` BillingAddress *Address `xml:"billing"` ShippingAddress *Address `xml:"shipping"` TaxAmount *Decimal `xml:"tax-amount"` ServiceFeeAmount *Decimal `xml:"service-fee-amount,attr"` DisbursementDetails *DisbursementDetail `xml:"disbursement-details"` PayPalDetails *PayPalDetail `xml:"paypal"` VenmoAccountDetails *VenmoAccountDetail `xml:"venmo-account"` AndroidPayDetails *AndroidPayDetail `xml:"android-pay-card"` ApplePayDetails *ApplePayDetail `xml:"apple-pay"` RiskData *RiskData `xml:"risk-data"` Descriptor *Descriptor `xml:"descriptor"` RefundedTransactionId *string `xml:"refunded-transaction-id"` RefundIds *[]string `xml:"refund-ids>item"` Disputes []*Dispute `xml:"disputes>dispute"` }
func (*Tx) UnmarshalXML ¶
type TxCloneOpts ¶
type TxCloneOpts struct {
SubmitForSettlement bool `xml:"submit-for-settlement"`
}
type TxCloneRequest ¶
type TxCloneRequest struct { XMLName string `xml:"transaction-clone"` Amount *Decimal `xml:"amount"` Channel string `xml:"channel"` Options *TxCloneOpts `xml:"options"` }
type TxOpts ¶
type TxOpts struct { SubmitForSettlement bool `xml:"submit-for-settlement,omitempty"` StoreInVault bool `xml:"store-in-vault,omitempty"` StoreInVaultOnSuccess bool `xml:"store-in-vault-on-success,omitempty"` AddBillingAddressToPaymentMethod bool `xml:"add-billing-address-to-payment-method,omitempty"` StoreShippingAddressInVault bool `xml:"store-shipping-address-in-vault,omitempty"` HoldInEscrow bool `xml:"hold-in-escrow,omitempty"` SkipAdvancedFraudChecking bool `xml:"skip_advanced_fraud_checking,omitempty"` TransactionOptionsPaypalRequest *TxPaypalOptsRequest `xml:"paypal,omitempty"` ThreeDSecure *TxThreeDSecureOptsRequest `xml:"three-d-secure,omitempty"` }
type TxPaypalOptsRequest ¶
type TxPaypalOptsRequest struct { CustomField string PayeeEmail string Description string SupplementaryData map[string]string }
func (TxPaypalOptsRequest) MarshalXML ¶
func (r TxPaypalOptsRequest) MarshalXML(e *xml.Encoder, start xml.StartElement) error
type TxRequest ¶
type TxRequest struct { XMLName string `xml:"transaction"` CustomerID string `xml:"customer-id,omitempty"` Type string `xml:"type,omitempty"` OrderId string `xml:"order-id,omitempty"` PaymentMethodToken string `xml:"payment-method-token,omitempty"` PaymentMethodNonce string `xml:"payment-method-nonce,omitempty"` MerchantAccountId string `xml:"merchant-account-id,omitempty"` PlanId string `xml:"plan-id,omitempty"` DeviceData string `xml:"device-data,omitempty"` Channel string `xml:"channel,omitempty"` PurchaseOrderNumber string `xml:"purchase-order-number,omitempty"` TaxExempt bool `xml:"tax-exempt,omitempty"` CustomFields CustomFields `xml:"custom-fields,omitempty"` TransactionSource TxSource `xml:"transaction-source,omitempty"` LineItems LineItemRequests `xml:"line-items,omitempty"` Amount *Decimal `xml:"amount"` CreditCard *CreditCard `xml:"credit-card,omitempty"` Customer *CustomerRequest `xml:"customer,omitempty"` BillingAddress *Address `xml:"billing,omitempty"` ShippingAddress *Address `xml:"shipping,omitempty"` TaxAmount *Decimal `xml:"tax-amount,omitempty"` Options *TxOpts `xml:"options,omitempty"` ServiceFeeAmount *Decimal `xml:"service-fee-amount,attr,omitempty"` RiskData *RiskDataRequest `xml:"risk-data,omitempty"` Descriptor *Descriptor `xml:"descriptor,omitempty"` }
type TxThreeDSecureOptsRequest ¶
type TxThreeDSecureOptsRequest struct {
Required bool `xml:"required"`
}
type UpdateModificationRequest ¶
type UpdateModificationRequest struct { ModificationRequest ExistingID string `xml:"existing-id,omitempty"` }
type ValidationError ¶
func (*ValidationError) UnmarshalXML ¶
func (e *ValidationError) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
type ValidationErrors ¶
type ValidationErrors struct { Object string ValidationErrors []ValidationError Children map[string]*ValidationErrors }
func (*ValidationErrors) All ¶
func (r *ValidationErrors) All() []ValidationError
func (*ValidationErrors) AllDeep ¶
func (r *ValidationErrors) AllDeep() []ValidationError
func (*ValidationErrors) For ¶
func (r *ValidationErrors) For(name string) *ValidationErrors
func (*ValidationErrors) ForIndex ¶
func (r *ValidationErrors) ForIndex(i int) *ValidationErrors
func (*ValidationErrors) On ¶
func (r *ValidationErrors) On(name string) []ValidationError
func (*ValidationErrors) UnmarshalXML ¶
func (r *ValidationErrors) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
type VenmoAccount ¶
type VenmoAccount struct { XMLName xml.Name `xml:"venmo-account"` CustomerId string `xml:"customer-id"` Token string `xml:"token"` Username string `xml:"username"` VenmoUserID string `xml:"venmo-user-id"` SourceDescription string `xml:"source-description"` ImageURL string `xml:"image-url"` CreatedAt *time.Time `xml:"created-at"` UpdatedAt *time.Time `xml:"updated-at"` Subscriptions *Subscriptions `xml:"subscriptions"` Default bool `xml:"default"` }
func (*VenmoAccount) AllSubscriptions ¶
func (v *VenmoAccount) AllSubscriptions() []*Subscription
func (*VenmoAccount) ToPaymentMethod ¶
func (v *VenmoAccount) ToPaymentMethod() *PaymentMethod
type VenmoAccountDetail ¶
type VenmoAccounts ¶
type VenmoAccounts struct {
Accounts []*VenmoAccount `xml:"venmo-account"`
}
func (*VenmoAccounts) PaymentMethods ¶
func (v *VenmoAccounts) PaymentMethods() []PaymentMethod
type XMLRecords ¶
Click to show internal directories.
Click to hide internal directories.