Skip to content

Commit

Permalink
Update Payment Response with last properties (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
armando-rodriguez-cko authored May 30, 2024
1 parent e5ef57f commit 43088ec
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 50 deletions.
68 changes: 36 additions & 32 deletions payments/nas/payments.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
47 changes: 29 additions & 18 deletions payments/payments.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 43088ec

Please sign in to comment.