Skip to content

Commit

Permalink
Release v3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
KadoBOT committed Sep 16, 2020
1 parent 5d09fd4 commit 197afa1
Show file tree
Hide file tree
Showing 35 changed files with 88 additions and 90 deletions.
30 changes: 15 additions & 15 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You can use go modules to add our library to your project
### Go module

```bash
go get github.com/adyen/adyen-go-api-library/v2
go get github.com/adyen/adyen-go-api-library/v3
```

## Documentation
Expand All @@ -40,9 +40,9 @@ go get github.com/adyen/adyen-go-api-library/v2

```go
import (
"github.com/adyen/adyen-go-api-library/v2/src/checkout"
"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v2/src/adyen"
"github.com/adyen/adyen-go-api-library/v3/src/checkout"
"github.com/adyen/adyen-go-api-library/v3/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/adyen"
)

client := adyen.NewClient(&common.Config{
Expand All @@ -59,9 +59,9 @@ res, httpRes, err := client.Checkout.PaymentMethods(&checkout.PaymentMethodsRequ

```go
import (
"github.com/adyen/adyen-go-api-library/v2/src/checkout"
"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v2/src/adyen"
"github.com/adyen/adyen-go-api-library/v3/src/checkout"
"github.com/adyen/adyen-go-api-library/v3/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/adyen"
)

client := adyen.NewClient(&common.Config{
Expand All @@ -79,9 +79,9 @@ res, httpRes, err := client.Checkout.PaymentMethods(&checkout.PaymentMethodsRequ

```go
import (
"github.com/adyen/adyen-go-api-library/v2/src/recurring"
"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v2/src/adyen"
"github.com/adyen/adyen-go-api-library/v3/src/recurring"
"github.com/adyen/adyen-go-api-library/v3/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/adyen"
)

client := adyen.NewClient(&common.Config{
Expand All @@ -104,8 +104,8 @@ res, httpRes, err := client.Recurring.ListRecurringDetails(&recurring.RecurringD

```go
import (
"github.com/adyen/adyen-go-api-library/v2/src/adyen"
"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/adyen"
"github.com/adyen/adyen-go-api-library/v3/src/common"
)

client := adyen.NewClient(&common.Config{
Expand All @@ -120,9 +120,9 @@ notification, err := client.Notification.HandleNotificationRequest(jsonRequestSt

```go
import (
"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v2/src/checkout"
"github.com/adyen/adyen-go-api-library/v2/src/adyen"
"github.com/adyen/adyen-go-api-library/v3/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/checkout"
"github.com/adyen/adyen-go-api-library/v3/src/adyen"
)

client := adyen.NewClient(&common.Config{
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/adyen/adyen-go-api-library/v2
module github.com/adyen/adyen-go-api-library/v3

go 1.13

Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ package main
import (
"fmt"

"github.com/adyen/adyen-go-api-library/v2/src/adyen"
"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/adyen"
"github.com/adyen/adyen-go-api-library/v3/src/common"
)

func main() {
Expand Down
6 changes: 3 additions & 3 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"strings"
"testing"

"github.com/adyen/adyen-go-api-library/v2/src/adyen"
"github.com/adyen/adyen-go-api-library/v2/src/checkout"
"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/adyen"
"github.com/adyen/adyen-go-api-library/v3/src/checkout"
"github.com/adyen/adyen-go-api-library/v3/src/common"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
24 changes: 12 additions & 12 deletions src/adyen/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ import (
"fmt"
"net/http"

binlookup "github.com/adyen/adyen-go-api-library/v2/src/binlookup"
checkout "github.com/adyen/adyen-go-api-library/v2/src/checkout"
checkoututility "github.com/adyen/adyen-go-api-library/v2/src/checkoututility"
common "github.com/adyen/adyen-go-api-library/v2/src/common"
notification "github.com/adyen/adyen-go-api-library/v2/src/notification"
payments "github.com/adyen/adyen-go-api-library/v2/src/payments"
payouts "github.com/adyen/adyen-go-api-library/v2/src/payouts"
platformsaccount "github.com/adyen/adyen-go-api-library/v2/src/platformsaccount"
platformsfund "github.com/adyen/adyen-go-api-library/v2/src/platformsfund"
platformshostedonboardingpage "github.com/adyen/adyen-go-api-library/v2/src/platformshostedonboardingpage"
platformsnotificationconfiguration "github.com/adyen/adyen-go-api-library/v2/src/platformsnotificationconfiguration"
recurring "github.com/adyen/adyen-go-api-library/v2/src/recurring"
binlookup "github.com/adyen/adyen-go-api-library/v3/src/binlookup"
checkout "github.com/adyen/adyen-go-api-library/v3/src/checkout"
checkoututility "github.com/adyen/adyen-go-api-library/v3/src/checkoututility"
common "github.com/adyen/adyen-go-api-library/v3/src/common"
notification "github.com/adyen/adyen-go-api-library/v3/src/notification"
payments "github.com/adyen/adyen-go-api-library/v3/src/payments"
payouts "github.com/adyen/adyen-go-api-library/v3/src/payouts"
platformsaccount "github.com/adyen/adyen-go-api-library/v3/src/platformsaccount"
platformsfund "github.com/adyen/adyen-go-api-library/v3/src/platformsfund"
platformshostedonboardingpage "github.com/adyen/adyen-go-api-library/v3/src/platformshostedonboardingpage"
platformsnotificationconfiguration "github.com/adyen/adyen-go-api-library/v3/src/platformsnotificationconfiguration"
recurring "github.com/adyen/adyen-go-api-library/v3/src/recurring"
)

// Constants used for the client API
Expand Down
6 changes: 3 additions & 3 deletions src/adyen/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"testing"
"time"

"github.com/adyen/adyen-go-api-library/v2/src/checkout"
"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v2/src/recurring"
"github.com/adyen/adyen-go-api-library/v3/src/checkout"
"github.com/adyen/adyen-go-api-library/v3/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/recurring"
"github.com/joho/godotenv"

"github.com/stretchr/testify/assert"
Expand Down
2 changes: 1 addition & 1 deletion src/binlookup/api_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
_context "context"
_nethttp "net/http"

"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/common"
)

// BinLookup BinLookup service
Expand Down
2 changes: 1 addition & 1 deletion src/checkout/api_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
_context "context"
_nethttp "net/http"

"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/common"
)

// Checkout Checkout service
Expand Down
2 changes: 1 addition & 1 deletion src/checkout/model_payment_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
package checkout

import (
"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/common"
)

// PaymentResponse struct for PaymentResponse
Expand Down
2 changes: 1 addition & 1 deletion src/checkout/model_payment_verification_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

package checkout

import "github.com/adyen/adyen-go-api-library/v2/src/common"
import "github.com/adyen/adyen-go-api-library/v3/src/common"

// PaymentVerificationResponse struct for PaymentVerificationResponse
type PaymentVerificationResponse struct {
Expand Down
2 changes: 1 addition & 1 deletion src/checkoututility/api_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
_context "context"
_nethttp "net/http"

"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/common"
)

// CheckoutUtility CheckoutUtility service
Expand Down
8 changes: 3 additions & 5 deletions src/common/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -531,17 +531,15 @@ func (e APIError) Error() string {
return e.Err
}

type ctxKey int

var ctxKeyIdempotencyKey ctxKey = 1
var ctxKeyIdempotencyKey = 1

/*
WithIdempotencyKey returns a context with an Idempotency-Key added to the provided context.
Pass this context as the first context to a call to Adyen, and the idempotency
key will be added to the header
*/
func WithIdempotencyKey(ctx context.Context, i string) context.Context {
return context.WithValue(ctx, ctxKeyIdempotencyKey, i)
func WithIdempotencyKey(ctx context.Context, idempotencyKey string) context.Context {
return context.WithValue(ctx, ctxKeyIdempotencyKey, idempotencyKey)
}

func IdempotencyKey(ctx context.Context) (string, bool) {
Expand Down
2 changes: 1 addition & 1 deletion src/common/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const (

const (
LibName = "adyen-go-api-library"
LibVersion = "2.2.0"
LibVersion = "3.0.0"
)

// Config stores the configuration of the API client
Expand Down
2 changes: 1 addition & 1 deletion src/hmacvalidator/hmacvalidator.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strconv"
"strings"

"github.com/adyen/adyen-go-api-library/v2/src/notification"
"github.com/adyen/adyen-go-api-library/v3/src/notification"
)

// CalculateHmac calculates the SHA-256 HMAC for the given data and key
Expand Down
2 changes: 1 addition & 1 deletion src/hmacvalidator/hmacvalidator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"
"time"

"github.com/adyen/adyen-go-api-library/v2/src/notification"
"github.com/adyen/adyen-go-api-library/v3/src/notification"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion src/notification/notification_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package notification
import (
"encoding/json"

"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/common"
)

// NotificationService used to namespace this util under the client for consistency and for future prooffing if this ever requires api access
Expand Down
2 changes: 1 addition & 1 deletion src/payments/api_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
_context "context"
_nethttp "net/http"

"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/common"
)

// Payments Payments service
Expand Down
2 changes: 1 addition & 1 deletion src/payments/model_payment_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

package payments

import "github.com/adyen/adyen-go-api-library/v2/src/common"
import "github.com/adyen/adyen-go-api-library/v3/src/common"

// PaymentResult struct for PaymentResult
type PaymentResult struct {
Expand Down
2 changes: 1 addition & 1 deletion src/payouts/api_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
_context "context"
_nethttp "net/http"

"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/common"
)

// Payouts Payouts service
Expand Down
2 changes: 1 addition & 1 deletion src/payouts/model_payout_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

package payouts

import "github.com/adyen/adyen-go-api-library/v2/src/common"
import "github.com/adyen/adyen-go-api-library/v3/src/common"

// PayoutResponse struct for PayoutResponse
type PayoutResponse struct {
Expand Down
2 changes: 1 addition & 1 deletion src/platformsaccount/api_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
_context "context"
_nethttp "net/http"

"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/common"
)

// PlatformsAccount PlatformsAccount service
Expand Down
2 changes: 1 addition & 1 deletion src/platformsfund/api_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
_context "context"
_nethttp "net/http"

"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/common"
)

// PlatformsFund PlatformsFund service
Expand Down
2 changes: 1 addition & 1 deletion src/platformshostedonboardingpage/api_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
_context "context"
_nethttp "net/http"

"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/common"
)

// PlatformsHostedOnboardingPage PlatformsHostedOnboardingPage service
Expand Down
2 changes: 1 addition & 1 deletion src/platformsnotificationconfiguration/api_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
_context "context"
_nethttp "net/http"

"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/common"
)

// PlatformsNotificationConfiguration PlatformsNotificationConfiguration service
Expand Down
2 changes: 1 addition & 1 deletion src/recurring/api_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
_context "context"
_nethttp "net/http"

"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/common"
)

// Recurring Recurring service
Expand Down
2 changes: 1 addition & 1 deletion templates/go/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
_context "context"
_nethttp "net/http"

"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/common"
)

// {{packageName}} {{packageName}} service
Expand Down
6 changes: 3 additions & 3 deletions tests/binlookup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"os"
"testing"

"github.com/adyen/adyen-go-api-library/v2/src/adyen"
"github.com/adyen/adyen-go-api-library/v2/src/binlookup"
"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/adyen"
"github.com/adyen/adyen-go-api-library/v3/src/binlookup"
"github.com/adyen/adyen-go-api-library/v3/src/common"
"github.com/joho/godotenv"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
6 changes: 3 additions & 3 deletions tests/checkout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (

"github.com/google/uuid"

"github.com/adyen/adyen-go-api-library/v2/src/adyen"
"github.com/adyen/adyen-go-api-library/v2/src/checkout"
"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/adyen"
"github.com/adyen/adyen-go-api-library/v3/src/checkout"
"github.com/adyen/adyen-go-api-library/v3/src/common"

"github.com/joho/godotenv"

Expand Down
6 changes: 3 additions & 3 deletions tests/checkoutidempotency_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"testing"
"time"

"github.com/adyen/adyen-go-api-library/v2/src/adyen"
"github.com/adyen/adyen-go-api-library/v2/src/checkout"
"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/adyen"
"github.com/adyen/adyen-go-api-library/v3/src/checkout"
"github.com/adyen/adyen-go-api-library/v3/src/common"
"github.com/google/uuid"
"github.com/stretchr/testify/require"
)
Expand Down
6 changes: 3 additions & 3 deletions tests/checkoututility_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"strings"
"testing"

"github.com/adyen/adyen-go-api-library/v2/src/adyen"
"github.com/adyen/adyen-go-api-library/v2/src/checkoututility"
"github.com/adyen/adyen-go-api-library/v2/src/common"
"github.com/adyen/adyen-go-api-library/v3/src/adyen"
"github.com/adyen/adyen-go-api-library/v3/src/checkoututility"
"github.com/adyen/adyen-go-api-library/v3/src/common"
"github.com/joho/godotenv"

"github.com/stretchr/testify/assert"
Expand Down
Loading

0 comments on commit 197afa1

Please sign in to comment.