Documentation
¶
Index ¶
- Constants
- type Card
- type CardToken
- type CardTokenParams
- type Cardholder
- type Client
- type Error
- type ErrorCause
- type FeeDetail
- type FeeDetails
- type GetInstallmentsParams
- type Identification
- type IdentificationType
- type IdentificationTypes
- type Installment
- type Installments
- type Issuer
- type Issuers
- type Payer
- type Payment
- type PaymentMethod
- type PaymentMethods
- type PaymentParams
- type Phone
- type TestUser
- type TestUserParams
- type TransactionDetails
- type WebhookEvent
Constants ¶
View Source
const ( // The user has not yet completed the payment process. StatusPending = "pending" // The payment has been approved and accredited. StatusApproved = "approved" // The payment has been authorized but not captured yet. StatusAuthorized = "authorized" // Payment is being reviewed. StatusInProcess = "in_process" // Users have initiated a dispute. StatusInMediation = "in_mediation" // Payment was rejected. The user may retry payment. StatusRejected = "rejected" // Payment was cancelled by one of the parties or because time for payment has expired StatusCancelled = "cancelled" // Payment was refunded to the user. StatusRefunded = "refunded" // Was made a chargeback in the buyer’s credit card. StatusChargedBack = "charged_back" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Card ¶ added in v1.0.3
type Card struct { ID interface{} `json:"id"` FirstSixDigits string `json:"first_six_digits"` LastFourDigits string `json:"last_four_digits"` ExpirationMonth int `json:"expiration_month"` ExpirationYear int `json:"expiration_year"` DateCreated string `json:"date_created"` DateLastUpdated string `json:"date_last_updated"` Cardholder Cardholder `json:"cardholder"` }
type CardToken ¶
type CardToken struct { ID string `json:"id"` PublicKey string `json:"public_key"` Cardholder Cardholder `json:"cardholder"` Status string `json:"status"` DateCreated string `json:"date_created"` DateLastUpdated string `json:"date_last_updated"` DateDue string `json:"date_due"` LuhnValidation bool `json:"luhn_validation"` LiveMode bool `json:"live_mode"` RequireEsc bool `json:"require_esc"` }
CardToken contains the information for a token which represents a card
type CardTokenParams ¶
type CardTokenParams struct { ExpirationMonth int `json:"expiration_month"` ExpirationYear int `json:"expiration_year"` Cardholder Cardholder `json:"cardholder"` SecurityCode string `json:"security_code"` CardNumber string `json:"card_number"` }
CardTokenParams represent the params used to create or update a CardToken
type Cardholder ¶ added in v1.0.3
type Cardholder struct { Name string `json:"name"` Identification Identification `json:"identification"` }
type Client ¶
type Client interface { // NewCardToken creates a new CardToken NewCardToken(params CardTokenParams) (*CardToken, error) // GetIdentificationTypes returns all available identification types GetIdentificationTypes() (IdentificationTypes, error) // GetPaymentMethods returns all available payment methods GetPaymentMethods() (PaymentMethods, error) // GetPaymentMethodsForBin returns all available payment methods for the given bin GetPaymentMethodsForBin(bin string) (PaymentMethods, error) // GetInstallments returns all available installments for the given // payment method, amount and issuer GetInstallments(params GetInstallmentsParams) (Installments, error) // GetCardIssuers returns all available issuers for the given payment method GetCardIssuers(paymentMethodID string) (Issuers, error) // NewPayment creates a new Payment NewPayment(params PaymentParams) (*Payment, error) // NewTestUser creates a new test user NewTestUser(params TestUserParams) (*TestUser, error) }
Client is the api client
type Error ¶
type Error struct { Message string `json:"message"` ErrorCode string `json:"error"` Status int `json:"status"` Cause []ErrorCause `json:"cause"` }
Error represents an error returned by the api
type ErrorCause ¶
type ErrorCause struct { // int/string Code interface{} `json:"code"` Description string `json:"description"` Data interface{} `json:"data"` }
type FeeDetails ¶ added in v1.0.3
type FeeDetails []FeeDetail
type GetInstallmentsParams ¶
type Identification ¶
type IdentificationType ¶
type IdentificationTypes ¶
type IdentificationTypes []IdentificationType
type Installment ¶
type Installment struct { PaymentMethodID string `json:"payment_method_id"` PaymentTypeID string `json:"payment_type_id"` Issuer struct { ID string `json:"id"` Name string `json:"name"` SecureThumbnail string `json:"secure_thumbnail"` Thumbnail string `json:"thumbnail"` } `json:"issuer"` ProcessingMode string `json:"processing_mode"` MerchantAccountID interface{} `json:"merchant_account_id"` PayerCosts []struct { Installments int `json:"installments"` InstallmentRate int `json:"installment_rate"` DiscountRate int `json:"discount_rate"` ReimbursementRate interface{} `json:"reimbursement_rate"` Labels []interface{} `json:"labels"` InstallmentRateCollector []string `json:"installment_rate_collector"` MinAllowedAmount float64 `json:"min_allowed_amount"` MaxAllowedAmount float64 `json:"max_allowed_amount"` RecommendedMessage string `json:"recommended_message"` InstallmentAmount float64 `json:"installment_amount"` TotalAmount float64 `json:"total_amount"` PaymentMethodOptionID string `json:"payment_method_option_id"` } `json:"payer_costs"` Agreements interface{} `json:"agreements"` }
type Installments ¶
type Installments []Installment
type Payer ¶
type Payer struct { Email string `json:"email"` Identification Identification `json:"identification"` FirstName string `json:"first_name,omitempty"` LastName string `json:"last_name,omitempty"` Phone *Phone `json:"phone,omitempty"` Type string `json:"type,omitempty"` EntityType interface{} `json:"entity_type,omitempty"` ID interface{} `json:"id,omitempty"` }
type Payment ¶
type Payment struct { ID int `json:"id"` DateCreated string `json:"date_created"` DateApproved string `json:"date_approved"` DateLastUpdated string `json:"date_last_updated"` DateOfExpiration interface{} `json:"date_of_expiration"` MoneyReleaseDate string `json:"money_release_date"` OperationType string `json:"operation_type"` IssuerID string `json:"issuer_id"` PaymentMethodID string `json:"payment_method_id"` PaymentTypeID string `json:"payment_type_id"` Status string `json:"status"` StatusDetail string `json:"status_detail"` CurrencyID string `json:"currency_id"` Description string `json:"description"` LiveMode bool `json:"live_mode"` SponsorID interface{} `json:"sponsor_id"` AuthorizationCode interface{} `json:"authorization_code"` MoneyReleaseSchema interface{} `json:"money_release_schema"` TaxesAmount float64 `json:"taxes_amount"` CounterCurrency interface{} `json:"counter_currency"` ShippingAmount float64 `json:"shipping_amount"` PosID interface{} `json:"pos_id"` StoreID interface{} `json:"store_id"` CollectorID int `json:"collector_id"` Payer Payer `json:"payer"` Metadata struct{} `json:"metadata"` AdditionalInfo interface{} `json:"additional_info"` Order struct{} `json:"order"` ExternalReference string `json:"external_reference"` TransactionAmount float64 `json:"transaction_amount"` TransactionAmountRefunded float64 `json:"transaction_amount_refunded"` CouponAmount float64 `json:"coupon_amount"` DifferentialPricingID interface{} `json:"differential_pricing_id"` DeductionSchema interface{} `json:"deduction_schema"` TransactionDetails TransactionDetails `json:"transaction_details"` FeeDetails FeeDetails `json:"fee_details"` Captured bool `json:"captured"` BinaryMode bool `json:"binary_mode"` CallForAuthorizeID interface{} `json:"call_for_authorize_id"` StatementDescriptor string `json:"statement_descriptor"` Installments int `json:"installments"` Card Card `json:"card"` NotificationURL string `json:"notification_url"` Refunds []interface{} `json:"refunds"` ProcessingMode string `json:"processing_mode"` MerchantAccountID interface{} `json:"merchant_account_id"` Acquirer interface{} `json:"acquirer"` MerchantNumber interface{} `json:"merchant_number"` AcquirerReconciliation []interface{} `json:"acquirer_reconciliation"` }
type PaymentMethod ¶
type PaymentMethod struct { ID string `json:"id"` Name string `json:"name"` PaymentTypeID string `json:"payment_type_id"` Status string `json:"status"` SecureThumbnail string `json:"secure_thumbnail"` Thumbnail string `json:"thumbnail"` DeferredCapture string `json:"deferred_capture"` Settings []struct { CardNumber struct { Validation string `json:"validation"` Length int `json:"length"` } `json:"card_number"` Bin struct { Pattern string `json:"pattern"` InstallmentsPattern string `json:"installments_pattern"` ExclusionPattern string `json:"exclusion_pattern"` } `json:"bin"` SecurityCode struct { Length int `json:"length"` CardLocation string `json:"card_location"` Mode string `json:"mode"` } `json:"security_code"` } `json:"settings"` AdditionalInfoNeeded []string `json:"additional_info_needed"` MinAllowedAmount float64 `json:"min_allowed_amount"` MaxAllowedAmount float64 `json:"max_allowed_amount"` AccreditationTime int `json:"accreditation_time"` FinancialInstitutions []struct { ID string `json:"id"` Description string `json:"description"` } `json:"financial_institutions"` ProcessingModes []string `json:"processing_modes"` // from the search response only PayerCosts []struct { InstallmentRate int `json:"installment_rate"` DiscountRate int `json:"discount_rate"` MinAllowedAmount float64 `json:"min_allowed_amount"` Labels []interface{} `json:"labels"` Installments int `json:"installments"` ReimbursementRate interface{} `json:"reimbursement_rate"` MaxAllowedAmount float64 `json:"max_allowed_amount"` PaymentMethodOptionID string `json:"payment_method_option_id"` } `json:"payer_costs"` Issuer struct { Default bool `json:"default"` Name string `json:"name"` ID int `json:"id"` } `json:"issuer"` TotalFinancialCost interface{} `json:"total_financial_cost"` MinAccreditationDays int `json:"min_accreditation_days"` MaxAccreditationDays int `json:"max_accreditation_days"` MerchantAccountID interface{} `json:"merchant_account_id"` Bins []interface{} `json:"bins"` Marketplace string `json:"marketplace"` Agreements []interface{} `json:"agreements"` Labels []string `json:"labels"` FinancingDeals struct { Legals interface{} `json:"legals"` Installments interface{} `json:"installments"` ExpirationDate interface{} `json:"expiration_date"` StartDate interface{} `json:"start_date"` Status string `json:"status"` } `json:"financing_deals"` SiteID string `json:"site_id"` ProcessingMode string `json:"processing_mode"` }
type PaymentMethods ¶
type PaymentMethods []PaymentMethod
type PaymentParams ¶
type PaymentParams struct { TransactionAmount float64 `json:"transaction_amount"` PaymentMethodID string `json:"payment_method_id"` Payer Payer `json:"payer"` Token string `json:"token"` Description string `json:"description"` Installments int `json:"installments"` NotificationURL string `json:"notification_url,omitempty"` SponsorID interface{} `json:"sponsor_id"` BinaryMode bool `json:"binary_mode"` ExternalReference string `json:"external_reference"` StatementDescriptor string `json:"statement_descriptor"` AdditionalInfo interface{} `json:"additional_info"` }
type TestUserParams ¶
type TestUserParams struct {
SiteID string `json:"site_id"`
}
type TransactionDetails ¶ added in v1.0.3
type TransactionDetails struct { PaymentMethodReferenceID interface{} `json:"payment_method_reference_id"` NetReceivedAmount float64 `json:"net_received_amount"` TotalPaidAmount float64 `json:"total_paid_amount"` OverpaidAmount float64 `json:"overpaid_amount"` ExternalResourceURL interface{} `json:"external_resource_url"` InstallmentAmount float64 `json:"installment_amount"` FinancialInstitution interface{} `json:"financial_institution"` PayableDeferralPeriod interface{} `json:"payable_deferral_period"` AcquirerReference interface{} `json:"acquirer_reference"` }
type WebhookEvent ¶ added in v1.0.4
Click to show internal directories.
Click to hide internal directories.