Versions in this module Expand all Collapse all v1 v1.0.0 May 29, 2019 Changes in this version + const AccountStateActive + const AccountStateClosed + const AdjustmentStateInvoied + const AdjustmentStatePending + const CardTypeAmericanExpress + const CardTypeDankort + const CardTypeDinersClub + const CardTypeDiscover + const CardTypeForbrugsforeningen + const CardTypeJCB + const CardTypeLaser + const CardTypeMaestro + const CardTypeMaster + const CardTypeVisa + const ChargeInvoiceOriginImmediateChange + const ChargeInvoiceOriginPurchase + const ChargeInvoiceOriginRenewal + const ChargeInvoiceOriginTermination + const ChargeInvoiceStateFailed + const ChargeInvoiceStatePaid + const ChargeInvoiceStatePastDue + const ChargeInvoiceStatePending + const ChargeInvoiceStateProcessing + const CollectionMethodAutomatic + const CollectionMethodManual + const CreditInvoiceOriginCredit + const CreditInvoiceOriginExternalCredit + const CreditInvoiceOriginGiftCard + const CreditInvoiceOriginRefund + const CreditInvoiceOriginWriteOff + const CreditInvoiceStateClosed + const CreditInvoiceStateOpen + const CreditInvoiceStateProcessing + const CreditInvoiceStateVoided + const CreditPaymentActionGiftCard + const CreditPaymentActionPayment + const CreditPaymentActionReduction + const CreditPaymentActionRefund + const CreditPaymentActionWriteOff + const DateTimeFormat + const InvoiceTypeCharge + const InvoiceTypeCredit + const InvoiceTypeLegacy + const PaymentMethodCheck + const PaymentMethodCreditCard + const PaymentMethodEFT + const PaymentMethodMoneyOrder + const PaymentMethodOther + const PaymentMethodPayPal + const PaymentMethodWireTransfer + const RedemptionStateActive + const RedemptionStateInactive + const RevenueScheduleTypeAtInvoice + const RevenueScheduleTypeAtRangeEnd + const RevenueScheduleTypeAtRangeStart + const RevenueScheduleTypeEvenly + const RevenueScheduleTypeNever + const SubscriptionStateActive + const SubscriptionStateCanceled + const SubscriptionStateExpired + const SubscriptionStateFuture + const SubscriptionStateInTrial + const SubscriptionStateLive + const SubscriptionStatePastDue + const SubscriptionStatePaused + const TransactionStatusFailed + const TransactionStatusSuccess + const TransactionStatusVoid + const VoidRefundMethodCreditFirst + const VoidRefundMethodTransactionFirst + func NewTestServer() (*Client, *TestServer) + type AVSResult struct + Code string + Message string + type Account struct + AcceptLanguage string + Address *Address + BillingInfo *Billing + CCEmails []string + ClosedAt NullTime + Code string + CompanyName string + CreatedAt NullTime + CustomFields *CustomFields + Email string + FirstName string + HasActiveSubscription NullBool + HasCanceledSubscription NullBool + HasFutureSubscription NullBool + HasLiveSubscription NullBool + HasPastDueInvoice NullBool + HasPausedSubscription NullBool + HostedLoginToken string + LastName string + PreferredLocale string + ShippingAddresses *[]ShippingAddress + State string + TaxExempt NullBool + UpdatedAt NullTime + Username string + VATNumber string + XMLName xml.Name + type AccountBalance struct + Balance UnitAmount + PastDue bool + XMLName xml.Name + type AccountsService interface + Balance func(ctx context.Context, accountCode string) (*AccountBalance, error) + Close func(ctx context.Context, accountCode string) error + Create func(ctx context.Context, a Account) (*Account, error) + Get func(ctx context.Context, accountCode string) (*Account, error) + List func(opts *PagerOptions) Pager + ListNotes func(accountCode string, params *PagerOptions) Pager + Reopen func(ctx context.Context, accountCode string) error + Update func(ctx context.Context, accountCode string, a Account) (*Account, error) + type AddOn struct + AccountingCode string + Code string + CreatedAt NullTime + DefaultQuantity NullInt + DisplayQuantityOnHostedPage NullBool + Name string + TaxCode string + UnitAmountInCents UnitAmount + XMLName xml.Name + type AddOnsService interface + Create func(ctx context.Context, planCode string, a AddOn) (*AddOn, error) + Delete func(ctx context.Context, planCode string, code string) error + Get func(ctx context.Context, planCode string, code string) (*AddOn, error) + List func(planCode string, opts *PagerOptions) Pager + Update func(ctx context.Context, planCode string, code string, a AddOn) (*AddOn, error) + type Address struct + Address string + Address2 string + City string + Company string + Country string + FirstName string + LastName string + NameOnAccount string + Phone string + State string + XMLName xml.Name + Zip string + type Adjustment struct + AccountCode string + AccountingCode string + CreatedAt NullTime + Currency string + Description string + DiscountInCents int + EndDate NullTime + InvoiceNumber int + Origin string + OriginalAdjustmentUUID string + ProductCode string + Quantity int + RevenueScheduleType string + StartDate NullTime + State string + SubscriptionUUID string + TaxCode string + TaxDetails []TaxDetail + TaxExempt NullBool + TaxInCents int + TaxRate float64 + TaxRegion string + TaxType string + Taxable NullBool + TotalInCents int + UUID string + UnitAmountInCents NullInt + UpdatedAt NullTime + XMLName xml.Name + func (a *Adjustment) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + func (a Adjustment) MarshalXML(e *xml.Encoder, start xml.StartElement) error + type AdjustmentsService interface + Create func(ctx context.Context, accountCode string, a Adjustment) (*Adjustment, error) + Delete func(ctx context.Context, uuid string) error + Get func(ctx context.Context, uuid string) (*Adjustment, error) + ListAccount func(accountCode string, opts *PagerOptions) Pager + type Billing struct + AccountNumber string + AccountType string + Address string + Address2 string + AmazonAgreementID string + AmazonRegion string + CardType string + City string + Company string + Country string + Currency string + ExternalHPPType string + FirstName string + FirstSix string + IPAddress net.IP + IPAddressCountry string + LastFour string + LastName string + Month int + NameOnAccount string + Number int + PaypalAgreementID string + Phone string + RoutingNumber string + State string + Token string + VATNumber string + VerificationValue int + XMLName xml.Name + Year int + Zip string + func (b Billing) Type() string + type BillingService interface + Clear func(ctx context.Context, accountCode string) error + Create func(ctx context.Context, accountCode string, b Billing) (*Billing, error) + Get func(ctx context.Context, accountCode string) (*Billing, error) + Update func(ctx context.Context, accountCode string, b Billing) (*Billing, error) + type CVVResult struct + Code string + Message string + type Client struct + Accounts AccountsService + AddOns AddOnsService + Adjustments AdjustmentsService + Billing BillingService + Client HTTPDoer + Coupons CouponsService + CreditPayments CreditPaymentsService + Invoices InvoicesService + Plans PlansService + Purchases PurchasesService + Redemptions RedemptionsService + ShippingAddresses ShippingAddressesService + ShippingMethods ShippingMethodsService + Subscriptions SubscriptionsService + Transactions TransactionsService + func NewClient(subdomain, apiKey string) *Client + type ClientError struct + Response *http.Response + ValidationErrors []ValidationError + func (e *ClientError) Error() string + func (e *ClientError) Is(symbol string) bool + type Coupon struct + AppliesToAllPlans bool + AppliesToNonPlanCharges bool + Code string + CreatedAt NullTime + DeletedAt NullTime + Description string + DiscountInCents *UnitAmount + DiscountPercent NullInt + DiscountType string + Duration string + ID int64 + InvoiceDescription string + MaxRedemptions NullInt + MaxRedemptionsPerAccount NullInt + Name string + PlanCodes []string + RedeemByDate NullTime + RedemptionResource string + State string + TemporalAmount NullInt + TemporalUnit string + Type string + UniqueCodeTemplate string + UniqueCouponCodeCount NullInt + UpdatedAt NullTime + XMLName xml.Name + type CouponRedemption struct + AccountCode string + Currency string + SubscriptionUUID string + XMLName xml.Name + type CouponsService interface + Create func(ctx context.Context, c Coupon) (*Coupon, error) + Delete func(ctx context.Context, code string) error + Generate func(ctx context.Context, code string, n int) (Pager, error) + Get func(ctx context.Context, code string) (*Coupon, error) + List func(opts *PagerOptions) Pager + Restore func(ctx context.Context, code string, c Coupon) (*Coupon, error) + Update func(ctx context.Context, code string, c Coupon) (*Coupon, error) + type CreditPayment struct + AccountCode string + Action string + AmountInCents int + AppliedToInvoice int + CreatedAt NullTime + Currency string + OriginalCreditPaymentUUID string + OriginalInvoiceNumber int + RefundTransactionUUID string + UUID string + UpdatedAt NullTime + VoidedAt NullTime + XMLName xml.Name + func (c *CreditPayment) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type CreditPaymentsService interface + Get func(ctx context.Context, uuid string) (*CreditPayment, error) + List func(opts *PagerOptions) Pager + ListAccount func(accountCode string, opts *PagerOptions) Pager + type CustomFields map[string]string + func (c *CustomFields) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + func (c CustomFields) MarshalXML(e *xml.Encoder, start xml.StartElement) error + type HTTPDoer interface + Do func(req *http.Request) (*http.Response, error) + type Invoice struct + AccountCode string + Address Address + AttemptNextCollectionAt NullTime + BalanceInCents int + ClosedAt NullTime + CollectionMethod string + CreatedAt NullTime + CreditPayments []CreditPayment + Currency string + CustomerNotes string + DiscountInCents int + DueOn NullTime + InvoiceNumber int + InvoiceNumberPrefix string + LineItems []Adjustment + NetTerms NullInt + Origin string + OriginalInvoiceNumber int + PONumber string + State string + SubtotalInCents int + TaxInCents int + TaxRate float64 + TaxRegion string + TaxType string + TermsAndConditions string + TotalInCents int + Transactions []Transaction + Type string + UUID string + UpdatedAt NullTime + VATNumber string + VatReverseChargeNotes string + XMLName xml.Name + func (i *Invoice) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type InvoiceCollection struct + ChargeInvoice *Invoice + CreditInvoices []Invoice + XMLName xml.Name + func (i *InvoiceCollection) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type InvoiceLineItemsRefund struct + LineItems []VoidLineItem + XMLName xml.Name + type InvoiceRefund struct + AmountInCents NullInt + CreditCustomerNotes string + Description string + ExternalRefund NullBool + PaymentMethod string + RefundMethod string + RefundedAt NullTime + XMLName xml.Name + type InvoicesService interface + Collect func(ctx context.Context, invoiceNumber int) (*Invoice, error) + Create func(ctx context.Context, accountCode string, invoice Invoice) (*Invoice, error) + Get func(ctx context.Context, invoiceNumber int) (*Invoice, error) + GetPDF func(ctx context.Context, invoiceNumber int, language string) (*bytes.Buffer, error) + List func(opts *PagerOptions) Pager + ListAccount func(accountCode string, opts *PagerOptions) Pager + MarkFailed func(ctx context.Context, invoiceNumber int) (*Invoice, error) + MarkPaid func(ctx context.Context, invoiceNumber int) (*Invoice, error) + Preview func(ctx context.Context, accountCode string) (*Invoice, error) + RecordPayment func(ctx context.Context, offlinePayment OfflinePayment) (*Transaction, error) + RefundVoidLineItems func(ctx context.Context, invoiceNumber int, refund InvoiceLineItemsRefund) (*Invoice, error) + RefundVoidOpenAmount func(ctx context.Context, invoiceNumber int, refund InvoiceRefund) (*Invoice, error) + VoidCreditInvoice func(ctx context.Context, invoiceNumber int) (*Invoice, error) + type NestedPlan struct + Code string + Name string + type NewSubscription struct + Account Account + AutoRenew bool + BankAccountAuthorizedAt NullTime + Bulk bool + CollectionMethod string + CouponCode string + Currency string + CustomFields *CustomFields + CustomerNotes string + GatewayCode string + ImportedTrial NullBool + NetTerms NullInt + NextBillDate NullTime + PONumber string + PlanCode string + Quantity int + RenewalBillingCycles NullInt + RevenueScheduleType string + ShippingAddress *ShippingAddress + ShippingAddressID int64 + ShippingAmountInCents NullInt + ShippingMethodCode string + StartsAt NullTime + SubscriptionAddOns *[]SubscriptionAddOn + TermsAndConditions string + TotalBillingCycles int + TrialEndsAt NullTime + UnitAmountInCents NullInt + VATReverseChargeNotes string + XMLName xml.Name + type Note struct + CreatedAt time.Time + Message string + XMLName xml.Name + type NullBool struct + func NewBool(b bool) NullBool + func NewBoolPtr(b *bool) NullBool + func (n *NullBool) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + func (n NullBool) Bool() bool + func (n NullBool) BoolPtr() *bool + func (n NullBool) Equal(v NullBool) bool + func (n NullBool) MarshalJSON() ([]byte, error) + func (n NullBool) MarshalXML(e *xml.Encoder, start xml.StartElement) error + func (n NullBool) Value() (value bool, ok bool) + type NullInt struct + func NewInt(i int) NullInt + func NewIntPtr(i *int) NullInt + func (n *NullInt) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + func (n NullInt) Equal(v NullInt) bool + func (n NullInt) Int() int + func (n NullInt) IntPtr() *int + func (n NullInt) MarshalJSON() ([]byte, error) + func (n NullInt) MarshalXML(e *xml.Encoder, start xml.StartElement) error + func (n NullInt) Value() (value int, ok bool) + type NullMarshal struct + func (nm NullMarshal) MarshalXML(e *xml.Encoder, start xml.StartElement) error + type NullTime struct + func NewTime(t time.Time) NullTime + func NewTimePtr(t *time.Time) NullTime + func (n *NullTime) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + func (n NullTime) Equal(v NullTime) bool + func (n NullTime) MarshalJSON() ([]byte, error) + func (n NullTime) MarshalXML(e *xml.Encoder, start xml.StartElement) error + func (n NullTime) String() string + func (n NullTime) Time() time.Time + func (n NullTime) TimePtr() *time.Time + func (n NullTime) Value() (value time.Time, ok bool) + type OfflinePayment struct + Amount int + CollectedAt NullTime + Description string + InvoiceNumber int + PaymentMethod string + XMLName xml.Name + type Pager interface + Count func(ctx context.Context) (int, error) + Fetch func(ctx context.Context, dst interface{}) error + FetchAll func(ctx context.Context, dst interface{}) error + Next func() bool + type PagerOptions struct + BeginTime NullTime + EndTime NullTime + Order string + PerPage int + Sort string + State string + Type string + type PendingSubscription struct + Plan NestedPlan + Quantity int + SubscriptionAddOns []SubscriptionAddOn + UnitAmountInCents int + XMLName xml.Name + type Plan struct + AccountingCode string + AutoRenew bool + BypassHostedConfirmation NullBool + CancelURL string + Code string + CreatedAt NullTime + Description string + DisplayDonationAmounts NullBool + DisplayPhoneNumber NullBool + DisplayQuantity NullBool + IntervalLength int + IntervalUnit string + Name string + PaymentPageTOSLink string + SetupFeeInCents UnitAmount + SuccessURL string + TaxCode string + TaxExempt NullBool + TotalBillingCycles NullInt + TrialIntervalLength int + TrialIntervalUnit string + UnitAmountInCents UnitAmount + UnitName string + XMLName xml.Name + type PlansService interface + Create func(ctx context.Context, p Plan) (*Plan, error) + Delete func(ctx context.Context, code string) error + Get func(ctx context.Context, code string) (*Plan, error) + List func(opts *PagerOptions) Pager + Update func(ctx context.Context, code string, p Plan) (*Plan, error) + type Purchase struct + Account Account + Adjustments []Adjustment + CollectionMethod string + CouponCodes []string + Currency string + CustomerNotes string + GatewayCode string + GiftCard string + NetTerms NullInt + PONumber string + ShippingAddressID int64 + ShippingFees *[]ShippingFee + Subscriptions []PurchaseSubscription + TermsAndConditions string + VATReverseChargeNotes string + XMLName xml.Name + type PurchaseSubscription struct + AutoRenew bool + CustomFields *CustomFields + NextBillDate NullTime + PlanCode string + Quantity int + RenewalBillingCycles NullInt + ShippingAddress *ShippingAddress + ShippingAddressID int64 + ShippingAmountInCents NullInt + ShippingMethodCode string + StartsAt NullTime + SubscriptionAddOns *[]SubscriptionAddOn + TotalBillingCycles int + TrialEndsAt NullTime + UnitAmountInCents NullInt + XMLName xml.Name + type PurchasesService interface + Authorize func(ctx context.Context, p Purchase) (*Purchase, error) + Cancel func(ctx context.Context, transactionUUID string) (*InvoiceCollection, error) + Capture func(ctx context.Context, transactionUUID string) (*InvoiceCollection, error) + Create func(ctx context.Context, p Purchase) (*InvoiceCollection, error) + Pending func(ctx context.Context, p Purchase) (*Purchase, error) + Preview func(ctx context.Context, p Purchase) (*InvoiceCollection, error) + type Rate struct + Limit int + Remaining int + Reset time.Time + type RateLimitError struct + Rate Rate + Response *http.Response + func (e *RateLimitError) Error() string + type Redemption struct + AccountCode string + CouponCode string + CreatedAt NullTime + Currency string + SingleUse bool + State string + SubscriptionUUID string + TotalDiscountedInCents int + UUID string + UpdatedAt NullTime + func (r *Redemption) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type RedemptionsService interface + Delete func(ctx context.Context, accountCode string) error + ListAccount func(accountCode string, opts *PagerOptions) Pager + ListInvoice func(invoiceNumber int, opts *PagerOptions) Pager + ListSubscription func(uuid string, opts *PagerOptions) Pager + Redeem func(ctx context.Context, code string, r CouponRedemption) (*Redemption, error) + type ServerError struct + Response *http.Response + func (e *ServerError) Error() string + type ShippingAddress struct + Address string + Address2 string + City string + Company string + Country string + CreatedAt NullTime + Email string + FirstName string + ID int64 + LastName string + Nickname string + Phone string + State string + UpdatedAt NullTime + VATNumber string + XMLName xml.Name + Zip string + type ShippingAddressesService interface + Create func(ctx context.Context, accountCode string, address ShippingAddress) (*ShippingAddress, error) + Delete func(ctx context.Context, accountCode string, shippingAddressID int) error + ListAccount func(accountCode string, opts *PagerOptions) Pager + Update func(ctx context.Context, accountCode string, shippingAddressID int, ...) (*ShippingAddress, error) + type ShippingFee struct + ShippingAmountInCents NullInt + ShippingMethodCode string + XMLName xml.Name + type ShippingMethod struct + AccountingCode string + Code string + CreatedAt NullTime + Name string + TaxCode string + UpdatedAt NullTime + XMLName xml.Name + type ShippingMethodsService interface + Get func(ctx context.Context, code string) (*ShippingMethod, error) + List func(opts *PagerOptions) Pager + type Subscription struct + AccountCode string + ActivatedAt NullTime + AutoRenew bool + CanceledAt NullTime + CollectionMethod string + Currency string + CurrentPeriodEndsAt NullTime + CurrentPeriodStartedAt NullTime + CurrentTermEndsAt NullTime + CurrentTermStartedAt NullTime + CustomFields *CustomFields + CustomerNotes string + ExpiresAt NullTime + GatewayCode string + InvoiceCollection *InvoiceCollection + InvoiceNumber int + NetTerms NullInt + PONumber string + PausedAt NullTime + PendingSubscription *PendingSubscription + Plan NestedPlan + Quantity int + RemainingBillingCycles NullInt + RemainingPauseCycles int + RenewalBillingCycles NullInt + ResumeAt NullTime + State string + SubscriptionAddOns []SubscriptionAddOn + TaxInCents int + TaxRate float64 + TaxRegion string + TaxType string + TotalAmountInCents int + TrialEndsAt NullTime + TrialStartedAt NullTime + UUID string + UnitAmountInCents int + XMLName xml.Name + func (s *Subscription) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type SubscriptionAddOn struct + Code string + Quantity int + Type string + UnitAmountInCents NullInt + XMLName xml.Name + type SubscriptionNotes struct + CustomFields *CustomFields + CustomerNotes string + GatewayCode string + TermsAndConditions string + VATReverseChargeNotes string + XMLName xml.Name + type SubscriptionsService interface + Cancel func(ctx context.Context, uuid string) (*Subscription, error) + Create func(ctx context.Context, sub NewSubscription) (*Subscription, error) + Get func(ctx context.Context, uuid string) (*Subscription, error) + List func(opts *PagerOptions) Pager + ListAccount func(accountCode string, opts *PagerOptions) Pager + Pause func(ctx context.Context, uuid string, cycles int) (*Subscription, error) + Postpone func(ctx context.Context, uuid string, dt time.Time, bulk bool) (*Subscription, error) + Preview func(ctx context.Context, sub NewSubscription) (*Subscription, error) + PreviewChange func(ctx context.Context, uuid string, sub UpdateSubscription) (*Subscription, error) + Reactivate func(ctx context.Context, uuid string) (*Subscription, error) + Resume func(ctx context.Context, uuid string) (*Subscription, error) + Terminate func(ctx context.Context, uuid string, refundType string) (*Subscription, error) + Update func(ctx context.Context, uuid string, sub UpdateSubscription) (*Subscription, error) + UpdateNotes func(ctx context.Context, uuid string, n SubscriptionNotes) (*Subscription, error) + type TaxDetail struct + Name string + TaxInCents int + TaxRate float64 + Type string + XMLName xml.Name + type TestServer struct + Invoked bool + func (s *TestServer) Close() + func (s *TestServer) HandleFunc(method string, pattern string, fn http.HandlerFunc, t *testing.T) + type Transaction struct + AVSResult AVSResult + AVSResultPostal string + AVSResultStreet string + Account Account + Action string + AmountInCents int + ApprovalCode string + CVVResult CVVResult + CreatedAt NullTime + Currency string + Description string + GatewayType string + IPAddress net.IP + InvoiceNumber int + Message string + Origin string + PaymentMethod string + ProductCode string + Recurring NullBool + Reference string + Refundable NullBool + Source string + Status string + TaxInCents int + Test bool + TransactionError *TransactionError + UUID string + Voidable NullBool + func (t *Transaction) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error + type TransactionError struct + CustomerMessage string + ErrorCategory string + ErrorCode string + GatewayErrorCode string + MerchantMessage string + XMLName xml.Name + type TransactionFailedError struct + Response *http.Response + Transaction *Transaction + TransactionError TransactionError + func (e *TransactionFailedError) Error() string + type Transactions []Transaction + func (t Transactions) Sort() + type TransactionsService interface + Get func(ctx context.Context, uuid string) (*Transaction, error) + List func(opts *PagerOptions) Pager + ListAccount func(accountCode string, opts *PagerOptions) Pager + type UnitAmount struct + AUD int + CAD int + EUR int + GBP int + USD int + func (u UnitAmount) MarshalXML(e *xml.Encoder, start xml.StartElement) error + type UpdateSubscription struct + AutoRenew NullBool + CollectionMethod string + CouponCode string + CustomFields *CustomFields + ImportedTrial NullBool + NetTerms NullInt + PONumber string + PlanCode string + Quantity int + RemainingBillingCycles NullInt + RenewalBillingCycles NullInt + RevenueScheduleType string + SubscriptionAddOns *[]SubscriptionAddOn + Timeframe string + UnitAmountInCents NullInt + XMLName xml.Name + type ValidationError struct + Description string + Field string + Symbol string + func (e *ValidationError) Error() string + type VoidLineItem struct + Prorate NullBool + Quantity int + UUID string + XMLName xml.Name Incompatible versions in this module v2.0.0+incompatible Oct 14, 2021