Skip to content

Commit

Permalink
Update Payment Link Request. Update Card Metadata Response (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
armando-rodriguez-cko authored Oct 17, 2024
1 parent 3d8e101 commit a0e4ed9
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 50 deletions.
14 changes: 5 additions & 9 deletions common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,10 @@ const (
type ChallengeIndicator string

const (
ChallengeRequested ChallengeIndicator = "challenge_requested"
ChallengeRequestedMandate ChallengeIndicator = "challenge_requested_mandate"
ChallengeIndicatorDataShare ChallengeIndicator = "data_share"
ChallengeIndicatorLowValue ChallengeIndicator = "low_value"
NoChallengeRequested ChallengeIndicator = "no_challenge_requested"
NoPreference ChallengeIndicator = "no_preference"
ChallengeIndicatorTransactionRiskAssessment ChallengeIndicator = "transaction_risk_assessment"
ChallengeIndicatorTrustedListing ChallengeIndicator = "trusted_listing"
ChallengeIndicatorTrustedListingPrompt ChallengeIndicator = "trusted_listing_prompt"
ChallengeRequested ChallengeIndicator = "challenge_requested"
ChallengeRequestedMandate ChallengeIndicator = "challenge_requested_mandate"
NoChallengeRequested ChallengeIndicator = "no_challenge_requested"
NoPreference ChallengeIndicator = "no_preference"
)

type DocumentType string
Expand Down Expand Up @@ -105,6 +100,7 @@ const (
ThreeDsOutage Exemption = "3ds_outage"
TransactionRiskAssessment Exemption = "transaction_risk_assessment"
TrustedListing Exemption = "trusted_listing"
TrustedListingPrompt Exemption = "trusted_listing_prompt"
)

type ThreeDsMethodCompletion string
Expand Down
52 changes: 33 additions & 19 deletions metadata/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,31 +67,45 @@ type (
}

SchemeMetadata struct {
Accel *PinlessDebitSchemeMetadata `json:"accel,omitempty"`
Pulse *PinlessDebitSchemeMetadata `json:"pulse,omitempty"`
Nyce *PinlessDebitSchemeMetadata `json:"nyce,omitempty"`
Star *PinlessDebitSchemeMetadata `json:"star,omitempty"`
Accel []PinlessDebitSchemeMetadata `json:"accel,omitempty"`
Pulse []PinlessDebitSchemeMetadata `json:"pulse,omitempty"`
Nyce []PinlessDebitSchemeMetadata `json:"nyce,omitempty"`
Star []PinlessDebitSchemeMetadata `json:"star,omitempty"`
}

PullFunds struct {
CrossBorder bool `json:"cross_border,omitempty"`
Domestic bool `json:"domestic,omitempty"`
}

AftIndicator struct {
PullFunds *PullFunds `json:"pull_funds,omitempty"`
}

AccountFundingTransaction struct {
AftIndicator *AftIndicator `json:"aft_indicator,omitempty"`
}

CardMetadataResponse struct {
HttpMetadata common.HttpMetadata `json:"http_metadata,omitempty"`
Bin string `json:"bin,omitempty"`
Scheme string `json:"scheme,omitempty"`
// Deprecated: This property will be removed in the future, and should not be used. Use LocalSchemes instead.
SchemeLocal SchemeLocalType `json:"scheme_local,omitempty"`
LocalSchemes []SchemeLocalType `json:"local_schemes,omitempty"`
CardType common.CardType `json:"card_type,omitempty"`
CardCategory common.CardCategory `json:"card_category,omitempty"`
Currency common.Currency `json:"currency,omitempty"`
Issuer string `json:"issuer,omitempty"`
IssuerCountry common.Country `json:"issuer_country,omitempty"`
IssuerCountryName string `json:"issuer_country_name,omitempty"`
ProductId string `json:"product_id,omitempty"`
ProductType string `json:"product_type,omitempty"`
SubproductId string `json:"subproduct_id,omitempty"`
RegulatedIndicator bool `json:"regulated_indicator,omitempty"`
RegulatedType string `json:"regulated_type,omitempty"`
CardPayouts *CardMetadataPayouts `json:"card_payouts,omitempty"`
SchemeMetadata *SchemeMetadata `json:"scheme_metadata,omitempty"`
SchemeLocal SchemeLocalType `json:"scheme_local,omitempty"`
LocalSchemes []SchemeLocalType `json:"local_schemes,omitempty"`
CardType common.CardType `json:"card_type,omitempty"`
CardCategory common.CardCategory `json:"card_category,omitempty"`
Currency common.Currency `json:"currency,omitempty"`
Issuer string `json:"issuer,omitempty"`
IssuerCountry common.Country `json:"issuer_country,omitempty"`
IssuerCountryName string `json:"issuer_country_name,omitempty"`
ProductId string `json:"product_id,omitempty"`
ProductType string `json:"product_type,omitempty"`
SubproductId string `json:"subproduct_id,omitempty"`
RegulatedIndicator bool `json:"regulated_indicator,omitempty"`
RegulatedType string `json:"regulated_type,omitempty"`
CardPayouts *CardMetadataPayouts `json:"card_payouts,omitempty"`
SchemeMetadata *SchemeMetadata `json:"scheme_metadata,omitempty"`
AccountFundingTransaction *AccountFundingTransaction `json:"account_funding_transaction,omitempty"`
}
)
49 changes: 27 additions & 22 deletions payments/links/links.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/checkout/checkout-sdk-go/common"
"github.com/checkout/checkout-sdk-go/payments"
"github.com/checkout/checkout-sdk-go/payments/nas"
)

const PaymentLinksPath = "payment-links"
Expand All @@ -19,28 +20,32 @@ const (

type (
PaymentLinkRequest struct {
Amount int `json:"amount,omitempty"`
Currency common.Currency `json:"currency,omitempty"`
PaymentType payments.PaymentType `json:"payment_type,omitempty,omitempty"`
PaymentIp string `json:"payment_ip,omitempty"`
BillingDescriptor *payments.BillingDescriptor `json:"billing_descriptor,omitempty"`
Reference string `json:"reference,omitempty"`
Description string `json:"description,omitempty"`
ExpiresIn int `json:"expires_in,omitempty"`
Customer *common.CustomerRequest `json:"customer,omitempty"`
Shipping *payments.ShippingDetails `json:"shipping,omitempty"`
Billing *payments.BillingInformation `json:"billing,omitempty"`
Recipient *payments.PaymentRecipient `json:"recipient,omitempty"`
Processing *payments.ProcessingSettings `json:"processing,omitempty"`
AllowPaymentMethods []payments.SourceType `json:"allow_payment_methods,omitempty"`
Products []payments.Product `json:"products,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
ThreeDs *payments.ThreeDsRequest `json:"3ds,omitempty"`
Risk *payments.RiskRequest `json:"risk,omitempty"`
ReturnUrl string `json:"return_url,omitempty"`
Locale string `json:"locale,omitempty"`
Capture bool `json:"capture,omitempty"`
CaptureOn *time.Time `json:"capture_on,omitempty"`
Amount int `json:"amount,omitempty"`
Currency common.Currency `json:"currency,omitempty"`
PaymentType payments.PaymentType `json:"payment_type,omitempty,omitempty"`
PaymentIp string `json:"payment_ip,omitempty"`
BillingDescriptor *payments.BillingDescriptor `json:"billing_descriptor,omitempty"`
Reference string `json:"reference,omitempty"`
Description string `json:"description,omitempty"`
DisplayName string `json:"display_name,omitempty"`
ExpiresIn int `json:"expires_in,omitempty"`
Customer *common.CustomerRequest `json:"customer,omitempty"`
Shipping *payments.ShippingDetails `json:"shipping,omitempty"`
Billing *payments.BillingInformation `json:"billing,omitempty"`
Recipient *payments.PaymentRecipient `json:"recipient,omitempty"`
Processing *payments.ProcessingSettings `json:"processing,omitempty"`
AllowPaymentMethods []payments.SourceType `json:"allow_payment_methods,omitempty"`
DisabledPaymentMethods []payments.SourceType `json:"disabled_payment_methods,omitempty"`
Products []payments.Product `json:"products,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
ThreeDs *payments.ThreeDsRequest `json:"3ds,omitempty"`
Risk *payments.RiskRequest `json:"risk,omitempty"`
CustomerRetry *payments.PaymentRetryRequest `json:"customer_retry,omitempty"`
Sender *nas.Sender `json:"sender,omitempty"`
ReturnUrl string `json:"return_url,omitempty"`
Locale string `json:"locale,omitempty"`
Capture bool `json:"capture,omitempty"`
CaptureOn *time.Time `json:"capture_on,omitempty"`
//Not available on previous
ProcessingChannelId string `json:"processing_channel_id,omitempty"`
AmountAllocations []common.AmountAllocations `json:"amount_allocations,omitempty"`
Expand Down

0 comments on commit a0e4ed9

Please sign in to comment.