-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to the Recurring service, need to change adyen.go and env…
…ironnement.go to accept other endpoint than /Payment
- Loading branch information
Showing
8 changed files
with
95 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package adyen | ||
|
||
// RecurringDetailsRequest structure to list all recurring payment associated to a shopperReference | ||
type RecurringDetailsRequest struct { | ||
MerchantAccount string `json:"merchantAccount"` | ||
ShopperReference string `json:"shopperReference,omitempty"` | ||
// Not mandatory | ||
Recurring *Recurring `json:"recurring,omitempty"` | ||
} | ||
|
||
// RecurringDetailsResult structure to hold the RecurringDetails | ||
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"` | ||
} `json:"details"` | ||
InvalidOneclickContracts string `json:"invalidOneclickContracts"` | ||
ShopperReference string `json:"shopperReference"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package adyen | ||
|
||
// RecurringGateway - Adyen recurring transaction logic | ||
type RecurringGateway struct { | ||
*Adyen | ||
} | ||
|
||
// listRecurringDetailsType - listRecurringDetails type request, @TODO: move to enums | ||
const listRecurringDetailsType = "listRecurringDetails" | ||
|
||
// AuthoriseEncrypted - Perform authorise payment in Adyen | ||
func (a *RecurringGateway) ListRecurringDetails(req *RecurringDetailsRequest) (*RecurringDetailsResult, error) { | ||
resp, err := a.execute(listRecurringDetailsType, RecurringService, req) | ||
|
||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return resp.listRecurringDetails() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters