From 43088ec9bfef70de7932fb89629b3353d07b05c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20Rodr=C3=ADguez?= <127134616+armando-rodriguez-cko@users.noreply.github.com> Date: Thu, 30 May 2024 11:43:42 +0200 Subject: [PATCH] Update Payment Response with last properties (#116) --- payments/nas/payments.go | 68 +++++++++++++++++++++------------------- payments/payments.go | 47 ++++++++++++++++----------- 2 files changed, 65 insertions(+), 50 deletions(-) diff --git a/payments/nas/payments.go b/payments/nas/payments.go index a16b5e6..3cb5185 100644 --- a/payments/nas/payments.go +++ b/payments/nas/payments.go @@ -187,38 +187,42 @@ type ( } GetPaymentResponse struct { - HttpMetadata common.HttpMetadata - Id string `json:"id,omitempty"` - RequestedOn *time.Time `json:"requested_on,omitempty"` - Source *SourceResponse `json:"source,omitempty"` - Destination *DestinationResponse `json:"destination,omitempty"` - Sender *SenderResponse `json:"sender,omitempty"` - Amount int64 `json:"amount,omitempty"` - Currency common.Currency `json:"currency,omitempty"` - PaymentType payments.PaymentType `json:"payment_type,omitempty"` - Reference string `json:"reference,omitempty"` - Description string `json:"description,omitempty"` - Approved bool `json:"approved,omitempty"` - ExpiresOn *time.Time `json:"expires_on,omitempty"` - Status payments.PaymentStatus `json:"status,omitempty"` - Balances *PaymentResponseBalances `json:"balances,omitempty"` - ThreeDs *payments.ThreeDsData `json:"3ds,omitempty"` - Risk *payments.RiskAssessment `json:"risk,omitempty"` - Customer *common.CustomerResponse `json:"customer,omitempty"` - BillingDescriptor *payments.BillingDescriptor `json:"billing_descriptor,omitempty"` - ShippingDetails *payments.ShippingDetails `json:"shipping,omitempty"` - PaymentIp string `json:"payment_ip,omitempty"` - Marketplace *common.MarketplaceData `json:"marketplace,omitempty"` - AmountAllocations []common.AmountAllocations `json:"amount_allocations,omitempty"` - Recipient *payments.PaymentRecipient `json:"recipient,omitempty"` - ProcessingData *payments.ProcessingData `json:"processing,omitempty"` - Items []payments.Product `json:"items,omitempty"` - Metadata map[string]interface{} `json:"metadata,omitempty"` - Eci string `json:"eci,omitempty"` - SchemeId string `json:"scheme_id,omitempty"` - Actions []payments.PaymentActionSummary `json:"actions,omitempty"` - ProcessedOn *time.Time `json:"processed_on,omitempty"` - Links map[string]common.Link `json:"_links"` + HttpMetadata common.HttpMetadata + Id string `json:"id,omitempty"` + RequestedOn *time.Time `json:"requested_on,omitempty"` + Source *SourceResponse `json:"source,omitempty"` + Destination *DestinationResponse `json:"destination,omitempty"` + Sender *SenderResponse `json:"sender,omitempty"` + Amount int64 `json:"amount,omitempty"` + Currency common.Currency `json:"currency,omitempty"` + PaymentType payments.PaymentType `json:"payment_type,omitempty"` + Reference string `json:"reference,omitempty"` + Description string `json:"description,omitempty"` + Approved bool `json:"approved,omitempty"` + ExpiresOn *time.Time `json:"expires_on,omitempty"` + Status payments.PaymentStatus `json:"status,omitempty"` + Balances *PaymentResponseBalances `json:"balances,omitempty"` + ThreeDs *payments.ThreeDsData `json:"3ds,omitempty"` + Risk *payments.RiskAssessment `json:"risk,omitempty"` + Customer *common.CustomerResponse `json:"customer,omitempty"` + BillingDescriptor *payments.BillingDescriptor `json:"billing_descriptor,omitempty"` + ShippingDetails *payments.ShippingDetails `json:"shipping,omitempty"` + PaymentIp string `json:"payment_ip,omitempty"` + Marketplace *common.MarketplaceData `json:"marketplace,omitempty"` + AmountAllocations []common.AmountAllocations `json:"amount_allocations,omitempty"` + Recipient *payments.PaymentRecipient `json:"recipient,omitempty"` + ProcessingData *payments.ProcessingData `json:"processing,omitempty"` + Items []payments.Product `json:"items,omitempty"` + Metadata map[string]interface{} `json:"metadata,omitempty"` + Eci string `json:"eci,omitempty"` + SchemeId string `json:"scheme_id,omitempty"` + Actions []payments.PaymentActionSummary `json:"actions,omitempty"` + Retry *payments.PaymentRetryResponse `json:"retry,omitempty"` + PanTypeProcessed payments.PanProcessedType `json:"pan_type_processed,omitempty"` + CkoNetworkTokenAvailable bool `json:"cko_network_token_available,omitempty"` + ProcessedOn *time.Time `json:"processed_on,omitempty"` + Instruction *PaymentInstruction `json:"instruction,omitempty"` + Links map[string]common.Link `json:"_links"` } GetPaymentActionsResponse struct { diff --git a/payments/payments.go b/payments/payments.go index 1681582..22d0781 100644 --- a/payments/payments.go +++ b/payments/payments.go @@ -164,6 +164,13 @@ const ( OtherAddress PaymentContextsShippingMethod = "OtherAddress" ) +type PanProcessedType string + +const ( + FPAN PanProcessedType = "fpan" + DPAN PanProcessedType = "dpan" +) + type ( AirlineData struct { Ticket *Ticket `json:"ticket,omitempty"` @@ -328,24 +335,28 @@ type ( } PaymentProcessing struct { - RetrievalReferenceNumber string `json:"retrieval_reference_number,omitempty"` - AcquirerTransactionId string `json:"acquirer_transaction_id,omitempty"` - RecommendationCode string `json:"recommendation_code,omitempty"` - Scheme string `json:"scheme,omitempty"` - PartnerMerchantAdviceCode string `json:"partner_merchant_advice_code,omitempty"` - PartnerResponseCode string `json:"partner_response_code,omitempty"` - PartnerOrderId string `json:"partner_order_id,omitempty"` - PartnerSessionId string `json:"partner_session_id,omitempty"` - PartnerClientToken string `json:"partner_client_token,omitempty"` - PartnerPaymentId string `json:"partner_payment_id,omitempty"` - ContinuationPayload string `json:"continuation_payload,omitempty"` - Pun string `json:"pun,omitempty"` - PartnerStatus string `json:"partner_status,omitempty"` - PartnerTransactionId string `json:"partner_transaction_id,omitempty"` - PartnerErrorCodes []string `json:"partner_error_codes,omitempty"` - PartnerErrorMessage string `json:"partner_error_message,omitempty"` - PartnerAuthorizationCode string `json:"partner_authorization_code,omitempty"` - PartnerAuthorizationResponseCode string `json:"partner_authorization_response_code,omitempty"` + RetrievalReferenceNumber string `json:"retrieval_reference_number,omitempty"` + AcquirerTransactionId string `json:"acquirer_transaction_id,omitempty"` + RecommendationCode string `json:"recommendation_code,omitempty"` + Scheme string `json:"scheme,omitempty"` + PartnerMerchantAdviceCode string `json:"partner_merchant_advice_code,omitempty"` + PartnerResponseCode string `json:"partner_response_code,omitempty"` + PartnerOrderId string `json:"partner_order_id,omitempty"` + PartnerSessionId string `json:"partner_session_id,omitempty"` + PartnerClientToken string `json:"partner_client_token,omitempty"` + PartnerPaymentId string `json:"partner_payment_id,omitempty"` + PanTypeProcessed PanProcessedType `json:"pan_type_processed,omitempty"` + ContinuationPayload string `json:"continuation_payload,omitempty"` + Pun string `json:"pun,omitempty"` + PartnerStatus string `json:"partner_status,omitempty"` + PartnerTransactionId string `json:"partner_transaction_id,omitempty"` + PartnerErrorCodes []string `json:"partner_error_codes,omitempty"` + PartnerErrorMessage string `json:"partner_error_message,omitempty"` + PartnerAuthorizationCode string `json:"partner_authorization_code,omitempty"` + PartnerAuthorizationResponseCode string `json:"partner_authorization_response_code,omitempty"` + SurchargeAmount int64 `json:"surcharge_amount,omitempty"` + CkoNetworkTokenAvailable bool `json:"cko_network_token_available"` + MerchantCategoryCode string `json:"merchant_category_code,omitempty"` } PaymentRetryResponse struct {