mirror of
https://github.com/plutov/paypal.git
synced 2025-02-02 15:10:36 +01:00
Add types to support Partner Referral API (#123)
* Add types to support Partner Referral API Add in the type structs to allow a POST call to v2/customer/partner-referrals It sends a ReferralRequest, and returns a response of type Resource with only Links populated https://developer.paypal.com/docs/api/partner-referrals/v2/ * Pointer for optional field * Update types.go Co-Authored-By: Roopak Venkatakrishnan <roopak.v@gmail.com>
This commit is contained in:
parent
c865af7932
commit
bffc96851f
58
types.go
58
types.go
|
@ -87,6 +87,32 @@ const (
|
||||||
EventMerchantPartnerConsentRevoked string = "MERCHANT.PARTNER-CONSENT.REVOKED"
|
EventMerchantPartnerConsentRevoked string = "MERCHANT.PARTNER-CONSENT.REVOKED"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
OperationAPIIntegration string = "API_INTEGRATION"
|
||||||
|
ProductExpressCheckout string = "EXPRESS_CHECKOUT"
|
||||||
|
IntegrationMethodPayPal string = "PAYPAL"
|
||||||
|
IntegrationTypeThirdParty string = "THIRD_PARTY"
|
||||||
|
ConsentShareData string = "SHARE_DATA_CONSENT"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
FeaturePayment string = "PAYMENT"
|
||||||
|
FeatureRefund string = "REFUND"
|
||||||
|
FeatureFuturePayment string = "FUTURE_PAYMENT"
|
||||||
|
FeatureDirectPayment string = "DIRECT_PAYMENT"
|
||||||
|
FeaturePartnerFee string = "PARTNER_FEE"
|
||||||
|
FeatureDelayFunds string = "DELAY_FUNDS_DISBURSEMENT"
|
||||||
|
FeatureReadSellerDispute string = "READ_SELLER_DISPUTE"
|
||||||
|
FeatureUpdateSellerDispute string = "UPDATE_SELLER_DISPUTE"
|
||||||
|
FeatureDisputeReadBuyer string = "DISPUTE_READ_BUYER"
|
||||||
|
FeatureUpdateCustomerDispute string = "UPDATE_CUSTOMER_DISPUTES"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
LinkRelSelf string = "self"
|
||||||
|
LinkRelActionURL string = "action_url"
|
||||||
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
// JSONTime overrides MarshalJson method to format in ISO8601
|
// JSONTime overrides MarshalJson method to format in ISO8601
|
||||||
JSONTime time.Time
|
JSONTime time.Time
|
||||||
|
@ -411,6 +437,7 @@ type (
|
||||||
Href string `json:"href"`
|
Href string `json:"href"`
|
||||||
Rel string `json:"rel,omitempty"`
|
Rel string `json:"rel,omitempty"`
|
||||||
Method string `json:"method,omitempty"`
|
Method string `json:"method,omitempty"`
|
||||||
|
Description string `json:"description,omitempty"`
|
||||||
Enctype string `json:"enctype,omitempty"`
|
Enctype string `json:"enctype,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -908,6 +935,37 @@ type (
|
||||||
NetAmount PurchaseUnitAmount `json:"net_amount"`
|
NetAmount PurchaseUnitAmount `json:"net_amount"`
|
||||||
TotalRefundedAmount *PurchaseUnitAmount `json:"total_refunded_amount,omitempty"`
|
TotalRefundedAmount *PurchaseUnitAmount `json:"total_refunded_amount,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReferralRequest struct {
|
||||||
|
TrackingID string `json:"tracking_id"`
|
||||||
|
Operations []Operation `json:"operations,omitempty"`
|
||||||
|
Products []string `json:"products,omitempty"`
|
||||||
|
LegalConsents []Consent `json:"legal_consents,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
Operation struct {
|
||||||
|
Operation string `json:"operation"`
|
||||||
|
APIIntegrationPreference *IntegrationDetails `json:"api_integration_preference,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
IntegrationDetails struct {
|
||||||
|
RestAPIIntegration *RestAPIIntegration `json:"rest_api_integration,omitempty"`
|
||||||
|
}
|
||||||
|
|
||||||
|
RestAPIIntegration struct {
|
||||||
|
IntegrationMethod string `json:"integration_method"`
|
||||||
|
IntegrationType string `json:"integration_type"`
|
||||||
|
ThirdPartyDetails ThirdPartyDetails `json:"third_party_details"`
|
||||||
|
}
|
||||||
|
|
||||||
|
ThirdPartyDetails struct {
|
||||||
|
Features []string `json:"features"`
|
||||||
|
}
|
||||||
|
|
||||||
|
Consent struct {
|
||||||
|
Type string `json:"type"`
|
||||||
|
Granted bool `json:"granted"`
|
||||||
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
// Error method implementation for ErrorResponse struct
|
// Error method implementation for ErrorResponse struct
|
||||||
|
|
Loading…
Reference in New Issue
Block a user