Skip to content

Commit

Permalink
Change Card ExpireMonth / ExpirteYear / Cvc to string type to better …
Browse files Browse the repository at this point in the history
…fit Adyen structure

Create RecurringDetail struct and add it to RecurringDetailsResult, use of existing Card struct
  • Loading branch information
lbailly committed Oct 3, 2017
1 parent c4995df commit 03a216c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 24 deletions.
6 changes: 3 additions & 3 deletions card.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package adyen
// Card structure representation
type Card struct {
Number string `json:"number"`
ExpireMonth int `json:"expiryMonth"`
ExpireYear int `json:"expiryYear"`
Cvc int `json:"cvc"`
ExpireMonth string `json:"expiryMonth"`
ExpireYear string `json:"expiryYear"`
Cvc string `json:"cvc"`
HolderName string `json:"holderName"`
}
39 changes: 18 additions & 21 deletions recurring.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,25 @@ type RecurringDetailsRequest struct {
type RecurringDetailsResult struct {
CreationDate string `json:"creationDate"`
Details []struct {
RecurringDetail struct {
Acquirer string `json:"acquirer"`
AcquirerAccount string `json:"acquirerAccount"`
AdditionalData struct {
CardBin string `json:"cardBin"`
} `json:"additionalData"`
Alias string `json:"alias"`
AliasType string `json:"aliasType"`
Card struct {
ExpiryMonth string `json:"expiryMonth"`
ExpiryYear string `json:"expiryYear"`
HolderName string `json:"holderName"`
Number string `json:"number"`
} `json:"card"`
ContractTypes []string `json:"contractTypes"`
CreationDate string `json:"creationDate"`
FirstPspReference string `json:"firstPspReference"`
PaymentMethodVariant string `json:"paymentMethodVariant"`
RecurringDetailReference string `json:"recurringDetailReference"`
Variant string `json:"variant"`
} `json:"RecurringDetail"`
RecurringDetail RecurringDetail `json:"RecurringDetail"`
} `json:"details"`
InvalidOneclickContracts string `json:"invalidOneclickContracts"`
ShopperReference string `json:"shopperReference"`
}

type RecurringDetail struct {
Acquirer string `json:"acquirer"`
AcquirerAccount string `json:"acquirerAccount"`
AdditionalData struct {
CardBin string `json:"cardBin"`
} `json:"additionalData"`
Alias string `json:"alias"`
AliasType string `json:"aliasType"`
Card Card `json:"card,omitempty"`
ContractTypes []string `json:"contractTypes"`
CreationDate string `json:"creationDate"`
FirstPspReference string `json:"firstPspReference"`
PaymentMethodVariant string `json:"paymentMethodVariant"`
RecurringDetailReference string `json:"recurringDetailReference"`
Variant string `json:"variant"`
}

0 comments on commit 03a216c

Please sign in to comment.