diff --git a/payment.go b/payment.go index 3e5b4f3..de7c99d 100644 --- a/payment.go +++ b/payment.go @@ -35,27 +35,30 @@ type AuthoriseEncrypted struct { ShopperName *Name `json:"shopperName,omitempty"` SelectedRecurringDetailReference string `json:"selectedRecurringDetailReference,omitempty"` BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` // Required for a 3DS process + CaptureDelayHours *int `json:"captureDelayHours,omitempty"` } // Authorise structure for Authorisation request (card is not encrypted) // // Link - https://docs.adyen.com/developers/api-reference/payments-api#paymentrequest type Authorise struct { - Card *Card `json:"card,omitempty"` - Amount *Amount `json:"amount"` - BillingAddress *Address `json:"billingAddress,omitempty"` - DeliveryAddress *Address `json:"deliveryAddress,omitempty"` - Reference string `json:"reference"` - MerchantAccount string `json:"merchantAccount"` - ShopperReference string `json:"shopperReference,omitempty"` // Mandatory for recurring payment - Recurring *Recurring `json:"recurring,omitempty"` - ShopperEmail string `json:"shopperEmail,omitempty"` - ShopperInteraction string `json:"shopperInteraction,omitempty"` - ShopperIP string `json:"shopperIP,omitempty"` - ShopperLocale string `json:"shopperLocale,omitempty"` - ShopperName *Name `json:"shopperName,omitempty"` - SelectedRecurringDetailReference string `json:"selectedRecurringDetailReference,omitempty"` - BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` // Required for a 3DS process + AdditionalData *AdditionalData `json:"additionalData,omitempty"` + Card *Card `json:"card,omitempty"` + Amount *Amount `json:"amount"` + BillingAddress *Address `json:"billingAddress,omitempty"` + DeliveryAddress *Address `json:"deliveryAddress,omitempty"` + Reference string `json:"reference"` + MerchantAccount string `json:"merchantAccount"` + ShopperReference string `json:"shopperReference,omitempty"` // Mandatory for recurring payment + Recurring *Recurring `json:"recurring,omitempty"` + ShopperEmail string `json:"shopperEmail,omitempty"` + ShopperInteraction string `json:"shopperInteraction,omitempty"` + ShopperIP string `json:"shopperIP,omitempty"` + ShopperLocale string `json:"shopperLocale,omitempty"` + ShopperName *Name `json:"shopperName,omitempty"` + SelectedRecurringDetailReference string `json:"selectedRecurringDetailReference,omitempty"` + BrowserInfo *BrowserInfo `json:"browserInfo,omitempty"` // Required for a 3DS process + CaptureDelayHours *int `json:"captureDelayHours,omitempty"` } // AuthoriseResponse is a response structure for Adyen @@ -74,10 +77,21 @@ type AuthoriseResponse struct { // AdditionalData stores encrypted information about customer's credit card type AdditionalData struct { - Content string `json:"card.encrypted.json,omitempty"` - AliasType string `json:"aliasType,omitempty"` - Alias string `json:"alias,omitempty"` - ExecuteThreeD *StringBool `json:"executeThreeD,omitempty"` + Content string `json:"card.encrypted.json,omitempty"` + AliasType string `json:"aliasType,omitempty"` + Alias string `json:"alias,omitempty"` + ExpiryDate string `json:"expiryDate,omitempty"` + CardBin string `json:"cardBin,omitempty"` + CardSummary string `json:"cardSummary,omitempty"` + CardHolderName string `json:"cardHolderName,omitempty"` + PaymentMethod string `json:"paymentMethod,omitempty"` + CardPaymentMethod string `json:"cardPaymentMethod,omitempty"` + CardIssuingCountry string `json:"cardIssuingCountry,omitempty"` + RecurringDetailReference string `json:"recurring.recurringDetailReference,omitempty"` + ExecuteThreeD *StringBool `json:"executeThreeD,omitempty"` + FundingSource string `json:"fundingSource,omitempty"` + CustomRoutingFlag string `json:"customRoutingFlag,omitempty"` + RequestedTestAcquirerResponseCode int `json:"RequestedTestAcquirerResponseCode,omitempty"` //Used for trigger error from adyen } // BrowserInfo hold information on the user browser