Skip to content

Commit

Permalink
Merge pull request #78 from hfajunakaliantiga/Add-payload
Browse files Browse the repository at this point in the history
Add several missing parameter according to adyen docs
  • Loading branch information
zhutik authored Aug 19, 2019
2 parents 8be56b6 + b9bcebb commit a324788
Showing 1 changed file with 33 additions and 19 deletions.
52 changes: 33 additions & 19 deletions payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a324788

Please sign in to comment.