diff --git a/pkg/payment/request.go b/pkg/payment/request.go index be02ff4..afe96d9 100644 --- a/pkg/payment/request.go +++ b/pkg/payment/request.go @@ -10,6 +10,7 @@ type Request struct { MerchantServices *MerchantServicesRequest `json:"merchant_services,omitempty"` Order *OrderRequest `json:"order,omitempty"` Payer *PayerRequest `json:"payer,omitempty"` + ForwardData *ForwardDataRequest `json:"forward_data,omitempty"` TransactionDetails *TransactionDetailsRequest `json:"transaction_details,omitempty"` PointOfInteraction *PointOfInteractionRequest `json:"point_of_interaction,omitempty"` PaymentMethod *PaymentMethodRequest `json:"payment_method,omitempty"` @@ -177,6 +178,29 @@ type PayerRequest struct { EntityType string `json:"entity_type,omitempty"` } +// ForwardData represents data used in special conditions for the payment. +type ForwardDataRequest struct { + SubMerchant *SubMerchantRequest `json:"sub_merchant,omitempty"` +} + +// SubMerchantRequest represents sub merchant request within ForwardDataRequest. +type SubMerchantRequest struct { + SubMerchantId string `json:"sub_merchant_id,omitempty"` + MCC string `json:"mcc,omitempty"` + Country string `json:"country,omitempty"` + AddressDoorNumber int `json:"address_door_number,omitempty"` + ZIP string `json:"zip,omitempty"` + DocumentNumber string `json:"document_number,omitempty"` + City string `json:"city,omitempty"` + AddressStreet string `json:"address_street,omitempty"` + LegalName string `json:"legal_name,omitempty"` + RegionCodeIso string `json:"region_code_iso,omitempty"` + RegionCode string `json:"region_code,omitempty"` + DocumentType string `json:"document_type,omitempty"` + Phone string `json:"phone,omitempty"` + URL string `json:"url,omitempty"` +} + // AddressRequest represents payer address request within PayerRequest. type AddressRequest struct { Neighborhood string `json:"neighborhood,omitempty"` diff --git a/pkg/payment/response.go b/pkg/payment/response.go index e2d90e1..cf1afbe 100644 --- a/pkg/payment/response.go +++ b/pkg/payment/response.go @@ -7,6 +7,7 @@ import ( // Response is the response from the Payments API. type Response struct { Payer PayerResponse `json:"payer"` + ForwardData ForwardDataResponse `json:"forward_data,omitempty"` AdditionalInfo AdditionalInfoResponse `json:"additional_info"` Order OrderResponse `json:"order"` TransactionDetails TransactionDetailsResponse `json:"transaction_details"` @@ -81,6 +82,27 @@ type PayerResponse struct { EntityType string `json:"entity_type"` } +type ForwardDataResponse struct { + SubMerchant SubMerchantResponse `json:"sub_merchant,omitempty"` +} + +type SubMerchantResponse struct { + SubMerchantId string `json:"sub_merchant_id,omitempty"` + MCC string `json:"mcc,omitempty"` + Country string `json:"country,omitempty"` + AddressDoorNumber string `json:"address_door_number,omitempty"` + ZIP string `json:"zip,omitempty"` + DocumentNumber string `json:"document_number,omitempty"` + City string `json:"city,omitempty"` + AddressStreet string `json:"address_street,omitempty"` + LegalName string `json:"legal_name,omitempty"` + RegionCodeIso string `json:"region_code_iso,omitempty"` + RegionCode string `json:"region_code,omitempty"` + DocumentType string `json:"document_type,omitempty"` + Phone string `json:"phone,omitempty"` + URL string `json:"url,omitempty"` +} + // IdentificationResponse represents payer's personal identification. type IdentificationResponse struct { Type string `json:"type"`