diff --git a/card.go b/card.go index 3312517..84e80c5 100644 --- a/card.go +++ b/card.go @@ -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"` } diff --git a/recurring.go b/recurring.go index a791a30..197d046 100644 --- a/recurring.go +++ b/recurring.go @@ -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"` +}