Documentation
¶
Index ¶
- Constants
- func SetLogger(l Logger)
- type Address
- type Amount
- type AmountDetails
- type BillingAddress
- type BillingInfo
- type Buyer
- type Client
- func (this *Client) BuildAPI(paths ...string) string
- func (this *Client) CreatePayment(payment *Payment) (result *Payment, err error)
- func (this *Client) CreateWebExperienceProfile(param *WebProfiles) (result *WebProfiles, err error)
- func (this *Client) CreateWebhook(callBackURL string, eventTypeList ...string) (result *Webhook, err error)
- func (this *Client) DeleteCreditCard(creditCardId string) (err error)
- func (this *Client) DeleteWebExperienceProfile(profileId string) (err error)
- func (this *Client) DeleteWebhook(webhookId string) (err error)
- func (this *Client) ExecuteApprovedPayment(paymentId, payerId string) (result *Payment, err error)
- func (this *Client) ExpressCreatePayment(invoiceNumber, total, currency, cancelURL, returnURL string) (result *Payment, err error)
- func (this *Client) GetAccessToken() (token *Token, err error)
- func (this *Client) GetCreditCardDetails(creditCardId string) (result *CreditCard, err error)
- func (this *Client) GetCreditCardList(param *CreditCardListParam) (result *CreditCardList, err error)
- func (this *Client) GetDisputeDetails(disputeId string) (result *Dispute, err error)
- func (this *Client) GetDisputeList(param *DisputeListParam) (result *DisputeList, err error)
- func (this *Client) GetPaymentDetails(paymentId string) (result *Payment, err error)
- func (this *Client) GetPaymentList(param *PaymentListParam) (result *PaymentList, err error)
- func (this *Client) GetRefundDetails(refundId string) (result *Refund, err error)
- func (this *Client) GetSaleDetails(saleId string) (result *Sale, err error)
- func (this *Client) GetWebExperienceProfileDetails(profileId string) (result *WebProfiles, err error)
- func (this *Client) GetWebExperienceProfileList() (result []*WebProfiles, err error)
- func (this *Client) GetWebhookDetails(webhookId string) (result *Webhook, err error)
- func (this *Client) GetWebhookEvent(webhookId string, req *http.Request) (event *Event, err error)
- func (this *Client) GetWebhookList() (result *WebhookList, err error)
- func (this *Client) RefundSale(saleId string, param *RefundSaleParam) (result *Refund, err error)
- func (this *Client) StoreCreditCard(param *CreditCard) (result *CreditCard, err error)
- func (this *Client) UpdateWebExperienceProfiles(profileId string, param *WebProfiles) (err error)
- type Cost
- type CreditCard
- type CreditCardList
- type CreditCardListParam
- type CreditCardToken
- type Currency
- type CustomAmount
- type Dispute
- type DisputeList
- type DisputeListParam
- type DisputeOutcome
- type DisputeStatus
- type DisputedTransaction
- type DisputedTransactionItem
- type ErrorDetail
- type Event
- type EventType
- type FMFDetails
- type FileAttachment
- type FundingInstrument
- type IdentityError
- type Invoice
- type InvoiceItem
- type Item
- type ItemList
- type Link
- type Logger
- type MerchantInfo
- type Message
- type Metadata
- type Participant
- type Payee
- type Payer
- type PayerInfo
- type Payment
- type PaymentDetail
- type PaymentHoldReason
- type PaymentIntent
- type PaymentList
- type PaymentListParam
- type PaymentMethod
- type PaymentOptions
- type PaymentState
- type PaymentSummary
- type PaymentTerm
- type Phone
- type ProcessorResponse
- type RedirectURLs
- type Refund
- type RefundDetail
- type RefundSaleParam
- type RefundState
- type RelatedResources
- type ResourceType
- type ResponseError
- type Sale
- type SaleState
- type Seller
- type ShippingAddress
- type ShippingCost
- type ShippingInfo
- type Tax
- type Token
- type Transaction
- type WebProfiles
- type WebProfilesFlowConfig
- type WebProfilesInputFields
- type WebProfilesPresentation
- type Webhook
- type WebhookList
Constants ¶
const ( ErrTypeValidation = "VALIDATION_ERROR" ErrTypeInstrumentDeclined = "INSTRUMENT_DECLINED" ErrTypePaymentAlreadyDone = "PAYMENT_ALREADY_DONE" )
const ( EventTypePaymentSaleCompleted = "PAYMENT.SALE.COMPLETED" EventTypePaymentSaleDenied = "PAYMENT.SALE.DENIED" EventTypePaymentSalePending = "PAYMENT.SALE.PENDING" // 退款成功 EventTypePaymentSaleRefunded = "PAYMENT.SALE.REFUNDED" EventTypePaymentSaleReversed = "PAYMENT.SALE.REVERSED" // 用户从 paypal 网站申请退款 EventTypeCustomerDisputeCreated = "CUSTOMER.DISPUTE.CREATED" EventTypeCustomerDisputeResolved = "CUSTOMER.DISPUTE.RESOLVED" EventTypeCustomerDisputeUpdated = "CUSTOMER.DISPUTE.UPDATED" )
https://developer.paypal.com/docs/integration/direct/webhooks/event-names/
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Address ¶
type Address struct { Line1 string `json:"line1,omitempty"` Line2 string `json:"line2,omitempty"` City string `json:"city,omitempty"` State string `json:"state,omitempty"` PostalCode string `json:"postal_code,omitempty"` CountryCode string `json:"country_code,omitempty"` Phone string `json:"phone,omitempty"` }
type Amount ¶
type Amount struct { Total string `json:"total,omitempty"` // required Currency string `json:"currency,omitempty"` // required Details *AmountDetails `json:"details,omitempty"` }
type AmountDetails ¶
type AmountDetails struct { Subtotal string `json:"subtotal,omitempty"` Shipping string `json:"shipping,omitempty"` Tax string `json:"tax,omitempty"` HandlingFee string `json:"handling_fee,omitempty"` ShippingDiscount string `json:"shipping_discount,omitempty"` Insurance string `json:"insurance,omitempty"` GiftWrap string `json:"gift_wrap,omitempty"` }
type BillingAddress ¶
type BillingAddress struct { Line1 string `json:"line1,omitempty"` Line2 string `json:"line2,omitempty"` City string `json:"city,omitempty"` State string `json:"state,omitempty"` CountryCode string `json:"country_code,omitempty"` PostalCode string `json:"postal_code,omitempty"` Phone string `json:"phone,omitempty"` NormalizationStatus string `json:"normalization_status,omitempty"` Status string `json:"status,omitempty"` Type string `json:"type,omitempty"` }
type BillingInfo ¶
type BillingInfo struct { Email string `json:"email,omitempty"` Phone *Phone `json:"phone,omitempty"` BusinessName string `json:"business_name,omitempty"` FirstName string `json:"first_name,omitempty"` LastName string `json:"last_name,omitempty"` Address *Address `json:"address,omitempty"` Language string `json:"language,omitempty"` }
type Client ¶
func (*Client) CreatePayment ¶
CreatePayment https://developer.paypal.com/docs/api/payments/#payment 因为接口返回的 payment 数据只比提交的 payment 数据多了几个字段,所以本接口的参数和返回结果共用同一数据结构。
func (*Client) CreateWebExperienceProfile ¶
func (this *Client) CreateWebExperienceProfile(param *WebProfiles) (result *WebProfiles, err error)
CreateWebExperienceProfile https://developer.paypal.com/docs/api/payment-experience/#web-profile
func (*Client) CreateWebhook ¶
func (this *Client) CreateWebhook(callBackURL string, eventTypeList ...string) (result *Webhook, err error)
CreateWebhook https://developer.paypal.com/docs/api/webhooks/#webhooks_create
func (*Client) DeleteCreditCard ¶
DeleteCreditCard https://developer.paypal.com/docs/api/vault/#credit-cards_delete
func (*Client) DeleteWebExperienceProfile ¶
DeleteWebExperienceProfile https://developer.paypal.com/docs/api/payment-experience/#web-profiles_delete
func (*Client) DeleteWebhook ¶
DeleteWebhook https://developer.paypal.com/docs/api/webhooks/#webhooks_delete
func (*Client) ExecuteApprovedPayment ¶
ExecuteApprovedPayment https://developer.paypal.com/docs/api/payments/#payment_execute 从回调 URL 中获取 PayerId
func (*Client) ExpressCreatePayment ¶
func (*Client) GetAccessToken ¶
func (*Client) GetCreditCardDetails ¶
func (this *Client) GetCreditCardDetails(creditCardId string) (result *CreditCard, err error)
GetCreditCardDetails https://developer.paypal.com/docs/api/vault/#credit-cards_delete
func (*Client) GetCreditCardList ¶
func (this *Client) GetCreditCardList(param *CreditCardListParam) (result *CreditCardList, err error)
GetCreditCardList https://developer.paypal.com/docs/api/vault/#credit-cards_list
func (*Client) GetDisputeDetails ¶
GetDisputeDetails https://developer.paypal.com/docs/api/customer-disputes/#disputes_get-dispute
func (*Client) GetDisputeList ¶
func (this *Client) GetDisputeList(param *DisputeListParam) (result *DisputeList, err error)
GetDisputeList https://developer.paypal.com/docs/api/customer-disputes/#disputes_get-disputes
func (*Client) GetPaymentDetails ¶
GetPaymentDetails https://developer.paypal.com/docs/api/payments/#payment_get
func (*Client) GetPaymentList ¶
func (this *Client) GetPaymentList(param *PaymentListParam) (result *PaymentList, err error)
GetPaymentList https://developer.paypal.com/docs/api/payments/#payment_list
func (*Client) GetRefundDetails ¶
GetRefundDetails https://developer.paypal.com/docs/api/payments/#refund_get
func (*Client) GetSaleDetails ¶
GetSaleDetails https://developer.paypal.com/docs/api/payments/#sale_get
func (*Client) GetWebExperienceProfileDetails ¶
func (this *Client) GetWebExperienceProfileDetails(profileId string) (result *WebProfiles, err error)
GetWebExperienceProfileDetails https://developer.paypal.com/docs/api/payment-experience/#web-profiles_get
func (*Client) GetWebExperienceProfileList ¶
func (this *Client) GetWebExperienceProfileList() (result []*WebProfiles, err error)
GetWebExperienceProfileList https://developer.paypal.com/docs/api/payment-experience/#web-profiles_get-list
func (*Client) GetWebhookDetails ¶
GetWebhookDetails https://developer.paypal.com/docs/api/webhooks/#webhooks_get
func (*Client) GetWebhookEvent ¶
GetWebhookEvent 用于处理 webbook 回调
func (*Client) GetWebhookList ¶
func (this *Client) GetWebhookList() (result *WebhookList, err error)
GetWebhookList https://developer.paypal.com/docs/api/webhooks/#webhooks_get-all
func (*Client) RefundSale ¶
func (this *Client) RefundSale(saleId string, param *RefundSaleParam) (result *Refund, err error)
RefundSale https://developer.paypal.com/docs/api/payments/#sale_refund
func (*Client) StoreCreditCard ¶
func (this *Client) StoreCreditCard(param *CreditCard) (result *CreditCard, err error)
StoreCreditCard https://developer.paypal.com/docs/api/vault/#credit-cards_create
func (*Client) UpdateWebExperienceProfiles ¶
func (this *Client) UpdateWebExperienceProfiles(profileId string, param *WebProfiles) (err error)
UpdateWebExperienceProfiles https://developer.paypal.com/docs/api/payment-experience/#web-profiles_update
type CreditCard ¶
type CreditCard struct { // Request body Number string `json:"number,omitempty"` // required Type string `json:"type,omitempty"` // required ExpireMonth string `json:"expire_month,omitempty"` // required ExpireYear string `json:"expire_year,omitempty"` // required BillingAddress *BillingAddress `json:"billing_address,omitempty"` // required FirstName string `json:"first_name,omitempty"` LastName string `json:"last_name,omitempty"` ExternalCustomerId string `json:"external_customer_id,omitempty"` MerchantId string `json:"merchant_id,omitempty"` PayerId string `json:"payer_id,omitempty"` ExternalCardId string `json:"external_card_id,omitempty"` Id string `json:"id,omitempty"` State string `json:"state,omitempty"` CreateTime string `json:"create_time,omitempty"` UpdateTime string `json:"update_time,omitempty"` ValidUntil string `json:"valid_until,omitempty"` Links []*Link `json:"links,omitempty"` }
type CreditCardList ¶
type CreditCardList struct { Items []*CreditCard `json:"items,omitempty"` TotalItems int `json:"total_items,omitempty"` TotalPages int `json:"total_pages,omitempty"` Links []*Link `json:"links,omitempty"` }
type CreditCardListParam ¶
type CreditCardListParam struct { PageSize int Page int StartTime string EndTime string SortOrder string SortBy string MerchantId string ExternalCardId string ExternalCustomerId string TotalRequired bool }
func (*CreditCardListParam) QueryString ¶
func (this *CreditCardListParam) QueryString() string
type CreditCardToken ¶
type CreditCardToken struct { CreditCardId string `json:"credit_card_id,omitempty"` // required PayerId string `json:"payer_id,omitempty"` Last4 string `json:"last4,omitempty"` Type string `json:"type,omitempty"` ExpireMonth string `json:"expire_month,omitempty"` ExpireYear string `json:"expire_year,omitempty"` }
type CustomAmount ¶
type Dispute ¶
type Dispute struct { DisputeId string `json:"dispute_id,omitempty"` CreateTime string `json:"create_time,omitempty"` UpdateTime string `json:"update_time,omitempty"` DisputedTransactions []*DisputedTransaction `json:"disputed_transactions,omitempty"` Reason string `json:"reason,omitempty"` Status DisputeStatus `json:"status,omitempty"` DisputeAmount *Currency `json:"dispute_amount,omitempty"` DisputeOutcome *DisputeOutcome `json:"dispute_outcome,omitempty"` Messages []*Message `json:"messages,omitempty"` SellerResponseDueDate string `json:"seller_response_due_date,omitempty"` Links []*Link `json:"links,omitempty"` }
type DisputeList ¶
type DisputeListParam ¶
type DisputeListParam struct { StartTime string DisputedTransactionId string PageSize int NextPageToken string DisputeState string }
func (*DisputeListParam) QueryString ¶
func (this *DisputeListParam) QueryString() string
type DisputeOutcome ¶
type DisputeStatus ¶
type DisputeStatus string
const ( DisputeStatusOpen DisputeStatus = "OPEN" DisputeStatusWaitingForBuyerResponse DisputeStatus = "WAITING_FOR_BUYER_RESPONSE" DisputeStatusWaitingForSellerResponse DisputeStatus = "WAITING_FOR_SELLER_RESPONSE" DisputeStatusUnderReview DisputeStatus = "UNDER_REVIEW" DisputeStatusResolved DisputeStatus = "RESOLVED" DisputeStatusOther DisputeStatus = "OTHER" )
type DisputedTransaction ¶
type DisputedTransaction struct { BuyerTransactionId string `json:"buyer_transaction_id,omitempty"` SellerTransactionId string `json:"seller_transaction_id,omitempty"` CreateTime string `json:"create_time,omitempty"` TransactionStatus string `json:"transaction_status,omitempty"` GrossAmount *Currency `json:"gross_amount,omitempty"` InvoiceNumber string `json:"invoice_number,omitempty"` Custom string `json:"custom,omitempty"` Buyer *Buyer `json:"buyer,omitempty"` Seller *Seller `json:"seller,omitempty"` Items []*DisputedTransactionItem `json:"items,omitempty"` SellerProtectionEligible bool `json:"seller_protection_eligible,omitempty"` }
type DisputedTransactionItem ¶
type ErrorDetail ¶
type Event ¶
type Event struct { Id string `json:"id"` CreateTime string `json:"create_time,omitempty"` ResourceType ResourceType `json:"resource_type,omitempty"` EventVersion string `json:"event_version,omitempty"` EventType string `json:"event_type,omitempty"` Summary string `json:"summary,omitempty"` Resource interface{} `json:"resource,omitempty"` Status string `json:"status,omitempty"` Links []*Link `json:"links,omitempty"` }
type FMFDetails ¶
type FileAttachment ¶
type FundingInstrument ¶
type FundingInstrument struct { CreditCard *CreditCard `json:"credit_card,omitempty"` CreditCardToken *CreditCardToken `json:"credit_card_token,omitempty"` }
type IdentityError ¶
type IdentityError struct { Response *http.Response `json:"-"` Name string `json:"error"` ErrorDescription string `json:"error_description"` }
func (*IdentityError) Error ¶
func (this *IdentityError) Error() string
type Invoice ¶
type Invoice struct { Id string `json:"id,omitempty"` Number string `json:"number,omitempty"` URI string `json:"uri,omitempty"` Status string `json:"status,omitempty"` TemplateId string `json:"template_id,omitempty"` MerchantInfo *MerchantInfo `json:"merchant_info,omitempty"` BillingInfo []*BillingInfo `json:"billing_info,omitempty"` ShippingInfo *ShippingInfo `json:"shipping_info,omitempty"` CCInfo *Participant `json:"cc_info,omitempty"` Items []*InvoiceItem `json:"items,omitempty"` InvoiceDate string `json:"invoice_date,omitempty"` PaymentTerm *PaymentTerm `json:"payment_term,omitempty"` Reference string `json:"reference,omitempty"` Discount *Cost `json:"discount,omitempty"` ShippingCost *ShippingCost `json:"shipping_cost,omitempty"` Custom *CustomAmount `json:"custom,omitempty"` AllowPartialPayment bool `json:"allow_partial_payment,omitempty"` MinimumAmountDue *Currency `json:"minimum_amount_due,omitempty"` TaxCalculatedAfterDiscount bool `json:"tax_calculated_after_discount,omitempty"` TaxInclusive bool `json:"tax_inclusive,omitempty"` Terms string `json:"terms,omitempty"` Note string `json:"note,omitempty"` MerchantMemo string `json:"merchant_memo,omitempty"` LogoURL string `json:"logo_url,omitempty"` TotalAmount *Currency `json:"total_amount,omitempty"` Payments []*PaymentDetail `json:"payments,omitempty"` Refunds []*RefundDetail `json:"refunds,omitempty"` Metadata *Metadata `json:"metadata,omitempty"` PaidAmount *PaymentSummary `json:"paid_amount,omitempty"` RefundedAmount *PaymentSummary `json:"refunded_amount,omitempty"` Attachments []*FileAttachment `json:"attachments,omitempty"` AllowTip bool `json:"allow_tip,omitempty"` Links []*Link `json:"links,omitempty"` }
type InvoiceItem ¶
type InvoiceItem struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Quantity int `json:"quantity,omitempty"` UnitPrice *Currency `json:"unit_price,omitempty"` Tax *Tax `json:"tax,omitempty"` Date string `json:"date,omitempty"` Discount *Cost `json:"discount,omitempty"` UnitOfMeasure string `json:"unit_of_measure,omitempty"` }
type Item ¶
type Item struct { Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Quantity interface{} `json:"quantity,omitempty"` // string or int Price string `json:"price,omitempty"` Tax string `json:"tax,omitempty"` SKU string `json:"sku,omitempty"` Currency string `json:"currency,omitempty"` }
type ItemList ¶
type ItemList struct { Items []*Item `json:"items,omitempty"` ShippingAddress *ShippingAddress `json:"shipping_address,omitempty"` ShippingMethod string `json:"shipping_method,omitempty"` ShippingPhoneNumber string `json:"shipping_phone_number,omitempty"` }
type MerchantInfo ¶
type MerchantInfo struct { Email string `json:"email,omitempty"` BusinessName string `json:"business_name,omitempty"` FirstName string `json:"first_name,omitempty"` LastName string `json:"last_name,omitempty"` Phone *Phone `json:"phone,omitempty"` Fax *Phone `json:"fax,omitempty"` Address *Address `json:"address,omitempty"` Website string `json:"website,omitempty"` TaxId string `json:"tax_id,omitempty"` AdditionalInfo string `json:"additional_info,omitempty"` }
type Metadata ¶
type Metadata struct { CreatedDate string `json:"created_date,omitempty"` CreatedBy string `json:"created_by,omitempty"` CancelledDate string `json:"cancelled_date,omitempty"` CancelledBy string `json:"cancelled_by,omitempty"` LastUpdatedDate string `json:"last_updated_date,omitempty"` LastUpdatedBy string `json:"last_updated_by,omitempty"` FirstSentDate string `json:"first_sent_date,omitempty"` LastSentDate string `json:"last_sent_date,omitempty"` LastSentBy string `json:"last_sent_by,omitempty"` PayerViewURL string `json:"payer_view_url,omitempty"` }
type Participant ¶
type Participant struct {
Email string `json:"email,omitempty"`
}
type Payer ¶
type Payer struct { PaymentMethod PaymentMethod `json:"payment_method,omitempty"` Status string `json:"status,omitempty"` PayerInfo *PayerInfo `json:"payer_info,omitempty"` FundingInstrument *FundingInstrument `json:"funding_instrument,omitempty"` }
type PayerInfo ¶
type PayerInfo struct { Email string `json:"email,omitempty"` Salutation string `json:"salutation,omitempty"` FirstName string `json:"first_name,omitempty"` MiddleName string `json:"middle_name,omitempty"` LastName string `json:"last_name,omitempty"` Suffix string `json:"suffix,omitempty"` PayerId string `json:"payer_id,omitempty"` Phone string `json:"phone,omitempty"` PhoneType string `json:"phone_type,omitempty"` BirthDate string `json:"birth_date,omitempty"` TaxId string `json:"tax_id,omitempty"` TaxIdType string `json:"tax_id_type,omitempty"` CountryCode string `json:"country_code,omitempty"` BillingAddress *BillingAddress `json:"billing_address,omitempty"` ShippingAddress *ShippingAddress `json:"shipping_address,omitempty"` }
type Payment ¶
type Payment struct { // Request body Intent PaymentIntent `json:"intent,omitempty"` // required Payer *Payer `json:"payer,omitempty"` // required Transactions []*Transaction `json:"transactions,omitempty"` // required ExperienceProfileId string `json:"experience_profile_id,omitempty"` NoteToPayer string `json:"note_to_payer,omitempty"` RedirectURLs *RedirectURLs `json:"redirect_urls"` // 返回结果添加的字段 Id string `json:"id,omitempty"` CreateTime string `json:"create_time,omitempty"` State PaymentState `json:"state,omitempty"` FailureReason string `json:"failure_reason,omitempty"` UpdateTime string `json:"update_time,omitempty"` Links []*Link `json:"links,omitempty"` }
type PaymentDetail ¶
type PaymentDetail struct { Type string `json:"type,omitempty"` TransactionId string `json:"transaction_id,omitempty"` TransactionType string `json:"transaction_type,omitempty"` Date string `json:"date,omitempty"` Method string `json:"method,omitempty"` Note string `json:"note,omitempty"` Amount *Currency `json:"amount,omitempty"` }
type PaymentHoldReason ¶
type PaymentHoldReason struct {
PaymentHoldReason string `json:"payment_hold_reason,omitempty"`
}
type PaymentIntent ¶
type PaymentIntent string
const ( PaymentIntentSale PaymentIntent = "sale" PaymentIntentAuthorize PaymentIntent = "authorize" PaymentIntentOrder PaymentIntent = "order" )
type PaymentList ¶
type PaymentListParam ¶
type PaymentListParam struct { Count int StartId string StartIndex int StartTime string EndTime string SortBy string SortOrder string }
func (*PaymentListParam) QueryString ¶
func (this *PaymentListParam) QueryString() string
type PaymentMethod ¶
type PaymentMethod string
const ( PaymentMethodPayPal PaymentMethod = "paypal" PaymentMethodCreditCard PaymentMethod = "credit_card" )
type PaymentOptions ¶
type PaymentOptions struct {
AllowedPaymentMethod string `json:"allowed_payment_method,omitempty"`
}
type PaymentState ¶
type PaymentState string
const ( PaymentStateCreated PaymentState = "created" PaymentStateApproved PaymentState = "approved" PaymentStateFailed PaymentState = "failed" )
type PaymentSummary ¶
type PaymentTerm ¶
type ProcessorResponse ¶
type ProcessorResponse struct { ResponseCode string `json:"response_code,omitempty"` AVSCode string `json:"avs_code,omitempty"` CVVCode string `json:"cvv_code,omitempty"` AdviceCode string `json:"advice_code,omitempty"` ECISubmitted string `json:"eci_submitted,omitempty"` Vpas string `json:"vpas,omitempty"` }
type RedirectURLs ¶
type Refund ¶
type Refund struct { Id string `json:"id,omitempty"` Amount *Amount `json:"amount,omitempty"` State RefundState `json:"state,omitempty"` Reason string `json:"reason,omitempty"` RefundReasonCode string `json:"refund_reason_code,omitempty"` InvoiceNumber string `json:"invoice_number,omitempty"` SaleId string `json:"sale_id,omitempty"` CaptureId string `json:"capture_id,omitempty"` ParentPayment string `json:"parent_payment,omitempty"` Description string `json:"description,omitempty"` CreateTime string `json:"create_time,omitempty"` UpdateTime string `json:"update_time,omitempty"` Custom string `json:"custom,omitempty"` RefundToPayer *Currency `json:"refund_to_payer,omitempty"` Links []*Link `json:"links,omitempty,omitempty"` }
type RefundDetail ¶
type RefundSaleParam ¶
type RefundState ¶
type RefundState string
const ( RefundStatePending RefundState = "pending" RefundStateCompleted RefundState = "completed" RefundStateCancelled RefundState = "cancelled" RefundStateFailed RefundState = "failed" )
type RelatedResources ¶
type ResourceType ¶
type ResourceType string
const ( EventResourceTypeInvoices ResourceType = "invoices" EventResourceTypeSale ResourceType = "sale" EventResourceTypeRefund ResourceType = "refund" EventResourceTypeDispute ResourceType = "dispute" )
type ResponseError ¶
type ResponseError struct { Response *http.Response `json:"-"` Name string `json:"name"` Message string `json:"message"` InformationLink string `json:"information_link"` DebugId string `json:"debug_id"` Details []ErrorDetail `json:"details"` }
func (*ResponseError) Error ¶
func (this *ResponseError) Error() string
type Sale ¶
type Sale struct { Id string `json:"id,omitempty"` PurchaseUnitReferenceId string `json:"purchase_unit_reference_id,omitempty"` Amount *Amount `json:"amount,omitempty"` PaymentMode string `json:"payment_mode,omitempty"` State SaleState `json:"state,omitempty"` ReasonCode string `json:"reason_code,omitempty"` ProtectionEligibility string `json:"protection_eligibility,omitempty"` ProtectionEligibilityType string `json:"protection_eligibility_type,omitempty"` ClearingTime string `json:"clearing_time,omitempty"` PaymentHoldStatus string `json:"payment_hold_status,omitempty"` PaymentHoldReasons []PaymentHoldReason `json:"payment_hold_reasons,omitempty"` TransactionFee *Currency `json:"transaction_fee,omitempty"` ReceivableAmount *Currency `json:"receivable_amount,omitempty"` ExchangeRate string `json:"exchange_rate,omitempty"` FMFDetails *FMFDetails `json:"fmf_details,omitempty"` ReceiptId string `json:"receipt_id,omitempty"` ParentPayment string `json:"parent_payment,omitempty"` ProcessorResponse *ProcessorResponse `json:"processor_response,omitempty"` BillingAgreementId string `json:"billing_agreement_id,omitempty"` CreateTime string `json:"create_time,omitempty"` UpdateTime string `json:"update_time,omitempty"` Links []*Link `json:"links,omitempty,omitempty"` InvoiceNumber string `json:"invoice_number,omitempty"` Custom string `json:"custom,omitempty"` SoftDescriptor string `json:"soft_descriptor,omitempty"` }
type ShippingAddress ¶
type ShippingAddress struct { RecipientName string `json:"recipient_name,omitempty"` Line1 string `json:"line1,omitempty"` Line2 string `json:"line2,omitempty"` City string `json:"city,omitempty"` CountryCode string `json:"country_code,omitempty"` PostalCode string `json:"postal_code,omitempty"` Phone string `json:"phone,omitempty"` State string `json:"state,omitempty"` }
type ShippingCost ¶
type ShippingInfo ¶
type Transaction ¶
type Transaction struct { ReferenceId string `json:"reference_id,omitempty"` Amount *Amount `json:"amount,omitempty"` // required Payee *Payee `json:"payee,omitempty"` Description string `json:"description,omitempty"` NoteToPayee string `json:"note_to_payee,omitempty"` Custom string `json:"custom,omitempty"` InvoiceNumber string `json:"invoice_number,omitempty"` PurchaseOrder string `json:"purchase_order,omitempty"` SoftDescriptor string `json:"soft_descriptor,omitempty"` PaymentOptions *PaymentOptions `json:"payment_options,omitempty"` ItemList *ItemList `json:"item_list,omitempty"` NotifyURL string `json:"notify_url,omitempty"` OrderURL string `json:"order_url,omitempty"` // 返回结果添加的字段 RelatedResources []*RelatedResources `json:"related_resources,omitempty"` }
type WebProfiles ¶
type WebProfiles struct { // Request body Name string `json:"name,omitempty"` // required Temporary bool `json:"temporary,omitempty"` Presentation *WebProfilesPresentation `json:"presentation,omitempty"` InputFields *WebProfilesInputFields `json:"input_fields,omitempty"` FlowConfig *WebProfilesFlowConfig `json:"flow_config,omitempty"` Id string `json:"id,omitempty"` }
type WebProfilesFlowConfig ¶
type WebProfilesInputFields ¶
type WebProfilesPresentation ¶
type WebhookList ¶
type WebhookList struct {
Webhooks []*Webhook `json:"webhooks,omitempty"`
}