Documentation
¶
Overview ¶
Package braintree is a client library for Braintree.
Initializing ¶
Initialize it with API Keys:
braintree.New(Sandbox, merchantId, publicKey, privateKey)
Initialize it with an Access Token:
braintree.NewWithAccessToken(accessToken)
Loggers and HTTP Clients ¶
Optionally configure a logger and HTTP client:
bt := braintree.New(...) bt.Logger = log.New(...) bt.HttpClient = ...
Creating Transactions ¶
Create transactions:
ctx := context.Background()
t, err := bt.Transaction().Create(ctx, &braintree.TransactionRequest{
Type: "sale",
Amount: braintree.NewDecimal(100, 2), // $1.00
PaymentMethodNonce: braintree.FakeNonceTransactable,
})
API Errors ¶
API errors are intended to be consumed in two ways. One, they can be dealt with as a single unit:
t, err := bt.Transaction().Create(...) err.Error() => "A top level error message"
Second, you can drill down to see specific error messages on a field-by-field basis:
err.For("Transaction").On("Base")[0].Message => "A more specific error message"
Index ¶
- Constants
- Variables
- type APIError
- type AVSResponseCode
- type AccountUpdaterDailyReport
- type AddModificationRequest
- type AddOn
- type AddOnGateway
- type AddOnList
- type Address
- type AddressGateway
- func (g *AddressGateway) Create(ctx context.Context, customerID string, a *AddressRequest) (*Address, error)
- func (g *AddressGateway) Delete(ctx context.Context, customerId, addrId string) error
- func (g *AddressGateway) Update(ctx context.Context, customerID, addrID string, a *AddressRequest) (*Address, error)
- type AddressRequest
- type Addresses
- type AndroidPayCard
- func (a *AndroidPayCard) AllSubscriptions() []*Subscription
- func (a *AndroidPayCard) GetCustomerId() string
- func (a *AndroidPayCard) GetImageURL() string
- func (a *AndroidPayCard) GetToken() string
- func (a *AndroidPayCard) IsDefault() bool
- func (a *AndroidPayCard) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
- type AndroidPayCards
- type AndroidPayDetails
- type ApplePayCard
- type ApplePayCards
- type ApplePayDetails
- type Braintree
- func (g *Braintree) AddOn() *AddOnGateway
- func (g *Braintree) Address() *AddressGateway
- func (g *Braintree) ClientToken() *ClientTokenGateway
- func (g *Braintree) CreditCard() *CreditCardGateway
- func (g *Braintree) Customer() *CustomerGateway
- func (g *Braintree) Discount() *DiscountGateway
- func (g *Braintree) Dispute() *DisputeGateway
- func (g *Braintree) Environment() Environment
- func (g *Braintree) MerchantAccount() *MerchantAccountGateway
- func (g *Braintree) MerchantID() string
- func (g *Braintree) MerchantURL() string
- func (g *Braintree) PayPalAccount() *PayPalAccountGateway
- func (g *Braintree) PaymentMethod() *PaymentMethodGateway
- func (g *Braintree) PaymentMethodNonce() *PaymentMethodNonceGateway
- func (g *Braintree) Plan() *PlanGateway
- func (g *Braintree) Settlement() *SettlementGateway
- func (g *Braintree) Subscription() *SubscriptionGateway
- func (g *Braintree) Testing() *TestingGateway
- func (g *Braintree) Transaction() *TransactionGateway
- func (g *Braintree) TransactionLineItem() *TransactionLineItemGateway
- func (g *Braintree) WebhookNotification() *WebhookNotificationGateway
- func (g *Braintree) WebhookTesting() *WebhookTestingGateway
- type BraintreeError
- type CVVResponseCode
- type ClientTokenGateway
- type ClientTokenRequest
- type ClientTokenRequestOptions
- type CreditCard
- type CreditCardGateway
- func (g *CreditCardGateway) Create(ctx context.Context, card *CreditCard) (*CreditCard, error)
- func (g *CreditCardGateway) Delete(ctx context.Context, card *CreditCard) error
- func (g *CreditCardGateway) ExpiringBetweenIDs(ctx context.Context, fromDate, toDate time.Time) (*SearchResult, error)
- func (g *CreditCardGateway) ExpiringBetweenPage(ctx context.Context, fromDate, toDate time.Time, searchResult *SearchResult, ...) (*CreditCardSearchResult, error)
- func (g *CreditCardGateway) Find(ctx context.Context, token string) (*CreditCard, error)
- func (g *CreditCardGateway) Update(ctx context.Context, card *CreditCard) (*CreditCard, error)
- type CreditCardOptions
- type CreditCardSearchResult
- type CreditCards
- type Customer
- type CustomerGateway
- func (g *CustomerGateway) Create(ctx context.Context, c *CustomerRequest) (*Customer, error)
- func (g *CustomerGateway) Delete(ctx context.Context, id string) error
- func (g *CustomerGateway) Find(ctx context.Context, id string) (*Customer, error)
- func (g *CustomerGateway) Search(ctx context.Context, query *SearchQuery) (*CustomerSearchResult, error)deprecated
- func (g *CustomerGateway) SearchIDs(ctx context.Context, query *SearchQuery) (*SearchResult, error)
- func (g *CustomerGateway) SearchPage(ctx context.Context, query *SearchQuery, searchResult *SearchResult, page int) (*CustomerSearchResult, error)
- func (g *CustomerGateway) Update(ctx context.Context, c *CustomerRequest) (*Customer, error)
- type CustomerRequest
- type CustomerSearchResult
- type Decimal
- type Descriptor
- type Disbursement
- type DisbursementDetails
- type Discount
- type DiscountGateway
- type DiscountList
- type Dispute
- type DisputeEvidence
- type DisputeEvidenceCategory
- type DisputeGateway
- func (g *DisputeGateway) Accept(ctx context.Context, disputeID string) error
- func (g *DisputeGateway) AddTextEvidence(ctx context.Context, disputeID string, ...) (*DisputeEvidence, error)
- func (g *DisputeGateway) Finalize(ctx context.Context, disputeID string) error
- func (g *DisputeGateway) Find(ctx context.Context, disputeID string) (*Dispute, error)
- func (g *DisputeGateway) RemoveEvidence(ctx context.Context, disputeID string, evidenceId string) error
- type DisputeKind
- type DisputeReason
- type DisputeStatus
- type DisputeStatusHistoryEvent
- type DisputeTextEvidenceRequest
- type DisputeTransaction
- type Environment
- type EscrowStatus
- type GatewayRejectionReason
- type InvalidResponseError
- type MerchantAccount
- type MerchantAccountBusiness
- type MerchantAccountFundingOptions
- type MerchantAccountGateway
- func (g *MerchantAccountGateway) Create(ctx context.Context, ma *MerchantAccount) (*MerchantAccount, error)
- func (g *MerchantAccountGateway) Find(ctx context.Context, id string) (*MerchantAccount, error)
- func (g *MerchantAccountGateway) Update(ctx context.Context, ma *MerchantAccount) (*MerchantAccount, error)
- type MerchantAccountPerson
- type Modification
- type ModificationRequest
- type ModificationsRequest
- type MultiField
- type PayPalAccount
- type PayPalAccountGateway
- func (g *PayPalAccountGateway) Delete(ctx context.Context, paypalAccount *PayPalAccount) error
- func (g *PayPalAccountGateway) Find(ctx context.Context, token string) (*PayPalAccount, error)
- func (g *PayPalAccountGateway) Update(ctx context.Context, paypalAccount *PayPalAccount) (*PayPalAccount, error)
- type PayPalAccountOptions
- type PayPalAccounts
- type PayPalDetails
- type PaymentInstrumentType
- type PaymentMethod
- type PaymentMethodGateway
- func (g *PaymentMethodGateway) Create(ctx context.Context, paymentMethodRequest *PaymentMethodRequest) (PaymentMethod, error)
- func (g *PaymentMethodGateway) Delete(ctx context.Context, token string) error
- func (g *PaymentMethodGateway) Find(ctx context.Context, token string) (PaymentMethod, error)
- func (g *PaymentMethodGateway) Update(ctx context.Context, token string, paymentMethod *PaymentMethodRequest) (PaymentMethod, error)
- type PaymentMethodNonce
- type PaymentMethodNonceDetails
- type PaymentMethodNonceGateway
- type PaymentMethodRequest
- type PaymentMethodRequestOptions
- type Plan
- type PlanGateway
- type Plans
- type ProcessorResponseCode
- type ProcessorResponseType
- type RangeField
- type Record
- type Response
- type RiskData
- type RiskDataRequest
- type SearchQuery
- func (s *SearchQuery) AddMultiField(field string) *MultiField
- func (s *SearchQuery) AddRangeField(field string) *RangeField
- func (s *SearchQuery) AddTextField(field string) *TextField
- func (s *SearchQuery) AddTimeField(field string) *TimeField
- func (s *SearchQuery) MarshalXML(e *xml.Encoder, start xml.StartElement) error
- type SearchResult
- type Settlement
- type SettlementBatchSummary
- type SettlementGateway
- type SignatureError
- type Subscription
- type SubscriptionDetails
- type SubscriptionGateway
- func (g *SubscriptionGateway) Cancel(ctx context.Context, subId string) (*Subscription, error)
- func (g *SubscriptionGateway) Create(ctx context.Context, sub *SubscriptionRequest) (*Subscription, error)
- func (g *SubscriptionGateway) Find(ctx context.Context, subId string) (*Subscription, error)
- func (g *SubscriptionGateway) RetryCharge(ctx context.Context, txReq *SubscriptionTransactionRequest) error
- func (g *SubscriptionGateway) Search(ctx context.Context, query *SearchQuery) (*SubscriptionSearchResult, error)deprecated
- func (g *SubscriptionGateway) SearchIDs(ctx context.Context, query *SearchQuery) (*SearchResult, error)
- func (g *SubscriptionGateway) SearchNext(ctx context.Context, query *SearchQuery, prevResult *SubscriptionSearchResult) (*SubscriptionSearchResult, error)deprecated
- func (g *SubscriptionGateway) SearchPage(ctx context.Context, query *SearchQuery, searchResult *SearchResult, page int) (*SubscriptionSearchResult, error)
- func (g *SubscriptionGateway) Update(ctx context.Context, subId string, sub *SubscriptionRequest) (*Subscription, error)
- type SubscriptionOptions
- type SubscriptionRequest
- type SubscriptionSearchResult
- type SubscriptionStatus
- type SubscriptionStatusEvent
- type SubscriptionTransactionOptionsRequest
- type SubscriptionTransactionRequest
- type Subscriptions
- type TestingGateway
- func (g *TestingGateway) Settle(ctx context.Context, transactionID string) (*Transaction, error)
- func (g *TestingGateway) SettlementConfirm(ctx context.Context, transactionID string) (*Transaction, error)
- func (g *TestingGateway) SettlementDecline(ctx context.Context, transactionID string) (*Transaction, error)
- func (g *TestingGateway) SettlementPending(ctx context.Context, transactionID string) (*Transaction, error)
- type TextField
- type ThreeDSecureEnrolled
- type ThreeDSecureInfo
- type ThreeDSecureStatus
- type TimeField
- type Transaction
- type TransactionCloneOptions
- type TransactionCloneRequest
- type TransactionGateway
- func (g *TransactionGateway) CancelRelease(ctx context.Context, id string) (*Transaction, error)
- func (g *TransactionGateway) Clone(ctx context.Context, id string, tx *TransactionCloneRequest) (*Transaction, error)
- func (g *TransactionGateway) Create(ctx context.Context, tx *TransactionRequest) (*Transaction, error)
- func (g *TransactionGateway) Find(ctx context.Context, id string) (*Transaction, error)
- func (g *TransactionGateway) HoldInEscrow(ctx context.Context, id string) (*Transaction, error)
- func (g *TransactionGateway) Refund(ctx context.Context, id string, amount ...*Decimal) (*Transaction, error)
- func (g *TransactionGateway) RefundWithRequest(ctx context.Context, id string, refundRequest *TransactionRefundRequest) (*Transaction, error)
- func (g *TransactionGateway) ReleaseFromEscrow(ctx context.Context, id string) (*Transaction, error)
- func (g *TransactionGateway) Search(ctx context.Context, query *SearchQuery) (*TransactionSearchResult, error)deprecated
- func (g *TransactionGateway) SearchIDs(ctx context.Context, query *SearchQuery) (*SearchResult, error)
- func (g *TransactionGateway) SearchNext(ctx context.Context, query *SearchQuery, prevResult *TransactionSearchResult) (*TransactionSearchResult, error)deprecated
- func (g *TransactionGateway) SearchPage(ctx context.Context, query *SearchQuery, searchResult *SearchResult, page int) (*TransactionSearchResult, error)
- func (g *TransactionGateway) Settle(ctx context.Context, id string) (*Transaction, error)
- func (g *TransactionGateway) SubmitForSettlement(ctx context.Context, id string, amount ...*Decimal) (*Transaction, error)
- func (g *TransactionGateway) Void(ctx context.Context, id string) (*Transaction, error)
- type TransactionLineItem
- type TransactionLineItemGateway
- type TransactionLineItemKind
- type TransactionLineItemRequest
- type TransactionLineItemRequests
- type TransactionLineItems
- type TransactionOptions
- type TransactionOptionsPaypalRequest
- type TransactionOptionsThreeDSecureRequest
- type TransactionRefundRequest
- type TransactionRequest
- type TransactionSearchResult
- type TransactionSource
- type TransactionStatus
- type Transactions
- 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 VenmoAccountDetails
- type VenmoAccounts
- type WebhookNotification
- type WebhookNotificationGateway
- type WebhookTestingGateway
- type XMLRecords
Constants ¶
const ( // Exception messages BankRejected = "bank_rejected" InsufficientFunds = "insuffient_funds" AccountNotAuthorized = "account_not_authorized" // Followup actions ContactUs = "contact_us" UpdateFundingInformation = "update_funding_information" None = "none" )
const ( FakeNonceTransactable = "fake-valid-nonce" FakeNonceConsumed = "fake-consumed-nonce" FakeNoncePayPalOneTimePayment = "fake-paypal-one-time-nonce" FakeNoncePayPalFuturePayment = "fake-paypal-future-nonce" FakeNonceApplePayVisa = "fake-apple-pay-visa-nonce" FakeNonceApplePayMastercard = "fake-apple-pay-mastercard-nonce" FakeNonceApplePayAmex = "fake-apple-pay-amex-nonce" FakeNonceAbstractTransactable = "fake-abstract-transactable-nonce" FakeNoncePayPalBillingAgreement = "fake-paypal-billing-agreement-nonce" FakeNonceEurope = "fake-europe-bank-account-nonce" FakeNonceCoinbase = "fake-coinbase-nonce" FakeNonceAndroidPay = "fake-android-pay-nonce" FakeNonceAndroidPayDiscover = "fake-android-pay-discover-nonce" FakeNonceAndroidPayVisa = "fake-android-pay-visa-nonce" FakeNonceAndroidPayMasterCard = "fake-android-pay-mastercard-nonce" FakeNonceAndroidPayAmEx = "fake-android-pay-amex-nonce" FakeNonceAmexExpressCheckout = "fake-amex-express-checkout-nonce" FakeNonceVenmoAccount = "fake-venmo-account-nonce" FakeNonceTransactableVisa = "fake-valid-visa-nonce" FakeNonceTransactableAmEx = "fake-valid-amex-nonce" FakeNonceTransactableMasterCard = "fake-valid-mastercard-nonce" FakeNonceTransactableDiscover = "fake-valid-discover-nonce" FakeNonceTransactableJCB = "fake-valid-jcb-nonce" FakeNonceTransactableMaestro = "fake-valid-maestro-nonce" FakeNonceTransactableDinersClub = "fake-valid-dinersclub-nonce" FakeNonceTransactablePrepaid = "fake-valid-prepaid-nonce" FakeNonceTransactableCommercial = "fake-valid-commercial-nonce" FakeNonceTransactableDurbinRegulated = "fake-valid-durbin-regulated-nonce" FakeNonceTransactableHealthcare = "fake-valid-healthcare-nonce" FakeNonceTransactableDebit = "fake-valid-debit-nonce" FakeNonceTransactablePayroll = "fake-valid-payroll-nonce" FakeNonceTransactableNoIndicators = "fake-valid-no-indicators-nonce" FakeNonceTransactableUnknownIndicators = "fake-valid-unknown-indicators-nonce" FakeNonceTransactableCountryOfIssuanceUSA = "fake-valid-country-of-issuance-usa-nonce" FakeNonceTransactableCountryOfIssuanceCAD = "fake-valid-country-of-issuance-cad-nonce" FakeNonceTransactableIssuingBankNetworkOnly = "fake-valid-issuing-bank-network-only-nonce" FakeNonceProcessorDeclinedVisa = "fake-processor-declined-visa-nonce" FakeNonceProcessorDeclinedMasterCard = "fake-processor-declined-mastercard-nonce" FakeNonceProcessorDeclinedAmEx = "fake-processor-declined-amex-nonce" FakeNonceProcessorDeclinedDiscover = "fake-processor-declined-discover-nonce" FakeNonceProcessorFailureJCB = "fake-processor-failure-jcb-nonce" FakeNonceLuhnInvalid = "fake-luhn-invalid-nonce" FakeNoncePayPalFuturePaymentRefreshToken = "fake-paypal-future-refresh-token-nonce" FakeNonceSEPA = "fake-sepa-bank-account-nonce" FakeNonceMasterpassAmEx = "fake-masterpass-amex-nonce" FakeNonceMasterpassDiscover = "fake-masterpass-discover-nonce" FakeNonceMasterpassMaestro = "fake-masterpass-maestro-nonce" FakeNonceMasterpassMasterCard = "fake-masterpass-mastercard-nonce" FakeNonceMasterpassVisa = "fake-masterpass-visa-nonce" FakeNonceGatewayRejectedFraud = "fake-gateway-rejected-fraud-nonce" FakeNonceVisaCheckoutVisa = "fake-visa-checkout-visa-nonce" FakeNonceVisaCheckoutAmEx = "fake-visa-checkout-amex-nonce" FakeNonceVisaCheckoutMasterCard = "fake-visa-checkout-mastercard-nonce" FakeNonceVisaCheckoutDiscover = "fake-visa-checkout-discover-nonce" )
const ( FUNDING_DEST_BANK = "bank" FUNDING_DEST_MOBILE_PHONE = "mobile_phone" FUNDING_DEST_EMAIL = "email" )
const ( ModificationKindDiscount = "discount" ModificationKindAddOn = "add_on" )
const ( SubscriptionTrialDurationUnitDay = "day" SubscriptionTrialDurationUnitMonth = "month" )
const ( CheckWebhook = "check" DisbursementWebhook = "disbursement" DisbursementExceptionWebhook = "disbursement_exception" SubscriptionCanceledWebhook = "subscription_canceled" SubscriptionChargedSuccessfullyWebhook = "subscription_charged_successfully" SubscriptionChargedUnsuccessfullyWebhook = "subscription_charged_unsuccessfully" SubscriptionExpiredWebhook = "subscription_expired" SubscriptionTrialEndedWebhook = "subscription_trial_ended" SubscriptionWentActiveWebhook = "subscription_went_active" SubscriptionWentPastDueWebhook = "subscription_went_past_due" SubMerchantAccountApprovedWebhook = "sub_merchant_account_approved" SubMerchantAccountDeclinedWebhook = "sub_merchant_account_declined" PartnerMerchantConnectedWebhook = "partner_merchant_connected" PartnerMerchantDisconnectedWebhook = "partner_merchant_disconnected" PartnerMerchantDeclinedWebhook = "partner_merchant_declined" TransactionSettledWebhook = "transaction_settled" TransactionSettlementDeclinedWebhook = "transaction_settlement_declined" TransactionDisbursedWebhook = "transaction_disbursed" DisputeOpenedWebhook = "dispute_opened" DisputeLostWebhook = "dispute_lost" DisputeWonWebhook = "dispute_won" AccountUpdaterDailyReportWebhook = "account_updater_daily_report" )
const LibraryVersion = "0.22.0"
Variables ¶
var ( Development = NewEnvironment("http://localhost:3000") Sandbox = NewEnvironment("https://api.sandbox.braintreegateway.com:443") Production = NewEnvironment("https://api.braintreegateway.com:443") )
Functions ¶
This section is empty.
Types ¶
type AVSResponseCode ¶
type AVSResponseCode string
const ( // The postal code or street address provided matches the information on file with the cardholder's bank. AVSResponseCodeMatches AVSResponseCode = "M" // The postal code or street address provided does not match the information on file with the cardholder's bank. AVSResponseCodeDoesNotMatch AVSResponseCode = "N" // 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. AVSResponseCodeNotVerified AVSResponseCode = "U" // No postal code or street address was provided. AVSResponseCodeNotProvided AVSResponseCode = "I" // 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. AVSResponseCodeNotSupported AVSResponseCode = "S" // A system error prevented any verification of street address or postal code. AVSResponseCodeSystemError AVSResponseCode = "E" // AVS information was provided but this type of transaction does not support address verification. AVSResponseCodeNotApplicable AVSResponseCode = "A" )
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 AddOnGateway ¶
type AddOnGateway struct {
*Braintree
}
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 AddressGateway ¶
type AddressGateway struct {
*Braintree
}
func (*AddressGateway) Create ¶
func (g *AddressGateway) Create(ctx context.Context, customerID string, a *AddressRequest) (*Address, error)
Create creates a new address for the specified customer id.
func (*AddressGateway) Delete ¶
func (g *AddressGateway) Delete(ctx context.Context, customerId, addrId string) error
Delete deletes the address for the specified id and customer id.
func (*AddressGateway) Update ¶
func (g *AddressGateway) Update(ctx context.Context, customerID, addrID string, a *AddressRequest) (*Address, error)
Update updates an address for the address id and customer id.
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
AllSubscriptions returns all subscriptions for this paypal account, or nil if none present.
func (*AndroidPayCard) GetCustomerId ¶
func (a *AndroidPayCard) GetCustomerId() string
func (*AndroidPayCard) GetImageURL ¶
func (a *AndroidPayCard) GetImageURL() string
func (*AndroidPayCard) GetToken ¶
func (a *AndroidPayCard) GetToken() string
func (*AndroidPayCard) IsDefault ¶
func (a *AndroidPayCard) IsDefault() bool
func (*AndroidPayCard) UnmarshalXML ¶
func (a *AndroidPayCard) UnmarshalXML(d *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 AndroidPayDetails ¶
type AndroidPayDetails 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 (*AndroidPayDetails) UnmarshalXML ¶
func (a *AndroidPayDetails) 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
AllSubscriptions returns all subscriptions for this paypal account, or nil if none present.
func (*ApplePayCard) GetCustomerId ¶
func (a *ApplePayCard) GetCustomerId() string
func (*ApplePayCard) GetImageURL ¶
func (a *ApplePayCard) GetImageURL() string
func (*ApplePayCard) GetToken ¶
func (a *ApplePayCard) GetToken() string
func (*ApplePayCard) IsDefault ¶
func (a *ApplePayCard) IsDefault() bool
type ApplePayCards ¶
type ApplePayCards struct {
ApplePayCard []*ApplePayCard `xml:"apple-pay-card"`
}
func (*ApplePayCards) PaymentMethods ¶
func (a *ApplePayCards) PaymentMethods() []PaymentMethod
type ApplePayDetails ¶
type ApplePayDetails 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 Braintree ¶
type Braintree struct {
Logger *log.Logger
HttpClient *http.Client
// contains filtered or unexported fields
}
Braintree interacts with the Braintree API.
func New ¶
func New(env Environment, merchId, pubKey, privKey string) *Braintree
New creates a Braintree client with API Keys.
func NewWithAccessToken ¶
NewWithAccessToken creates a Braintree client with an Access Token. Note: When using an access token, webhooks are unsupported and the WebhookNotification() function will panic.
func NewWithHttpClient ¶
func NewWithHttpClient(env Environment, merchantId, publicKey, privateKey string, client *http.Client) *Braintree
NewWithHttpClient creates a Braintree client with API Keys and a HTTP Client.
func (*Braintree) AddOn ¶
func (g *Braintree) AddOn() *AddOnGateway
func (*Braintree) Address ¶
func (g *Braintree) Address() *AddressGateway
func (*Braintree) ClientToken ¶
func (g *Braintree) ClientToken() *ClientTokenGateway
func (*Braintree) CreditCard ¶
func (g *Braintree) CreditCard() *CreditCardGateway
func (*Braintree) Customer ¶
func (g *Braintree) Customer() *CustomerGateway
func (*Braintree) Discount ¶
func (g *Braintree) Discount() *DiscountGateway
func (*Braintree) Dispute ¶
func (g *Braintree) Dispute() *DisputeGateway
func (*Braintree) Environment ¶
func (g *Braintree) Environment() Environment
Environment returns the current environment.
func (*Braintree) MerchantAccount ¶
func (g *Braintree) MerchantAccount() *MerchantAccountGateway
func (*Braintree) MerchantID ¶
MerchantID returns the current merchant id.
func (*Braintree) MerchantURL ¶
MerchantURL returns the configured merchant's base URL for outgoing requests.
func (*Braintree) PayPalAccount ¶
func (g *Braintree) PayPalAccount() *PayPalAccountGateway
func (*Braintree) PaymentMethod ¶
func (g *Braintree) PaymentMethod() *PaymentMethodGateway
func (*Braintree) PaymentMethodNonce ¶
func (g *Braintree) PaymentMethodNonce() *PaymentMethodNonceGateway
func (*Braintree) Plan ¶
func (g *Braintree) Plan() *PlanGateway
func (*Braintree) Settlement ¶
func (g *Braintree) Settlement() *SettlementGateway
func (*Braintree) Subscription ¶
func (g *Braintree) Subscription() *SubscriptionGateway
func (*Braintree) Testing ¶
func (g *Braintree) Testing() *TestingGateway
func (*Braintree) Transaction ¶
func (g *Braintree) Transaction() *TransactionGateway
func (*Braintree) TransactionLineItem ¶
func (g *Braintree) TransactionLineItem() *TransactionLineItemGateway
func (*Braintree) WebhookNotification ¶
func (g *Braintree) WebhookNotification() *WebhookNotificationGateway
func (*Braintree) WebhookTesting ¶
func (g *Braintree) WebhookTesting() *WebhookTestingGateway
type BraintreeError ¶
type BraintreeError struct {
ErrorMessage string
MerchantAccount *MerchantAccount
Transaction *Transaction
// contains filtered or unexported fields
}
func (*BraintreeError) All ¶
func (e *BraintreeError) All() []ValidationError
func (*BraintreeError) Error ¶
func (e *BraintreeError) Error() string
func (*BraintreeError) For ¶
func (e *BraintreeError) For(name string) *ValidationErrors
func (*BraintreeError) StatusCode ¶
func (e *BraintreeError) StatusCode() int
func (*BraintreeError) UnmarshalXML ¶
func (e *BraintreeError) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
type CVVResponseCode ¶
type CVVResponseCode string
CVVResponseCode is the response to the card verification value (CVV) provided by the customer.
const ( // CVVResponseCodeMatches means the CVV provided matches the information on file with the cardholder's bank. CVVResponseCodeMatches CVVResponseCode = "M" // CVVResponseCodeDoesNotMatch means the The CVV provided does not match the information on file with the cardholder's bank. CVVResponseCodeDoesNotMatch CVVResponseCode = "N" // 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. CVVResponseCodeNotVerified CVVResponseCode = "U" // CVVResponseCodeNotProvided means the no CVV was provided. CVVResponseCodeNotProvided CVVResponseCode = "I" // CVVResponseCodeIssuerDoesNotParticipate means the the CVV was provided // but the card-issuing bank does not participate in card verification. CVVResponseCodeIssuerDoesNotParticipate CVVResponseCode = "S" // CVVResponseCodeNotApplicable means the the CVV was provided // but this type of transaction does not support card verification. CVVResponseCodeNotApplicable CVVResponseCode = "A" )
type ClientTokenGateway ¶
type ClientTokenGateway struct {
*Braintree
}
ClientTokenGateway represents the provider client token generation.
func (*ClientTokenGateway) Generate ¶
func (g *ClientTokenGateway) Generate(ctx context.Context) (string, error)
Generate generates a new client token.
func (*ClientTokenGateway) GenerateWithCustomer ¶
func (g *ClientTokenGateway) GenerateWithCustomer(ctx context.Context, customerID string) (string, error)
GenerateWithCustomer generates a new client token for the customer id.
func (*ClientTokenGateway) GenerateWithRequest ¶
func (g *ClientTokenGateway) GenerateWithRequest(ctx context.Context, req *ClientTokenRequest) (string, error)
GenerateWithRequest generates a new client token using custom request options.
type ClientTokenRequest ¶
type ClientTokenRequest struct {
XMLName string `xml:"client-token"`
CustomerID string `xml:"customer-id,omitempty"`
MerchantAccountID string `xml:"merchant-account-id,omitempty"`
Options *ClientTokenRequestOptions `xml:"options,omitempty"`
Version int `xml:"version"`
}
ClientTokenRequest represents the parameters for the client token request.
type ClientTokenRequestOptions ¶
type ClientTokenRequestOptions struct {
FailOnDuplicatePaymentMethod bool `xml:"fail-on-duplicate-payment-method,omitempty"`
MakeDefault bool `xml:"make-default,omitempty"`
VerifyCard *bool `xml:"verify-card,omitempty"`
}
ClientTokenRequestOptions represents options map for the client token request.
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"`
Options *CreditCardOptions `xml:"options,omitempty"`
CreatedAt *time.Time `xml:"created-at,omitempty"`
UpdatedAt *time.Time `xml:"updated-at,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"`
Default bool `xml:"default,omitempty"`
Expired bool `xml:"expired,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"`
BillingAddress *Address `xml:"billing-address,omitempty"`
Subscriptions *Subscriptions `xml:"subscriptions,omitempty"`
ProductID string `xml:"product-id,omitempty"`
}
func (*CreditCard) AllSubscriptions ¶
func (card *CreditCard) AllSubscriptions() []*Subscription
AllSubscriptions returns all subscriptions for this card, or nil if none present.
func (*CreditCard) GetCustomerId ¶
func (card *CreditCard) GetCustomerId() string
GetCustomerId gets the customer id of the credit card.
func (*CreditCard) GetImageURL ¶
func (card *CreditCard) GetImageURL() string
GetImageURL gets a URL that points to a payment method image file hosted by Braintree.
func (*CreditCard) GetToken ¶
func (card *CreditCard) GetToken() string
GetToken gets the payment method token of the credit card.
func (*CreditCard) IsDefault ¶
func (card *CreditCard) IsDefault() bool
IsDefault returns whether the credit card is the default for the customer.
type CreditCardGateway ¶
type CreditCardGateway struct {
*Braintree
}
func (*CreditCardGateway) Create ¶
func (g *CreditCardGateway) Create(ctx context.Context, card *CreditCard) (*CreditCard, error)
Create creates a new credit card.
func (*CreditCardGateway) Delete ¶
func (g *CreditCardGateway) Delete(ctx context.Context, card *CreditCard) error
Delete deletes a credit card.
func (*CreditCardGateway) ExpiringBetweenIDs ¶
func (g *CreditCardGateway) ExpiringBetweenIDs(ctx context.Context, fromDate, toDate time.Time) (*SearchResult, error)
ExpiringBetweenIDs finds credit cards that expire between the specified dates, returning the IDs only. Use ExpiringBetweenPage to get pages of credit cards.
func (*CreditCardGateway) ExpiringBetweenPage ¶
func (g *CreditCardGateway) ExpiringBetweenPage(ctx context.Context, fromDate, toDate time.Time, searchResult *SearchResult, page int) (*CreditCardSearchResult, error)
ExpiringBetweenPage gets the page of credit cards that expire between the specified dates. Use ExpiringBetweenIDs to start a search and get a list of IDs, and use its result object to get pages. Page numbers start at 1. Returns a nil result and nil error when no more results are available.
func (*CreditCardGateway) Find ¶
func (g *CreditCardGateway) Find(ctx context.Context, token string) (*CreditCard, error)
Find finds a credit card by payment method token.
func (*CreditCardGateway) Update ¶
func (g *CreditCardGateway) Update(ctx context.Context, card *CreditCard) (*CreditCard, error)
Update updates a credit card.
type CreditCardOptions ¶
type CreditCardOptions struct {
VerifyCard *bool `xml:"verify-card,omitempty"`
MakeDefault bool `xml:"make-default,omitempty"`
FailOnDuplicatePaymentMethod bool `xml:"fail-on-duplicate-payment-method,omitempty"`
VerificationMerchantAccountId string `xml:"verification-merchant-account-id,omitempty"`
UpdateExistingToken string `xml:"update-existing-token,omitempty"`
}
type CreditCardSearchResult ¶
type CreditCardSearchResult struct {
TotalItems int
TotalIDs []string
CurrentPageNumber int
PageSize int
CreditCards []*CreditCard
}
type CreditCards ¶
type CreditCards struct {
CreditCard []*CreditCard `xml:"credit-card"`
}
func (*CreditCards) PaymentMethods ¶
func (cards *CreditCards) PaymentMethods() []PaymentMethod
type Customer ¶
type Customer struct {
XMLName string `xml:"customer"`
Id string `xml:"id"`
GraphQLId string `xml:"global-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"`
CustomFields 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"`
PaymentMethodNonce string `xml:"payment-method-nonce"`
Addresses *Addresses `xml:"addresses"`
CreatedAt *time.Time `xml:"created-at"`
UpdatedAt *time.Time `xml:"updated-at"`
}
func (*Customer) DefaultCreditCard ¶
func (c *Customer) DefaultCreditCard() *CreditCard
DefaultCreditCard returns the default credit card, or nil
func (*Customer) DefaultPaymentMethod ¶
func (c *Customer) DefaultPaymentMethod() PaymentMethod
DefaultPaymentMethod returns the default payment method, or nil
func (*Customer) PaymentMethods ¶
func (c *Customer) PaymentMethods() []PaymentMethod
PaymentMethods returns a slice of all PaymentMethods this customer has
type CustomerGateway ¶
type CustomerGateway struct {
*Braintree
}
func (*CustomerGateway) Create ¶
func (g *CustomerGateway) Create(ctx context.Context, c *CustomerRequest) (*Customer, error)
Create creates a new customer from the passed in customer object. If no ID is set, Braintree will assign one.
func (*CustomerGateway) Delete ¶
func (g *CustomerGateway) Delete(ctx context.Context, id string) error
Delete deletes the customer with the given id.
func (*CustomerGateway) Search
deprecated
func (g *CustomerGateway) Search(ctx context.Context, query *SearchQuery) (*CustomerSearchResult, error)
Search finds customers matching the search query, returning the first page of results.
Deprecated: Use SearchIDs and SearchPage.
func (*CustomerGateway) SearchIDs ¶
func (g *CustomerGateway) SearchIDs(ctx context.Context, query *SearchQuery) (*SearchResult, error)
SearchIDs finds customers matching the search query, returning the IDs only. Use SearchPage to get pages of customers.
func (*CustomerGateway) SearchPage ¶
func (g *CustomerGateway) SearchPage(ctx context.Context, query *SearchQuery, searchResult *SearchResult, page int) (*CustomerSearchResult, error)
SearchPage gets the page of customers matching the search query. Use SearchIDs to start a search and get a list of IDs, use its result object to get pages. Page numbers start at 1. Returns a nil result and nil error when no more results are available.
func (*CustomerGateway) Update ¶
func (g *CustomerGateway) Update(ctx context.Context, c *CustomerRequest) (*Customer, error)
Update updates any field that is set in the passed customer object. The ID field is mandatory.
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"`
CustomFields customfields.CustomFields `xml:"custom-fields,omitempty"`
CreditCard *CreditCard `xml:"credit-card,omitempty"`
PaymentMethodNonce string `xml:"payment-method-nonce,omitempty"`
}
type CustomerSearchResult ¶
type Decimal ¶
Decimal represents fixed precision numbers
func NewDecimal ¶
NewDecimal creates a new decimal number equal to unscaled ** 10 ^ (-scale)
func (*Decimal) MarshalText ¶
MarshalText outputs a decimal representation of the scaled number
func (*Decimal) UnmarshalText ¶
UnmarshalText creates a Decimal from a string representation (e.g. 5.20) Currently only supports decimal strings
type Descriptor ¶
type Disbursement ¶
type Disbursement struct {
XMLName xml.Name `xml:"disbursement"`
Id string `xml:"id"`
ExceptionMessage string `xml:"exception-message"`
DisbursementDate *date.Date `xml:"disbursement-date"`
FollowUpAction string `xml:"follow-up-action"`
Success bool `xml:"success"`
Retry bool `xml:"retry"`
Amount *Decimal `xml:"amount"`
MerchantAccount *MerchantAccount `xml:"merchant-account"`
CurrencyIsoCode string `xml:"currency-iso-code"`
SubmerchantAccount bool `xml:"sub-merchant-account"`
Status string `xml:"status"`
TransactionIds []string `xml:"transaction-ids>item"`
}
func (*Disbursement) Transactions ¶
func (d *Disbursement) Transactions(ctx context.Context, g *TransactionGateway) (*TransactionSearchResult, error)
type DisbursementDetails ¶
type DisbursementDetails 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 DiscountGateway ¶
type DiscountGateway struct {
*Braintree
}
type DiscountList ¶
type Dispute ¶
type Dispute struct {
XMLName string `xml:"dispute"`
AmountDisputed *Decimal `xml:"amount-disputed"`
AmountWon *Decimal `xml:"amount-won"`
CaseNumber string `xml:"case-number"`
CreatedAt *time.Time `xml:"created-at"`
CurrencyISOCode string `xml:"currency-iso-code"`
Evidence []*DisputeEvidence `xml:"evidence>evidence"`
ID string `xml:"id"`
Kind DisputeKind `xml:"kind"`
MerchantAccountID string `xml:"merchant-account-id"`
OriginalDisputeID string `xml:"original-dispute-id"`
ProcessorComments string `xml:"processor-comments"`
Reason DisputeReason `xml:"reason"`
ReturnCode string `xml:"return-code"`
ReceivedDate string `xml:"received-date"`
ReferenceNumber string `xml:"reference-number"`
ReplyByDate string `xml:"reply-by-date"`
Status DisputeStatus `xml:"status"`
StatusHistory []*DisputeStatusHistoryEvent `xml:"status-history>status-history"`
Transaction *DisputeTransaction `xml:"transaction"`
UpdatedAt *time.Time `xml:"updated-at"`
}
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 DisputeEvidenceCategory `xml:"category"`
SequenceNumber string `xml:"sequence-number"`
}
type DisputeEvidenceCategory ¶
type DisputeEvidenceCategory string
const ( DisputeEvidenceCategoryDeviceId DisputeEvidenceCategory = "DEVICE_ID" DisputeEvidenceCategoryDeviceName DisputeEvidenceCategory = "DEVICE_NAME" DisputeEvidenceCategoryPriorDigitalGoodsTransactionArn DisputeEvidenceCategory = "PRIOR_DIGITAL_GOODS_TRANSACTION_ARN" DisputeEvidenceCategoryPriorDigitalGoodsTransactionDateTime DisputeEvidenceCategory = "PRIOR_DIGITAL_GOODS_TRANSACTION_DATE_TIME" DisputeEvidenceCategoryDownloadDateTime DisputeEvidenceCategory = "DOWNLOAD_DATE_TIME" DisputeEvidenceCategoryGeographicalLocation DisputeEvidenceCategory = "GEOGRAPHICAL_LOCATION" DisputeEvidenceCategoryLegitPaymentsForSameMerchandise DisputeEvidenceCategory = "LEGIT_PAYMENTS_FOR_SAME_MERCHANDISE" DisputeEvidenceCategoryMerchantWebsiteOrAppAccess DisputeEvidenceCategory = "MERCHANT_WEBSITE_OR_APP_ACCESS" DisputeEvidenceCategoryPriorNonDisputedTransactionArn DisputeEvidenceCategory = "PRIOR_NON_DISPUTED_TRANSACTION_ARN" DisputeEvidenceCategoryPriorNonDisputedTransactionDateTime DisputeEvidenceCategory = "PRIOR_NON_DISPUTED_TRANSACTION_DATE_TIME" DisputeEvidenceCategoryPriorNonDisputedTransactionEmailAddress DisputeEvidenceCategory = "PRIOR_NON_DISPUTED_TRANSACTION_EMAIL_ADDRESS" DisputeEvidenceCategoryPriorNonDisputedTransactionIpAddress DisputeEvidenceCategory = "PRIOR_NON_DISPUTED_TRANSACTION_IP_ADDRESS" DisputeEvidenceCategoryPriorNonDisputedTransactionPhoneNumber DisputeEvidenceCategory = "PRIOR_NON_DISPUTED_TRANSACTION_PHONE_NUMBER" DisputeEvidenceCategoryPriorNonDisputedTransactionPhysicalAddress DisputeEvidenceCategory = "PRIOR_NON_DISPUTED_TRANSACTION_PHYSICAL_ADDRESS" DisputeEvidenceCategoryProfileSetupOrAppAccess DisputeEvidenceCategory = "PROFILE_SETUP_OR_APP_ACCESS" DisputeEvidenceCategoryProofOfAuthorizedSigner DisputeEvidenceCategory = "PROOF_OF_AUTHORIZED_SIGNER" DisputeEvidenceCategoryProofOfDeliveryEmpAddress DisputeEvidenceCategory = "PROOF_OF_DELIVERY_EMP_ADDRESS" DisputeEvidenceCategoryProofOfDelivery DisputeEvidenceCategory = "PROOF_OF_DELIVERY" DisputeEvidenceCategoryProofOfPossessionOrUsage DisputeEvidenceCategory = "PROOF_OF_POSSESSION_OR_USAGE" DisputeEvidenceCategoryPurchaserEmailAddress DisputeEvidenceCategory = "PURCHASER_EMAIL_ADDRESS" DisputeEvidenceCategoryPurchaserIpAddress DisputeEvidenceCategory = "PURCHASER_IP_ADDRESS" DisputeEvidenceCategoryPurchaserName DisputeEvidenceCategory = "PURCHASER_NAME" DisputeEvidenceCategoryRecurringTransactionArn DisputeEvidenceCategory = "RECURRING_TRANSACTION_ARN" DisputeEvidenceCategoryRecurringTransactionDateTime DisputeEvidenceCategory = "RECURRING_TRANSACTION_DATE_TIME" DisputeEvidenceCategorySignedDeliveryForm DisputeEvidenceCategory = "SIGNED_DELIVERY_FORM" DisputeEvidenceCategorySignedOrderForm DisputeEvidenceCategory = "SIGNED_ORDER_FORM" DisputeEvidenceCategoryTicketProof DisputeEvidenceCategory = "TICKET_PROOF" )
type DisputeGateway ¶
type DisputeGateway struct {
*Braintree
}
func (*DisputeGateway) Accept ¶
func (g *DisputeGateway) Accept(ctx context.Context, disputeID string) error
func (*DisputeGateway) AddTextEvidence ¶
func (g *DisputeGateway) AddTextEvidence(ctx context.Context, disputeID string, textEvidenceRequest *DisputeTextEvidenceRequest) (*DisputeEvidence, error)
func (*DisputeGateway) Finalize ¶
func (g *DisputeGateway) Finalize(ctx context.Context, disputeID string) error
func (*DisputeGateway) RemoveEvidence ¶
type DisputeKind ¶
type DisputeKind string
const ( DisputeKindChargeback DisputeKind = "chargeback" DisputeKindPreArbitration DisputeKind = "pre_arbitration" DisputeKindRetrieval DisputeKind = "retrieval" )
type DisputeReason ¶
type DisputeReason string
const ( DisputeReasonCancelledRecurringTransaction DisputeReason = "cancelled_recurring_transaction" DisputeReasonCreditNotProcessed DisputeReason = "credit_not_processed" DisputeReasonDuplicate DisputeReason = "duplicate" DisputeReasonFraud DisputeReason = "fraud" DisputeReasonGeneral DisputeReason = "general" DisputeReasonInvalidAccount DisputeReason = "invalid_account" DisputeReasonNotRecognized DisputeReason = "not_recognized" DisputeReasonProductNotReceived DisputeReason = "product_not_received" DisputeReasonProductUnsatisfactory DisputeReason = "product_unsatisfactory" DisputeReasonTransactionAmountDiffers 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 DisputeEvidenceCategory `xml:"category,omitempty"`
SequenceNumber string `xml:"sequence-number,omitempty"`
}
type DisputeTransaction ¶
type DisputeTransaction struct {
XMLName string `xml:"transaction"`
Amount *Decimal `xml:"amount"`
CreatedAt *time.Time `xml:"created-at"`
ID string `xml:"id"`
OrderID string `xml:"order-id"`
PaymentInstrumentSubtype string `xml:"payment-instrument-subtype"`
PurchaseOrderNumber string `xml:"purchase-order-number"`
}
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
func EnvironmentFromName ¶
func EnvironmentFromName(name string) (Environment, error)
func NewEnvironment ¶
func NewEnvironment(baseURL string) Environment
func (Environment) BaseURL ¶
func (e Environment) BaseURL() string
type EscrowStatus ¶
type EscrowStatus string
const ( EscrowStatusHoldPending EscrowStatus = "hold_pending" EscrowStatusHeld EscrowStatus = "held" EscrowStatusReleasePending EscrowStatus = "release_pending" EscrowStatusReleased EscrowStatus = "released" EscrowStatusRefunded EscrowStatus = "refunded" )
type GatewayRejectionReason ¶
type GatewayRejectionReason string
const ( GatewayRejectionReasonApplicationIncomplete GatewayRejectionReason = "application_incomplete" GatewayRejectionReasonAVS GatewayRejectionReason = "avs" GatewayRejectionReasonAVSAndCVV GatewayRejectionReason = "avs_and_cvv" GatewayRejectionReasonCVV GatewayRejectionReason = "cvv" GatewayRejectionReasonDuplicate GatewayRejectionReason = "duplicate" GatewayRejectionReasonFraud GatewayRejectionReason = "fraud" GatewayRejectionReasonThreeDSecure GatewayRejectionReason = "three_d_secure" GatewayRejectionReasonUnrecognized GatewayRejectionReason = "unrecognized" )
type InvalidResponseError ¶
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 MerchantAccountGateway ¶
type MerchantAccountGateway struct {
*Braintree
}
func (*MerchantAccountGateway) Create ¶
func (g *MerchantAccountGateway) Create(ctx context.Context, ma *MerchantAccount) (*MerchantAccount, error)
Create a sub merchant account.
func (*MerchantAccountGateway) Find ¶
func (g *MerchantAccountGateway) Find(ctx context.Context, id string) (*MerchantAccount, error)
Find finds the merchant account with the specified id.
func (*MerchantAccountGateway) Update ¶
func (g *MerchantAccountGateway) Update(ctx context.Context, ma *MerchantAccount) (*MerchantAccount, error)
Update a sub merchant account.
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 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"`
CreatedAt *time.Time `xml:"created-at,omitempty"`
UpdatedAt *time.Time `xml:"updated-at,omitempty"`
Subscriptions *Subscriptions `xml:"subscriptions,omitempty"`
Default bool `xml:"default,omitempty"`
Options *PayPalAccountOptions `xml:"options,omitempty"`
}
func (*PayPalAccount) AllSubscriptions ¶
func (paypalAccount *PayPalAccount) AllSubscriptions() []*Subscription
AllSubscriptions returns all subscriptions for this paypal account, or nil if none present.
func (*PayPalAccount) GetCustomerId ¶
func (paypalAccount *PayPalAccount) GetCustomerId() string
func (*PayPalAccount) GetImageURL ¶
func (paypalAccount *PayPalAccount) GetImageURL() string
func (*PayPalAccount) GetToken ¶
func (paypalAccount *PayPalAccount) GetToken() string
func (*PayPalAccount) IsDefault ¶
func (paypalAccount *PayPalAccount) IsDefault() bool
type PayPalAccountGateway ¶
type PayPalAccountGateway struct {
*Braintree
}
func (*PayPalAccountGateway) Delete ¶
func (g *PayPalAccountGateway) Delete(ctx context.Context, paypalAccount *PayPalAccount) error
func (*PayPalAccountGateway) Find ¶
func (g *PayPalAccountGateway) Find(ctx context.Context, token string) (*PayPalAccount, error)
func (*PayPalAccountGateway) Update ¶
func (g *PayPalAccountGateway) Update(ctx context.Context, paypalAccount *PayPalAccount) (*PayPalAccount, error)
type PayPalAccountOptions ¶
type PayPalAccountOptions struct {
MakeDefault bool `xml:"make-default,omitempty"`
}
type PayPalAccounts ¶
type PayPalAccounts struct {
PayPalAccount []*PayPalAccount `xml:"paypal-account"`
}
func (*PayPalAccounts) PaymentMethods ¶
func (pp *PayPalAccounts) PaymentMethods() []PaymentMethod
type PayPalDetails ¶
type PayPalDetails 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 PaymentInstrumentType ¶
type PaymentInstrumentType string
const ( PaymentInstrumentTypeAndroidPayCard PaymentInstrumentType = "android_pay_card" PaymentInstrumentTypeApplePayCard PaymentInstrumentType = "apple_pay_card" PaymentInstrumentTypeCreditCard PaymentInstrumentType = "credit_card" PaymentInstrumentTypeMasterpassCard PaymentInstrumentType = "masterpass_card" PaymentInstrumentTypePaypalAccount PaymentInstrumentType = "paypal_account" PaymentInstrumentTypeVenmoAccount PaymentInstrumentType = "venmo_account" PaymentInstrumentTypeVisaCheckoutCard PaymentInstrumentType = "visa_checkout_card" )
type PaymentMethod ¶
type PaymentMethodGateway ¶
type PaymentMethodGateway struct {
*Braintree
}
func (*PaymentMethodGateway) Create ¶
func (g *PaymentMethodGateway) Create(ctx context.Context, paymentMethodRequest *PaymentMethodRequest) (PaymentMethod, error)
func (*PaymentMethodGateway) Delete ¶
func (g *PaymentMethodGateway) Delete(ctx context.Context, token string) error
func (*PaymentMethodGateway) Find ¶
func (g *PaymentMethodGateway) Find(ctx context.Context, token string) (PaymentMethod, error)
func (*PaymentMethodGateway) Update ¶
func (g *PaymentMethodGateway) Update(ctx context.Context, token string, paymentMethod *PaymentMethodRequest) (PaymentMethod, error)
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 PaymentMethodNonceGateway ¶
type PaymentMethodNonceGateway struct {
*Braintree
}
func (*PaymentMethodNonceGateway) Create ¶
func (g *PaymentMethodNonceGateway) Create(ctx context.Context, token string) (*PaymentMethodNonce, error)
func (*PaymentMethodNonceGateway) Find ¶
func (g *PaymentMethodNonceGateway) Find(ctx context.Context, nonce string) (*PaymentMethodNonce, error)
type PaymentMethodRequest ¶
type PaymentMethodRequestOptions ¶
type PaymentMethodRequestOptions struct {
MakeDefault bool `xml:"make-default,omitempty"`
FailOnDuplicatePaymentMethod bool `xml:"fail-on-duplicate-payment-method,omitempty"`
VerifyCard *bool `xml:"verify-card,omitempty"`
VerificationMerchantAccountId string `xml:"verification-merchant-account-id,omitempty"`
}
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 PlanGateway ¶
type PlanGateway struct {
*Braintree
}
type ProcessorResponseCode ¶
type ProcessorResponseCode int
const (
ProcessorResponseCodeCardIssuerDeclinedCVV ProcessorResponseCode = 2010
)
func (ProcessorResponseCode) Int ¶
func (rc ProcessorResponseCode) Int() int
func (ProcessorResponseCode) MarshalText ¶
func (rc ProcessorResponseCode) MarshalText() ([]byte, error)
MarshalText returns a string in bytes of the number, or nil in the case it is zero.
func (*ProcessorResponseCode) UnmarshalText ¶
func (rc *ProcessorResponseCode) UnmarshalText(text []byte) error
UnmarshalText fills the response code with the integer value if the text contains one in string form. If the text is zero length, the response code's value is unchanged but unmarshaling is successful.
type ProcessorResponseType ¶
type ProcessorResponseType string
const ( ProcessorResponseTypeApproved ProcessorResponseType = "approved" ProcessorResponseTypeSoftDeclined ProcessorResponseType = "soft_declined" ProcessorResponseTypeHardDeclined ProcessorResponseType = "hard_declined" )
type RangeField ¶
type RiskDataRequest ¶
type SearchQuery ¶
type SearchQuery struct {
// contains filtered or unexported fields
}
func (*SearchQuery) AddMultiField ¶
func (s *SearchQuery) AddMultiField(field string) *MultiField
func (*SearchQuery) AddRangeField ¶
func (s *SearchQuery) AddRangeField(field string) *RangeField
func (*SearchQuery) AddTextField ¶
func (s *SearchQuery) AddTextField(field string) *TextField
func (*SearchQuery) AddTimeField ¶
func (s *SearchQuery) AddTimeField(field string) *TimeField
func (*SearchQuery) MarshalXML ¶
func (s *SearchQuery) MarshalXML(e *xml.Encoder, start xml.StartElement) error
type SearchResult ¶
type Settlement ¶
type SettlementBatchSummary ¶
type SettlementBatchSummary struct {
XMLName string `xml:"settlement-batch-summary"`
Records XMLRecords `xml:"records"`
}
type SettlementGateway ¶
type SettlementGateway struct {
*Braintree
}
func (*SettlementGateway) Generate ¶
func (sg *SettlementGateway) Generate(ctx context.Context, s *Settlement) (*SettlementBatchSummary, error)
type SignatureError ¶
type SignatureError struct {
// contains filtered or unexported fields
}
func (SignatureError) Error ¶
func (i SignatureError) Error() string
type Subscription ¶
type Subscription struct {
XMLName string `xml:"subscription"`
Id string `xml:"id"`
Balance *Decimal `xml:"balance"`
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"`
NeverExpires bool `xml:"never-expires"`
NextBillAmount *Decimal `xml:"next-bill-amount"`
NextBillingPeriodAmount *Decimal `xml:"next-billing-period-amount"`
NextBillingDate string `xml:"next-billing-date"`
NumberOfBillingCycles *int `xml:"number-of-billing-cycles"`
PaidThroughDate string `xml:"paid-through-date"`
PaymentMethodToken string `xml:"payment-method-token"`
PlanId string `xml:"plan-id"`
Price *Decimal `xml:"price"`
Status SubscriptionStatus `xml:"status"`
TrialDuration string `xml:"trial-duration"`
TrialDurationUnit string `xml:"trial-duration-unit"`
TrialPeriod bool `xml:"trial-period"`
Transactions *Transactions `xml:"transactions"`
Options *SubscriptionOptions `xml:"options"`
StatusEvents []*SubscriptionStatusEvent `xml:"status-history>status-event"`
Descriptor *Descriptor `xml:"descriptor"`
AddOns *AddOnList `xml:"add-ons"`
Discounts *DiscountList `xml:"discounts"`
CreatedAt *time.Time `xml:"created-at,omitempty"`
UpdatedAt *time.Time `xml:"updated-at,omitempty"`
}
type SubscriptionDetails ¶
type SubscriptionGateway ¶
type SubscriptionGateway struct {
*Braintree
}
func (*SubscriptionGateway) Cancel ¶
func (g *SubscriptionGateway) Cancel(ctx context.Context, subId string) (*Subscription, error)
func (*SubscriptionGateway) Create ¶
func (g *SubscriptionGateway) Create(ctx context.Context, sub *SubscriptionRequest) (*Subscription, error)
func (*SubscriptionGateway) Find ¶
func (g *SubscriptionGateway) Find(ctx context.Context, subId string) (*Subscription, error)
func (*SubscriptionGateway) RetryCharge ¶
func (g *SubscriptionGateway) RetryCharge(ctx context.Context, txReq *SubscriptionTransactionRequest) error
RetryCharge retries to charge for a Subscription. All options, including the Subscription ID, are to be provided by the SubscriptionTransactionRequest passed as an argument. Note that the Amount has to be > 0.
func (*SubscriptionGateway) Search
deprecated
func (g *SubscriptionGateway) Search(ctx context.Context, query *SearchQuery) (*SubscriptionSearchResult, error)
Search finds subscriptions matching the search query, returning the first page of results. Use SearchNext to get subsequent pages.
Deprecated: Use SearchIDs and SearchPage.
func (*SubscriptionGateway) SearchIDs ¶
func (g *SubscriptionGateway) SearchIDs(ctx context.Context, query *SearchQuery) (*SearchResult, error)
SearchIDs finds subscriptions matching the search query, returning the IDs only. Use SearchPage to get pages of subscriptions.
func (*SubscriptionGateway) SearchNext
deprecated
func (g *SubscriptionGateway) SearchNext(ctx context.Context, query *SearchQuery, prevResult *SubscriptionSearchResult) (*SubscriptionSearchResult, error)
SearchNext finds the next page of Subscriptions matching the search query. Use Search to start a search and get the first page of results. Returns a nil result and nil error when no more results are available.
Deprecated: Use SearchIDs and SearchPage.
func (*SubscriptionGateway) SearchPage ¶
func (g *SubscriptionGateway) SearchPage(ctx context.Context, query *SearchQuery, searchResult *SearchResult, page int) (*SubscriptionSearchResult, error)
SearchPage gets the page of subscriptions matching the search query. Use SearchIDs to start a search and get a list of IDs, and use its result object to get pages. Page numbers start at 1. Returns a nil result and nil error when no more results are available.
func (*SubscriptionGateway) Update ¶
func (g *SubscriptionGateway) Update(ctx context.Context, subId string, sub *SubscriptionRequest) (*Subscription, error)
type SubscriptionOptions ¶
type SubscriptionOptions 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"`
BillingDayOfMonth *int `xml:"billing-day-of-month,omitempty"`
FailureCount string `xml:"failure-count,omitempty"`
FirstBillingDate string `xml:"first-billing-date,omitempty"`
MerchantAccountId string `xml:"merchant-account-id,omitempty"`
NeverExpires *bool `xml:"never-expires,omitempty"`
NumberOfBillingCycles *int `xml:"number-of-billing-cycles,omitempty"`
Options *SubscriptionOptions `xml:"options,omitempty"`
PaymentMethodNonce string `xml:"paymentMethodNonce,omitempty"`
PaymentMethodToken string `xml:"paymentMethodToken,omitempty"`
PlanId string `xml:"planId,omitempty"`
Price *Decimal `xml:"price,omitempty"`
TrialDuration string `xml:"trial-duration,omitempty"`
TrialDurationUnit string `xml:"trial-duration-unit,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
TotalIDs []string
CurrentPageNumber int
PageSize int
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"`
Balance *Decimal `xml:"balance"`
Price *Decimal `xml:"price"`
Status SubscriptionStatus `xml:"status"`
CurrencyISOCode string `xml:"currency-iso-code"`
User string `xml:"user"`
PlanID string `xml:"plan-id"`
SubscriptionSource string `xml:"subscription-source"`
}
SubscriptionStatusEvent contains information about what and when something changed about the subscription.
type SubscriptionTransactionOptionsRequest ¶
type SubscriptionTransactionOptionsRequest struct {
SubmitForSettlement bool `xml:"submit-for-settlement"`
}
type SubscriptionTransactionRequest ¶
type SubscriptionTransactionRequest struct {
Amount *Decimal
SubscriptionID string
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 TestingGateway ¶
type TestingGateway struct {
*Braintree
}
TestingGateway exports actions only available in the sandbox environment.
func (*TestingGateway) Settle ¶
func (g *TestingGateway) Settle(ctx context.Context, transactionID string) (*Transaction, error)
Settle changes the transaction's status to settle.
func (*TestingGateway) SettlementConfirm ¶
func (g *TestingGateway) SettlementConfirm(ctx context.Context, transactionID string) (*Transaction, error)
SettlementConfirm changes the transaction's status to settlement_confirm.
func (*TestingGateway) SettlementDecline ¶
func (g *TestingGateway) SettlementDecline(ctx context.Context, transactionID string) (*Transaction, error)
SettlementDecline changes the transaction's status to settlement_decline.
func (*TestingGateway) SettlementPending ¶
func (g *TestingGateway) SettlementPending(ctx context.Context, transactionID string) (*Transaction, error)
SettlementPending changes the transaction's status to settlement_pending.
type ThreeDSecureEnrolled ¶
type ThreeDSecureEnrolled string
const ( ThreeDSecureEnrolledYes ThreeDSecureEnrolled = "Y" ThreeDSecureEnrolledNo ThreeDSecureEnrolled = "N" ThreeDSecureEnrolledBypass ThreeDSecureEnrolled = "B" ThreeDSecureEnrolledRequestFailure 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 ( ThreeDSecureStatusUnsupportedCard ThreeDSecureStatus = "unsupported_card" ThreeDSecureStatusLookupError ThreeDSecureStatus = "lookup_error" ThreeDSecureStatusLookupEnrolled ThreeDSecureStatus = "lookup_enrolled" ThreeDSecureStatusLookupNotEnrolled ThreeDSecureStatus = "lookup_not_enrolled" ThreeDSecureStatusAuthenticateSuccessfulIssuerNotParticipating ThreeDSecureStatus = "authenticate_successful_issuer_not_participating" ThreeDSecureStatusAuthenticateSignatureVerificationFailed ThreeDSecureStatus = "authenticate_signature_verification_failed" ThreeDSecureStatusAuthenticateSuccessful ThreeDSecureStatus = "authenticate_successful" ThreeDSecureStatusAuthenticateAttemptSuccessful ThreeDSecureStatus = "authenticate_attempt_successful" ThreeDSecureStatusAuthenticateFailed ThreeDSecureStatus = "authenticate_failed" ThreeDSecureStatusAuthenticateUnableToAuthenticate ThreeDSecureStatus = "authenticate_unable_to_authenticate" ThreeDSecureStatusAuthenticateError ThreeDSecureStatus = "authenticate_error" )
type TimeField ¶
func (TimeField) MarshalXML ¶
type Transaction ¶
type Transaction struct {
XMLName string `xml:"transaction"`
Id string `xml:"id"`
GraphQLId string `xml:"global-id"`
Status TransactionStatus `xml:"status"`
Type string `xml:"type"`
CurrencyISOCode string `xml:"currency-iso-code"`
Amount *Decimal `xml:"amount"`
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"`
SubscriptionDetails *SubscriptionDetails `xml:"subscription"`
CreditCard *CreditCard `xml:"credit-card"`
Customer *Customer `xml:"customer"`
BillingAddress *Address `xml:"billing"`
ShippingAddress *Address `xml:"shipping"`
TaxAmount *Decimal `xml:"tax-amount"`
TaxExempt bool `xml:"tax-exempt"`
DeviceData string `xml:"device-data"`
ServiceFeeAmount *Decimal `xml:"service-fee-amount,attr"`
CreatedAt *time.Time `xml:"created-at"`
UpdatedAt *time.Time `xml:"updated-at"`
DisbursementDetails *DisbursementDetails `xml:"disbursement-details"`
RefundId string `xml:"refund-id"`
RefundIds *[]string `xml:"refund-ids>item"`
RefundedTransactionId *string `xml:"refunded-transaction-id"`
ProcessorResponseCode ProcessorResponseCode `xml:"processor-response-code"`
ProcessorResponseText string `xml:"processor-response-text"`
ProcessorResponseType ProcessorResponseType `xml:"processor-response-type"`
ProcessorAuthorizationCode string `xml:"processor-authorization-code"`
SettlementBatchId string `xml:"settlement-batch-id"`
EscrowStatus EscrowStatus `xml:"escrow-status"`
PaymentInstrumentType PaymentInstrumentType `xml:"payment-instrument-type"`
ThreeDSecureInfo *ThreeDSecureInfo `xml:"three-d-secure-info,omitempty"`
PayPalDetails *PayPalDetails `xml:"paypal"`
VenmoAccountDetails *VenmoAccountDetails `xml:"venmo-account"`
AndroidPayDetails *AndroidPayDetails `xml:"android-pay-card"`
ApplePayDetails *ApplePayDetails `xml:"apple-pay"`
AdditionalProcessorResponse string `xml:"additional-processor-response"`
RiskData *RiskData `xml:"risk-data"`
Descriptor *Descriptor `xml:"descriptor"`
Channel string `xml:"channel"`
CustomFields customfields.CustomFields `xml:"custom-fields"`
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 GatewayRejectionReason `xml:"gateway-rejection-reason"`
PurchaseOrderNumber string `xml:"purchase-order-number"`
Disputes []*Dispute `xml:"disputes>dispute"`
AuthorizationExpiresAt *time.Time `xml:"authorization-expires-at"`
}
func (*Transaction) UnmarshalXML ¶
func (t *Transaction) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
type TransactionCloneOptions ¶
type TransactionCloneOptions struct {
SubmitForSettlement bool `xml:"submit-for-settlement"`
}
type TransactionCloneRequest ¶
type TransactionCloneRequest struct {
XMLName string `xml:"transaction-clone"`
Amount *Decimal `xml:"amount"`
Channel string `xml:"channel"`
Options *TransactionCloneOptions `xml:"options"`
}
type TransactionGateway ¶
type TransactionGateway struct {
*Braintree
}
func (*TransactionGateway) CancelRelease ¶
func (g *TransactionGateway) CancelRelease(ctx context.Context, id string) (*Transaction, error)
CancelRelease cancels a pending release of a transaction with the given id from escrow.
func (*TransactionGateway) Clone ¶
func (g *TransactionGateway) Clone(ctx context.Context, id string, tx *TransactionCloneRequest) (*Transaction, error)
Clone clones a transaction.
func (*TransactionGateway) Create ¶
func (g *TransactionGateway) Create(ctx context.Context, tx *TransactionRequest) (*Transaction, error)
Create initiates a transaction.
func (*TransactionGateway) Find ¶
func (g *TransactionGateway) Find(ctx context.Context, id string) (*Transaction, error)
Find finds the transaction with the specified id.
func (*TransactionGateway) HoldInEscrow ¶
func (g *TransactionGateway) HoldInEscrow(ctx context.Context, id string) (*Transaction, error)
HoldInEscrow holds the transaction with the given id for escrow.
func (*TransactionGateway) Refund ¶
func (g *TransactionGateway) Refund(ctx context.Context, id string, amount ...*Decimal) (*Transaction, error)
A transaction can be refunded if it is settled or settling. If the transaction has not yet begun settlement, use Void() instead. If you do not specify an amount to refund, the entire transaction amount will be refunded.
func (*TransactionGateway) RefundWithRequest ¶
func (g *TransactionGateway) RefundWithRequest(ctx context.Context, id string, refundRequest *TransactionRefundRequest) (*Transaction, error)
RefundWithRequest is similar to Refund, but allows more parameters such as OrderID to be included as part of the refund request.
func (*TransactionGateway) ReleaseFromEscrow ¶
func (g *TransactionGateway) ReleaseFromEscrow(ctx context.Context, id string) (*Transaction, error)
ReleaseFromEscrow submits the transaction with the given id for release from escrow.
func (*TransactionGateway) Search
deprecated
func (g *TransactionGateway) Search(ctx context.Context, query *SearchQuery) (*TransactionSearchResult, error)
Search finds transactions matching the search query, returning the first page of results. Use SearchNext to get subsequent pages.
Deprecated: Use SearchIDs and SearchPage.
func (*TransactionGateway) SearchIDs ¶
func (g *TransactionGateway) SearchIDs(ctx context.Context, query *SearchQuery) (*SearchResult, error)
SearchIDs finds transactions matching the search query, returning the IDs only. Use SearchPage to get pages of transactions.
func (*TransactionGateway) SearchNext
deprecated
func (g *TransactionGateway) SearchNext(ctx context.Context, query *SearchQuery, prevResult *TransactionSearchResult) (*TransactionSearchResult, error)
SearchNext finds the next page of transactions matching the search query. Use Search to start a search and get the first page of results. Returns a nil result and nil error when no more results are available.
Deprecated: Use SearchIDs and SearchPage.
func (*TransactionGateway) SearchPage ¶
func (g *TransactionGateway) SearchPage(ctx context.Context, query *SearchQuery, searchResult *SearchResult, page int) (*TransactionSearchResult, error)
SearchPage gets the page of transactions matching the search query. Use SearchIDs to start a search and get a list of IDs, use its result object to get pages. Page numbers start at 1. Returns a nil result and nil error when no more results are available.
func (*TransactionGateway) Settle ¶
func (g *TransactionGateway) Settle(ctx context.Context, id string) (*Transaction, error)
Settle settles a transaction. This action is only available in the sandbox environment. Deprecated: use the Settle function on the TestingGateway instead. e.g. g.Testing().Settle(id).
func (*TransactionGateway) SubmitForSettlement ¶
func (g *TransactionGateway) SubmitForSettlement(ctx context.Context, id string, amount ...*Decimal) (*Transaction, error)
SubmitForSettlement submits the transaction with the specified id for settlement. If the amount is omitted, the full amount is settled.
func (*TransactionGateway) Void ¶
func (g *TransactionGateway) Void(ctx context.Context, id string) (*Transaction, error)
Void voids the transaction with the specified id if it has a status of authorized or submitted_for_settlement. When the transaction is voided Braintree will do an authorization reversal if possible so that the customer won't have a pending charge on their card
type TransactionLineItem ¶
type TransactionLineItem struct {
Quantity *Decimal `xml:"quantity"`
Name string `xml:"name"`
Description string `xml:"description"`
Kind TransactionLineItemKind `xml:"kind"`
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"`
UnitOfMeasure string `xml:"unit-of-measure"`
ProductCode string `xml:"product-code"`
CommodityCode string `xml:"commodity-code"`
URL string `xml:"url"`
}
type TransactionLineItemGateway ¶
type TransactionLineItemGateway struct {
*Braintree
}
func (*TransactionLineItemGateway) Find ¶
func (g *TransactionLineItemGateway) Find(ctx context.Context, transactionID string) (TransactionLineItems, error)
Find finds the transaction line items with the specified transaction id.
type TransactionLineItemKind ¶
type TransactionLineItemKind string
const ( TransactionLineItemKindDebit TransactionLineItemKind = "debit" TransactionLineItemKindCredit TransactionLineItemKind = "credit" )
type TransactionLineItemRequest ¶
type TransactionLineItemRequest struct {
Name string `xml:"name"`
Description string `xml:"description,omitempty"`
Kind TransactionLineItemKind `xml:"kind"`
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"`
UnitOfMeasure string `xml:"unit-of-measure,omitempty"`
ProductCode string `xml:"product-code,omitempty"`
CommodityCode string `xml:"commodity-code,omitempty"`
URL string `xml:"url,omitempty"`
}
type TransactionLineItemRequests ¶
type TransactionLineItemRequests []*TransactionLineItemRequest
func (TransactionLineItemRequests) MarshalXML ¶
func (rs TransactionLineItemRequests) MarshalXML(e *xml.Encoder, start xml.StartElement) error
type TransactionLineItems ¶
type TransactionLineItems []*TransactionLineItem
func (*TransactionLineItems) UnmarshalXML ¶
func (ls *TransactionLineItems) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error
type TransactionOptions ¶
type TransactionOptions 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"`
TransactionOptionsPaypalRequest *TransactionOptionsPaypalRequest `xml:"paypal,omitempty"`
SkipAdvancedFraudChecking bool `xml:"skip_advanced_fraud_checking,omitempty"`
ThreeDSecure *TransactionOptionsThreeDSecureRequest `xml:"three-d-secure,omitempty"`
}
type TransactionOptionsPaypalRequest ¶
type TransactionOptionsPaypalRequest struct {
CustomField string
PayeeEmail string
Description string
SupplementaryData map[string]string
}
func (TransactionOptionsPaypalRequest) MarshalXML ¶
func (r TransactionOptionsPaypalRequest) MarshalXML(e *xml.Encoder, start xml.StartElement) error
type TransactionOptionsThreeDSecureRequest ¶
type TransactionOptionsThreeDSecureRequest struct {
Required bool `xml:"required"`
}
type TransactionRequest ¶
type TransactionRequest struct {
XMLName string `xml:"transaction"`
CustomerID string `xml:"customer-id,omitempty"`
Type string `xml:"type,omitempty"`
Amount *Decimal `xml:"amount"`
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"`
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"`
TaxExempt bool `xml:"tax-exempt,omitempty"`
DeviceData string `xml:"device-data,omitempty"`
Options *TransactionOptions `xml:"options,omitempty"`
ServiceFeeAmount *Decimal `xml:"service-fee-amount,attr,omitempty"`
RiskData *RiskDataRequest `xml:"risk-data,omitempty"`
Descriptor *Descriptor `xml:"descriptor,omitempty"`
Channel string `xml:"channel,omitempty"`
CustomFields customfields.CustomFields `xml:"custom-fields,omitempty"`
PurchaseOrderNumber string `xml:"purchase-order-number,omitempty"`
TransactionSource TransactionSource `xml:"transaction-source,omitempty"`
LineItems TransactionLineItemRequests `xml:"line-items,omitempty"`
}
type TransactionSearchResult ¶
type TransactionSearchResult struct {
TotalItems int
TotalIDs []string
CurrentPageNumber int
PageSize int
Transactions []*Transaction
}
type TransactionSource ¶
type TransactionSource string
const ( TransactionSourceRecurringFirst TransactionSource = "recurring_first" TransactionSourceRecurring TransactionSource = "recurring" TransactionSourceMOTO TransactionSource = "moto" TransactionSourceMerchant TransactionSource = "merchant" )
type TransactionStatus ¶
type TransactionStatus string
const ( TransactionStatusAuthorizationExpired TransactionStatus = "authorization_expired" TransactionStatusAuthorizing TransactionStatus = "authorizing" TransactionStatusAuthorized TransactionStatus = "authorized" TransactionStatusGatewayRejected TransactionStatus = "gateway_rejected" TransactionStatusFailed TransactionStatus = "failed" TransactionStatusProcessorDeclined TransactionStatus = "processor_declined" TransactionStatusSettled TransactionStatus = "settled" TransactionStatusSettlementConfirmed TransactionStatus = "settlement_confirmed" TransactionStatusSettlementDeclined TransactionStatus = "settlement_declined" TransactionStatusSettlementPending TransactionStatus = "settlement_pending" TransactionStatusSettling TransactionStatus = "settling" TransactionStatusSubmittedForSettlement TransactionStatus = "submitted_for_settlement" TransactionStatusVoided TransactionStatus = "voided" TransactionStatusUnrecognized TransactionStatus = "unrecognized" )
type Transactions ¶
type Transactions struct {
Transaction []*Transaction `xml:"transaction"`
}
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
AllSubscriptions returns all subscriptions for this venmo account, or nil if none present.
func (*VenmoAccount) GetCustomerId ¶
func (v *VenmoAccount) GetCustomerId() string
func (*VenmoAccount) GetImageURL ¶
func (v *VenmoAccount) GetImageURL() string
func (*VenmoAccount) GetToken ¶
func (v *VenmoAccount) GetToken() string
func (*VenmoAccount) IsDefault ¶
func (v *VenmoAccount) IsDefault() bool
type VenmoAccountDetails ¶
type VenmoAccounts ¶
type VenmoAccounts struct {
VenmoAccount []*VenmoAccount `xml:"venmo-account"`
}
func (*VenmoAccounts) PaymentMethods ¶
func (v *VenmoAccounts) PaymentMethods() []PaymentMethod
type WebhookNotification ¶
type WebhookNotification struct {
XMLName xml.Name `xml:"notification"`
Timestamp time.Time `xml:"timestamp"`
Kind string `xml:"kind"`
Subject *webhookSubject `xml:"subject"`
}
func (*WebhookNotification) AccountUpdaterDailyReport ¶
func (n *WebhookNotification) AccountUpdaterDailyReport() *AccountUpdaterDailyReport
func (*WebhookNotification) Disbursement ¶
func (n *WebhookNotification) Disbursement() *Disbursement
func (*WebhookNotification) Dispute ¶
func (n *WebhookNotification) Dispute() *Dispute
func (*WebhookNotification) MerchantAccount ¶
func (n *WebhookNotification) MerchantAccount() *MerchantAccount
type WebhookNotificationGateway ¶
type WebhookNotificationGateway struct {
*Braintree
// contains filtered or unexported fields
}
func (*WebhookNotificationGateway) Parse ¶
func (w *WebhookNotificationGateway) Parse(signature, payload string) (*WebhookNotification, error)
func (*WebhookNotificationGateway) ParseRequest ¶
func (w *WebhookNotificationGateway) ParseRequest(r *http.Request) (*WebhookNotification, error)
type WebhookTestingGateway ¶
type WebhookTestingGateway struct {
*Braintree
// contains filtered or unexported fields
}
WebhookTestingGateway exports actions only available in the sandbox environment.
func (*WebhookTestingGateway) Request ¶
func (g *WebhookTestingGateway) Request(kind, id string) (*http.Request, error)
Request simulates an incoming webhook notification request
func (*WebhookTestingGateway) SamplePayload ¶
func (g *WebhookTestingGateway) SamplePayload(kind, id string) string
SamplePayload builds a sample payload of the given kind, different kind of notifications are defined as constants in webhook_notification.go id represents an id used in XML subject of the specified kind
func (*WebhookTestingGateway) SignPayload ¶
func (g *WebhookTestingGateway) SignPayload(payload string) (string, error)
SignPayload signs payload and returns HMAC signature
type XMLRecords ¶
Source Files
¶
- account_updater_daily_report.go
- add_on.go
- add_on_gateway.go
- address.go
- address_gateway.go
- android_pay_card.go
- android_pay_details.go
- apple_pay_card.go
- apple_pay_details.go
- avs_response_code.go
- braintree.go
- client_token.go
- client_token_gateway.go
- credentials.go
- credentials_access_token.go
- credentials_api_key.go
- credit_card.go
- credit_card_gateway.go
- customer.go
- customer_gateway.go
- cvv_response_code.go
- decimal.go
- descriptor.go
- disbursement.go
- disbursement_details.go
- discount.go
- discount_gateway.go
- dispute.go
- dispute_evidence.go
- dispute_gateway.go
- doc.go
- environment.go
- errors.go
- escrow_status.go
- fake_nonces.go
- gateway_rejection_reason.go
- hmac.go
- merchant_account.go
- merchant_account_gateway.go
- modification.go
- modification_request.go
- payment_method.go
- payment_method_gateway.go
- payment_method_nonce.go
- payment_method_nonce_gateway.go
- paypal_account.go
- paypal_account_gateway.go
- paypal_details.go
- plan.go
- plan_gateway.go
- processor_response_code.go
- processor_response_type.go
- response.go
- search.go
- settlement.go
- settlement_gateway.go
- subscription.go
- subscription_gateway.go
- subscription_status_history.go
- testing_gateway.go
- three_d_secure.go
- transaction.go
- transaction_clone.go
- transaction_gateway.go
- transaction_line_item.go
- transaction_line_item_gateway.go
- venmo_account.go
- venmo_account_details.go
- version.go
- webhook_notification.go
- webhook_notification_gateway.go
- webhook_testing_gateway.go
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
subscription
command
|
|
|
transaction
command
|
|
|
transaction_3ds
command
|
|