Repository: VictorAvelar/mollie-api-go
Pull request #104 (2020-11-03 17:07:36)

Mollie v2 setup
<!--- Provide a general summary of your changes in the Title above -->

## Description

Update path with v2 suffix

## Motivation and context

Why is this change required? What problem does it solve?

Enable tags > v1

## How has this been tested?

Please describe in detail how you tested your changes.
All existing unit tests passing

## Types of changes

What types of changes does your code introduce? Put an `x` in all the boxes that apply:
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Checklist:

Go over all the following points, and put an `x` in all the boxes that apply.

Please, please, please, don't send your pull request until all of the boxes are ticked. Once your pull request is created, it will trigger a build on our continuous integration server to make sure your [tests and code style pass](https://help.github.com/articles/about-required-status-checks/).

- [x] I have read the **[CONTRIBUTING](CONTRIBUTING.md)** document.
- [x] My pull request addresses exactly one patch/feature.
- [x] I have created a branch for this patch/feature.
- [x] Each individual commit in the pull request is meaningful.
- [x] I have added tests to cover my changes.
- [x] If my change requires a change to the documentation, I have updated it accordingly.

If you're unsure about any of these, don't hesitate to ask. We're here to help!



Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 96d337c..5006151 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,14 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip
 
 ## master
 
+## v2.0.1
+
+### Fixed
+- Path for v2 support
+
+### Deprecated
+- v1 support
+
 ## v2.0.0
 
 ### Added
diff --git a/docs/README.md b/docs/README.md
index 7d603cb..5ad03b2 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -1,6 +1,6 @@
 # mollie
 --
-    import "github.com/VictorAvelar/mollie-api-golang/mollie"
+    import "github.com/VictorAvelar/mollie-api-golang/v2/mollie"
 
 Package mollie is a wrapper around Mollie's REST API.
 
diff --git a/examples/auth/static_keys.go b/examples/auth/static_keys.go
index 1482a3d..2a0448f 100644
--- a/examples/auth/static_keys.go
+++ b/examples/auth/static_keys.go
@@ -5,7 +5,7 @@ import (
 	"log"
 	"os"
 
-	"github.com/VictorAvelar/mollie-api-go/mollie"
+	"github.com/VictorAvelar/mollie-api-go/v2/mollie"
 )
 
 func main() {
diff --git a/examples/chargebacks.go b/examples/chargebacks.go
index ecc3a6c..1ababa0 100644
--- a/examples/chargebacks.go
+++ b/examples/chargebacks.go
@@ -5,7 +5,7 @@ import (
 	"log"
 	"os"
 
-	"github.com/VictorAvelar/mollie-api-go/mollie"
+	"github.com/VictorAvelar/mollie-api-go/v2/mollie"
 )
 
 var (
diff --git a/examples/customers/customer.go b/examples/customers/customer.go
index e899b48..4f283d1 100644
--- a/examples/customers/customer.go
+++ b/examples/customers/customer.go
@@ -12,7 +12,7 @@ import (
 	"log"
 	"os"
 
-	"github.com/VictorAvelar/mollie-api-go/mollie"
+	"github.com/VictorAvelar/mollie-api-go/v2/mollie"
 )
 
 func main() {
diff --git a/examples/methods.go b/examples/methods.go
index 7083951..3b8872a 100644
--- a/examples/methods.go
+++ b/examples/methods.go
@@ -5,10 +5,9 @@ import (
 	"log"
 	"os"
 
-	"github.com/VictorAvelar/mollie-api-go/mollie"
+	"github.com/VictorAvelar/mollie-api-go/v2/mollie"
 )
 
-
 func init() {
 	_ = os.Setenv(mollie.APITokenEnv, "YOUR_API_TOKEN")
 
@@ -16,7 +15,7 @@ func init() {
 	client, _ = mollie.NewClient(nil, config)
 }
 
-// ListPaymentMethods code sample for getting a list of enabled payment methods on the website 
+// ListPaymentMethods code sample for getting a list of enabled payment methods on the website
 func ListPaymentMethods() {
 
 	options := &mollie.MethodsOptions{Resource: "orders"}
@@ -42,9 +41,9 @@ func ListAllPaymentMethods() {
 	fmt.Println(list)
 }
 
-// GetPaymentMethod code sample for getting an enabled payment method on the website 
+// GetPaymentMethod code sample for getting an enabled payment method on the website
 func GetPaymentMethod() {
-	
+
 	options := &mollie.MethodsOptions{Include: "issuers"}
 	paymentMethod, err := client.Methods.Get("ideal", options)
 
diff --git a/examples/oauth2/oauth2.go b/examples/oauth2/oauth2.go
index a0d1c48..10581e1 100644
--- a/examples/oauth2/oauth2.go
+++ b/examples/oauth2/oauth2.go
@@ -8,8 +8,8 @@ import (
 
 	"golang.org/x/oauth2"
 
-	"github.com/VictorAvelar/mollie-api-go/mollie"
-	"github.com/VictorAvelar/mollie-api-go/mollie/connect"
+	"github.com/VictorAvelar/mollie-api-go/v2/mollie"
+	"github.com/VictorAvelar/mollie-api-go/v2/mollie/connect"
 )
 
 func main() {
diff --git a/examples/profiles.go b/examples/profiles.go
index d087d10..03dc811 100644
--- a/examples/profiles.go
+++ b/examples/profiles.go
@@ -5,7 +5,7 @@ import (
 	"log"
 	"os"
 
-	"github.com/VictorAvelar/mollie-api-go/mollie"
+	"github.com/VictorAvelar/mollie-api-go/v2/mollie"
 )
 
 var (
diff --git a/examples/subscriptions.go b/examples/subscriptions.go
index 0e73b87..0be6cd3 100644
--- a/examples/subscriptions.go
+++ b/examples/subscriptions.go
@@ -5,7 +5,7 @@ import (
 	"log"
 	"os"
 
-	"github.com/VictorAvelar/mollie-api-go/mollie"
+	"github.com/VictorAvelar/mollie-api-go/v2/mollie"
 )
 
 var (
diff --git a/go.mod b/go.mod
index 98f2543..99e4621 100644
--- a/go.mod
+++ b/go.mod
@@ -1,9 +1,8 @@
-module github.com/VictorAvelar/mollie-api-go
+module github.com/VictorAvelar/mollie-api-go/v2
 
 go 1.15
 
 require (
 	github.com/google/go-querystring v1.0.0
-	golang.org/x/net v0.0.0-20201002202402-0a1ea396d57c // indirect
 	golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43
 )
diff --git a/go.sum b/go.sum
index 5716a5e..e83caea 100644
--- a/go.sum
+++ b/go.sum
@@ -182,8 +182,6 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R
 golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
 golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA=
 golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
-golang.org/x/net v0.0.0-20201002202402-0a1ea396d57c h1:dk0ukUIHmGHqASjP0iue2261isepFCC6XRCSd1nHgDw=
-golang.org/x/net v0.0.0-20201002202402-0a1ea396d57c/go.mod h1:iQL9McJNjoIa5mjH6nYTCTZXUN6RP+XW3eib7Ya3XcI=
 golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
 golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
 golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0=
@@ -226,8 +224,6 @@ golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7w
 golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
-golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA=
-golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
 golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
 golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=


Test patch:
diff --git a/mollie/captures_test.go b/mollie/captures_test.go
index 2ef92f1..c67db37 100644
--- a/mollie/captures_test.go
+++ b/mollie/captures_test.go
@@ -7,7 +7,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/VictorAvelar/mollie-api-go/testdata"
+	"github.com/VictorAvelar/mollie-api-go/v2/testdata"
 )
 
 func TestCapturesService_Get(t *testing.T) {
diff --git a/mollie/chargebacks_test.go b/mollie/chargebacks_test.go
index 64a6d10..dc3c266 100644
--- a/mollie/chargebacks_test.go
+++ b/mollie/chargebacks_test.go
@@ -8,7 +8,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/VictorAvelar/mollie-api-go/testdata"
+	"github.com/VictorAvelar/mollie-api-go/v2/testdata"
 )
 
 func TestChargebacksService_Get(t *testing.T) {
diff --git a/mollie/customers_test.go b/mollie/customers_test.go
index 3cf625e..de77fc4 100644
--- a/mollie/customers_test.go
+++ b/mollie/customers_test.go
@@ -6,7 +6,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/VictorAvelar/mollie-api-go/testdata"
+	"github.com/VictorAvelar/mollie-api-go/v2/testdata"
 )
 
 func TestCustomersService_Get(t *testing.T) {
diff --git a/mollie/example_test.go b/mollie/example_test.go
index 643360e..ab06cfc 100644
--- a/mollie/example_test.go
+++ b/mollie/example_test.go
@@ -6,7 +6,7 @@ import (
 
 	"golang.org/x/oauth2"
 
-	"github.com/VictorAvelar/mollie-api-go/mollie/connect"
+	"github.com/VictorAvelar/mollie-api-go/v2/mollie/connect"
 )
 
 // ----- mollie examples -----
diff --git a/mollie/invoices_test.go b/mollie/invoices_test.go
index 9e12207..eb6dae0 100644
--- a/mollie/invoices_test.go
+++ b/mollie/invoices_test.go
@@ -6,7 +6,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/VictorAvelar/mollie-api-go/testdata"
+	"github.com/VictorAvelar/mollie-api-go/v2/testdata"
 )
 
 func TestInvoicesService_Get(t *testing.T) {
diff --git a/mollie/mandates_test.go b/mollie/mandates_test.go
index 1b79b10..6c6fac0 100644
--- a/mollie/mandates_test.go
+++ b/mollie/mandates_test.go
@@ -7,7 +7,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/VictorAvelar/mollie-api-go/testdata"
+	"github.com/VictorAvelar/mollie-api-go/v2/testdata"
 )
 
 func TestMandatesService_Get(t *testing.T) {
diff --git a/mollie/methods_test.go b/mollie/methods_test.go
index 71fa404..78a3e94 100644
--- a/mollie/methods_test.go
+++ b/mollie/methods_test.go
@@ -6,7 +6,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/VictorAvelar/mollie-api-go/testdata"
+	"github.com/VictorAvelar/mollie-api-go/v2/testdata"
 )
 
 func TestMethodsService_ListWithQueryOptionsAmountCurrency(t *testing.T) {
@@ -67,9 +67,9 @@ func TestMethodsService_ListWithQueryOptionsAll(t *testing.T) {
 	opts := &MethodsOptions{
 		AmountCurrency: "USD",
 		AmountValue:    "100.00",
-		Resource: "orders",
-		SequenceType: FirstSequence,
-		Locale: German,
+		Resource:       "orders",
+		SequenceType:   FirstSequence,
+		Locale:         German,
 		BillingCountry: "DE",
 		IncludeWallets: "applepay",
 	}
diff --git a/mollie/miscellaneous_test.go b/mollie/miscellaneous_test.go
index 75385aa..7c3089c 100644
--- a/mollie/miscellaneous_test.go
+++ b/mollie/miscellaneous_test.go
@@ -6,7 +6,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/VictorAvelar/mollie-api-go/testdata"
+	"github.com/VictorAvelar/mollie-api-go/v2/testdata"
 )
 
 func TestMiscellaneousService_ApplePaymentSession(t *testing.T) {
diff --git a/mollie/orders_test.go b/mollie/orders_test.go
index a9947fd..b436cf7 100644
--- a/mollie/orders_test.go
+++ b/mollie/orders_test.go
@@ -7,7 +7,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/VictorAvelar/mollie-api-go/testdata"
+	"github.com/VictorAvelar/mollie-api-go/v2/testdata"
 )
 
 func TestOrdersService_Get(t *testing.T) {
diff --git a/mollie/organizations_test.go b/mollie/organizations_test.go
index 21d82e0..17fe677 100644
--- a/mollie/organizations_test.go
+++ b/mollie/organizations_test.go
@@ -1,11 +1,12 @@
 package mollie
 
 import (
-	"github.com/VictorAvelar/mollie-api-go/testdata"
 	"net/http"
 	"net/url"
 	"strings"
 	"testing"
+
+	"github.com/VictorAvelar/mollie-api-go/v2/testdata"
 )
 
 func TestOrganizationsService_Get(t *testing.T) {
diff --git a/mollie/payments_test.go b/mollie/payments_test.go
index fec0dc7..be0be56 100644
--- a/mollie/payments_test.go
+++ b/mollie/payments_test.go
@@ -6,7 +6,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/VictorAvelar/mollie-api-go/testdata"
+	"github.com/VictorAvelar/mollie-api-go/v2/testdata"
 )
 
 func TestPaymentsService_Get(t *testing.T) {
diff --git a/mollie/profiles_test.go b/mollie/profiles_test.go
index 566a68c..235d01c 100644
--- a/mollie/profiles_test.go
+++ b/mollie/profiles_test.go
@@ -8,7 +8,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/VictorAvelar/mollie-api-go/testdata"
+	"github.com/VictorAvelar/mollie-api-go/v2/testdata"
 )
 
 func TestProfilesService_Get(t *testing.T) {
@@ -311,9 +311,9 @@ func TestProfilesService_DisableGiftCardIssuer(t *testing.T) {
 		teardown()
 		unsetEnv()
 	}()
-	
+
 	id := "pfl_v9hTwCvYqw"
-	
+
 	tMux.HandleFunc(
 		fmt.Sprintf("/v2/profiles/%s/methods/giftcard/issuers/%s", id, Festivalcadeau),
 		func(rw http.ResponseWriter, r *http.Request) {
@@ -322,13 +322,13 @@ func TestProfilesService_DisableGiftCardIssuer(t *testing.T) {
 			if _, ok := r.Header[AuthHeader]; !ok {
 				rw.WriteHeader(http.StatusUnauthorized)
 			}
-			
+
 			rw.WriteHeader(http.StatusNoContent)
 		},
 	)
-	
+
 	err := tClient.Profiles.DisableGiftCardIssuer(id, Festivalcadeau)
-	
+
 	if err != nil {
 		t.Error(err)
 	}
@@ -341,9 +341,9 @@ func TestProfilesService_EnableGiftCardIssuerForCurrent(t *testing.T) {
 		teardown()
 		unsetEnv()
 	}()
-	
+
 	id := "me"
-	
+
 	tMux.HandleFunc(
 		fmt.Sprintf("/v2/profiles/%s/methods/giftcard/issuers/%s", id, Festivalcadeau),
 		func(rw http.ResponseWriter, r *http.Request) {
@@ -352,18 +352,18 @@ func TestProfilesService_EnableGiftCardIssuerForCurrent(t *testing.T) {
 			if _, ok := r.Header[AuthHeader]; !ok {
 				rw.WriteHeader(http.StatusUnauthorized)
 			}
-			
+
 			rw.WriteHeader(http.StatusOK)
 			_, _ = rw.Write([]byte(testdata.EnableGiftCardIssuerResponse))
 		},
 	)
-	
+
 	res, err := tClient.Profiles.EnableGiftCardIssuerForCurrent(Festivalcadeau)
-	
+
 	if err != nil {
 		t.Error(err)
 	}
-	
+
 	if res.ID != Festivalcadeau {
 		t.Errorf("unexpected id received: want %v, got %v", Festivalcadeau, res.ID)
 	}
@@ -376,9 +376,9 @@ func TestProfilesService_DisableGiftCardIssuerForCurrent(t *testing.T) {
 		teardown()
 		unsetEnv()
 	}()
-	
+
 	id := "me"
-	
+
 	tMux.HandleFunc(
 		fmt.Sprintf("/v2/profiles/%s/methods/giftcard/issuers/%s", id, Festivalcadeau),
 		func(rw http.ResponseWriter, r *http.Request) {
@@ -387,13 +387,13 @@ func TestProfilesService_DisableGiftCardIssuerForCurrent(t *testing.T) {
 			if _, ok := r.Header[AuthHeader]; !ok {
 				rw.WriteHeader(http.StatusUnauthorized)
 			}
-			
+
 			rw.WriteHeader(http.StatusNoContent)
 		},
 	)
-	
+
 	err := tClient.Profiles.DisableGiftCardIssuerForCurrent(Festivalcadeau)
-	
+
 	if err != nil {
 		t.Error(err)
 	}
diff --git a/mollie/refunds_test.go b/mollie/refunds_test.go
index a5ba036..89a5e3b 100644
--- a/mollie/refunds_test.go
+++ b/mollie/refunds_test.go
@@ -6,7 +6,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/VictorAvelar/mollie-api-go/testdata"
+	"github.com/VictorAvelar/mollie-api-go/v2/testdata"
 )
 
 func TestRefundsService_Get(t *testing.T) {
diff --git a/mollie/settlements_test.go b/mollie/settlements_test.go
index de76e79..6e0b9f6 100644
--- a/mollie/settlements_test.go
+++ b/mollie/settlements_test.go
@@ -7,7 +7,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/VictorAvelar/mollie-api-go/testdata"
+	"github.com/VictorAvelar/mollie-api-go/v2/testdata"
 )
 
 func TestSettlementsService_Get(t *testing.T) {
diff --git a/mollie/shipments_test.go b/mollie/shipments_test.go
index e59cb09..4df0e5b 100644
--- a/mollie/shipments_test.go
+++ b/mollie/shipments_test.go
@@ -7,7 +7,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/VictorAvelar/mollie-api-go/testdata"
+	"github.com/VictorAvelar/mollie-api-go/v2/testdata"
 )
 
 func TestShipmentsService_Get(t *testing.T) {
diff --git a/mollie/subscriptions_test.go b/mollie/subscriptions_test.go
index 2a2d0f4..2cc9e3e 100644
--- a/mollie/subscriptions_test.go
+++ b/mollie/subscriptions_test.go
@@ -7,7 +7,7 @@ import (
 	"strings"
 	"testing"
 
-	"github.com/VictorAvelar/mollie-api-go/testdata"
+	"github.com/VictorAvelar/mollie-api-go/v2/testdata"
 )
 
 func TestSubscriptionsService_Get(t *testing.T) {