diff --git a/Gopkg.lock b/Gopkg.lock deleted file mode 100644 index 90fa12e..0000000 --- a/Gopkg.lock +++ /dev/null @@ -1,22 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - digest = "1:2e3c336fc7fde5c984d2841455a658a6d626450b1754a854b3b32e7a8f49a07a" - name = "github.com/google/go-cmp" - packages = [ - "cmp", - "cmp/internal/diff", - "cmp/internal/function", - "cmp/internal/value", - ] - pruneopts = "UT" - revision = "3af367b6b30c263d47e8895973edcca9a49cf029" - version = "v0.2.0" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - input-imports = ["github.com/google/go-cmp/cmp"] - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml deleted file mode 100644 index 0818b70..0000000 --- a/Gopkg.toml +++ /dev/null @@ -1,7 +0,0 @@ -[[constraint]] - name = "github.com/google/go-cmp" - version = "0.2.0" - -[prune] - go-tests = true - unused-packages = true diff --git a/README.md b/README.md index 88530a3..9b7f69f 100644 --- a/README.md +++ b/README.md @@ -1,44 +1,49 @@ # Recurly Client for Go - [![Build Status](https://travis-ci.org/blacklightcms/recurly.svg?branch=master)](https://travis-ci.org/blacklightcms/recurly) [![GoDoc](https://godoc.org/github.com/blacklightcms/recurly?status.svg)](https://godoc.org/github.com/blacklightcms/recurly/) - - Recurly is a Go (golang) API Client for the [Recurly](https://recurly.com/) API. It is actively maintained, unit tested, and uses no external dependencies. The vast majority of the API is implemented. - - Supports: - - Recurly API `v2.27` - - Accounts - - Add Ons - - Adjustments - - Billing - - Coupons - - Credit Payments - - Invoices - - Plans - - Purchases - - Redemptions - - Shipping Addresses - - Shipping Methods - - Subscriptions - - Transactions +[![Build Status](https://travis-ci.org/togglhire/recurly.svg?branch=master)](https://travis-ci.org/togglhire/recurly) [![GoDoc](https://godoc.org/github.com/togglhire/recurly?status.svg)](https://godoc.org/github.com/togglhire/recurly/) + +Recurly is a Go (golang) API Client for the [Recurly](https://recurly.com/) API. It is actively maintained, unit tested, and uses no external dependencies. The vast majority of the API is implemented. + +Supports: + +- Recurly API `v2.27` +- Accounts +- Add Ons +- Adjustments +- Billing +- Coupons +- Credit Payments +- Invoices +- Plans +- Purchases +- Redemptions +- Shipping Addresses +- Shipping Methods +- Subscriptions +- Transactions ## Installation + Install: ```shell -go get github.com/blacklightcms/recurly +go get github.com/togglhire/recurly ``` Import: + ```go -import "github.com/blacklightcms/recurly" +import "github.com/togglhire/recurly" ``` Resources: - - [API Docs](https://godoc.org/github.com/blacklightcms/recurly/) - - [Examples](https://godoc.org/github.com/blacklightcms/recurly/#pkg-examples) + +- [API Docs](https://godoc.org/github.com/togglhire/recurly/) +- [Examples](https://godoc.org/github.com/togglhire/recurly/#pkg-examples) ## Note on v1 and breaking changes -If migrating from a previous version of the library, there was a large refactor with breaking changes released to address some design issues with the library. See the [migration guide](https://github.com/blacklightcms/recurly/wiki/v1-Migration-Guide) for steps on how to migrate to the latest version. + +If migrating from a previous version of the library, there was a large refactor with breaking changes released to address some design issues with the library. See the [migration guide](https://github.com/togglhire/recurly/wiki/v1-Migration-Guide) for steps on how to migrate to the latest version. This is recommended for all users. @@ -54,7 +59,8 @@ a, err := client.Accounts.Get(context.Background(), "1") ``` ## Examples and How To -Please go through [examples](https://godoc.org/github.com/blacklightcms/recurly/#pkg-examples) for detailed examples of using this package. + +Please go through [examples](https://godoc.org/github.com/togglhire/recurly/#pkg-examples) for detailed examples of using this package. The examples explain important cases like: @@ -66,6 +72,7 @@ The examples explain important cases like: Here are a few snippets to demonstrate library usage. ### Create Account + ```go account, err := client.Accounts.Create(ctx, recurly.Account{ Code: "1", @@ -75,11 +82,12 @@ account, err := client.Accounts.Create(ctx, recurly.Account{ }) ``` -> **NOTE**: An account can also be created along a subscription by embedding the -> account in the subscription during creation. The purchases API also supports +> **NOTE**: An account can also be created along a subscription by embedding the +> account in the subscription during creation. The purchases API also supports > this, and likely other endpoints. See Recurly's documentation for details. ### Get Account + ```go account, err := client.Accounts.Get(ctx, "1") if err != nil { @@ -92,6 +100,7 @@ if err != nil { ``` ### Create Billing Info + ```go // Using token obtained with recurly.js // If you want to set billing info directly, omit the token and set the @@ -100,6 +109,7 @@ billing, err := client.Billing.Create("1", recurly.Billing{ Token: token, }) ``` + > **NOTE**: See the error handling section in GoDoc for how to handle transaction errors ### Creating Purchases @@ -127,6 +137,7 @@ if err != nil { > structs and [Recurly's documentation](https://dev.recurly.com/docs/create-purchase) for more info. ### Creating Subscriptions + ```go subscription, err := client.Subscriptions.Create(ctx, recurly.NewSubscription{ PlanCode: "gold", @@ -141,18 +152,20 @@ if err != nil { return err } ``` -> **NOTE**: Recurly offers several other ways to create subscriptions, often embedded -> within other requests (such as the `Purchases.Create()` call). See Recurly's + +> **NOTE**: Recurly offers several other ways to create subscriptions, often embedded +> within other requests (such as the `Purchases.Create()` call). See Recurly's > documentation for more details. ## Webhooks -This library supports webhooks via the `webhooks` sub package. -The usage is to parse the webhook from a reader, then use a switch statement +This library supports webhooks via the `webhooks` sub package. + +The usage is to parse the webhook from a reader, then use a switch statement to determine the type of webhook received. ```go -// import "github.com/blacklightcms/recurly/webhooks" +// import "github.com/togglhire/recurly/webhooks" hook, err := webhooks.Parse(r) if e, ok := err.(*webhooks.ErrUnknownNotification); ok { @@ -177,30 +190,31 @@ default: ``` ## Testing + Once you've imported this library into your application, you will want to add tests. -Internally this library sets up a test HTTPs server and validates methods, paths, +Internally this library sets up a test HTTPs server and validates methods, paths, query strings, request body, and returns XML. You will not need to worry about those internals when testing your own code that uses this library. -Instead we recommend using the `mock` package. The `mock` package provides mocks +Instead we recommend using the `mock` package. The `mock` package provides mocks for all of the different services in this library. -For examples of how to test your code using mocks, visit the [GoDoc examples](https://godoc.org/github.com/blacklightcms/recurly/mock/). +For examples of how to test your code using mocks, visit the [GoDoc examples](https://godoc.org/github.com/togglhire/recurly/mock/). > **NOTE**: If you need to go beyond mocks and test requests/responses, `testing.go` exports `TestServer`. This is how the library tests itself. See the GoDoc or the `*_test.go` files for usage examples. ## Contributing -We use [`dep`](https://github.com/golang/dep) for dependency management. If you -do not have it installed, see the [installation instructions](https://github.com/golang/dep#installation). +We use `go mod` for dependency management, it's included with the standard go tooling. To contribute: fork and clone the repository, `cd` into the directory, and run: ```shell -dep ensure +go mod tidy +go mod vendor ``` That will ensure you have [`google/go-cmp`](https://github.com/google/go-cmp) which is used to run tests. -If you plan on submitting a patch, please write tests for it. \ No newline at end of file +If you plan on submitting a patch, please write tests for it. diff --git a/accounts.go b/accounts.go index 0d44172..8011f67 100644 --- a/accounts.go +++ b/accounts.go @@ -37,6 +37,9 @@ type AccountsService interface { // https://dev.recurly.com/docs/update-account Update(ctx context.Context, accountCode string, a Account) (*Account, error) + // Clear empties added info on a account. + Clear(ctx context.Context, accountCode string) error + // Close marks an account as closed and cancels any active subscriptions. // Paused subscriptions will be expired. // @@ -97,6 +100,16 @@ type Account struct { TransactionType string `xml:"transaction_type,omitempty"` // Create only } +// clearAccount is a helper object for clearing info from a recurly account. +type clearAccount struct { + XMLName xml.Name `xml:"account"` + Code string `xml:"account_code,omitempty"` + FirstName string `xml:"first_name"` + LastName string `xml:"last_name"` + VATNumber string `xml:"vat_number"` + Address *Address `xml:"address"` +} + // AccountBalance is used for getting the account balance. type AccountBalance struct { XMLName xml.Name `xml:"account_balance"` @@ -194,6 +207,17 @@ func (s *accountsImpl) Update(ctx context.Context, code string, a Account) (*Acc return &dst, err } +func (s *accountsImpl) Clear(ctx context.Context, code string) error { + path := fmt.Sprintf("/accounts/%s", code) + a := clearAccount{} + req, err := s.client.newRequest("PUT", path, a) + if err != nil { + return err + } + _, err = s.client.do(ctx, req, nil) + return err +} + func (s *accountsImpl) Close(ctx context.Context, code string) error { path := fmt.Sprintf("/accounts/%s", code) req, err := s.client.newRequest("DELETE", path, nil) diff --git a/accounts_test.go b/accounts_test.go index c40b763..33721e8 100644 --- a/accounts_test.go +++ b/accounts_test.go @@ -8,8 +8,8 @@ import ( "strconv" "testing" - "github.com/blacklightcms/recurly" "github.com/google/go-cmp/cmp" + "github.com/togglhire/recurly" ) // Ensure structs are encoded to XML properly. @@ -377,6 +377,22 @@ func TestAccounts_Update(t *testing.T) { } } +func TestAccounts_Clear(t *testing.T) { + client, s := recurly.NewTestServer() + defer s.Close() + + s.HandleFunc("PUT", "/v2/accounts/1", func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusOK) + w.Write(MustOpenFile("account.xml")) + }, t) + + if err := client.Accounts.Clear(context.Background(), "1"); !s.Invoked { + t.Fatal("expected fn invocation") + } else if err != nil { + t.Fatal(err) + } +} + func TestAccounts_Close(t *testing.T) { client, s := recurly.NewTestServer() defer s.Close() diff --git a/add_ons_test.go b/add_ons_test.go index a904b87..77aef85 100644 --- a/add_ons_test.go +++ b/add_ons_test.go @@ -8,8 +8,8 @@ import ( "strconv" "testing" - "github.com/blacklightcms/recurly" "github.com/google/go-cmp/cmp" + "github.com/togglhire/recurly" ) // Ensure structs are encoded to XML properly. diff --git a/adjustments_test.go b/adjustments_test.go index 18efeef..5513f25 100644 --- a/adjustments_test.go +++ b/adjustments_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/blacklightcms/recurly" "github.com/google/go-cmp/cmp" + "github.com/togglhire/recurly" ) // Ensure structs are encoded to XML properly. diff --git a/automated_exports_test.go b/automated_exports_test.go index 8eb8d8a..df6cbde 100644 --- a/automated_exports_test.go +++ b/automated_exports_test.go @@ -10,8 +10,8 @@ import ( "testing" "time" - "github.com/blacklightcms/recurly" "github.com/google/go-cmp/cmp" + "github.com/togglhire/recurly" ) // Ensure structs are encoded to XML properly. diff --git a/billing_test.go b/billing_test.go index 5574854..35c15a8 100644 --- a/billing_test.go +++ b/billing_test.go @@ -9,8 +9,8 @@ import ( "strconv" "testing" - "github.com/blacklightcms/recurly" "github.com/google/go-cmp/cmp" + "github.com/togglhire/recurly" ) // Ensure structs are encoded to XML properly. diff --git a/coupons_test.go b/coupons_test.go index ea21d61..a52d300 100644 --- a/coupons_test.go +++ b/coupons_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/blacklightcms/recurly" "github.com/google/go-cmp/cmp" + "github.com/togglhire/recurly" ) // Ensure structs are encoded to XML properly. diff --git a/credit_payments_test.go b/credit_payments_test.go index 066af09..41c1a20 100644 --- a/credit_payments_test.go +++ b/credit_payments_test.go @@ -6,8 +6,8 @@ import ( "net/http" "testing" - "github.com/blacklightcms/recurly" "github.com/google/go-cmp/cmp" + "github.com/togglhire/recurly" ) func TestCreditPayments_List(t *testing.T) { diff --git a/doc.go b/doc.go index c537f7e..2c12c13 100644 --- a/doc.go +++ b/doc.go @@ -1,12 +1,12 @@ /* Package recurly provides a client for using the Recurly API. -Usage +# Usage Construct a new Recurly client, then use the various services on the client to access different parts of the Recurly API. For example: - import "github.com/blacklightcms/recurly" + import "github.com/togglhire/recurly" func main() { client := recurly.NewClient("your-subdomain", "APIKEY") @@ -17,7 +17,7 @@ access different parts of the Recurly API. For example: See the examples section for more usage examples. -Null Types +# Null Types Null types provide a way to differentiate between zero values and real values. For example, 0 is the zero value for ints; false for bools. Because those are @@ -55,7 +55,7 @@ the value is valid only if the pointer is non-nil: b := recurly.NewBoolPtr(b) // where b is *bool t := recurly.NewTimePtr(t) // where t is *time.Time. If non-nil, t.IsZero() must be false to be considered valid -Error Handling +# Error Handling Generally, checking that err != nil is sufficient to catch errors. However there are some circumstances where you may need to know more about the specific error. @@ -109,7 +109,7 @@ information on the amount of requests and when the rate limit will reset. For more on errors, see the examples section below. -Get Methods +# Get Methods When retrieving an individual item (e.g. account, invoice, subscription): if the item is not found, Recurly will return a 404 Not Found. Typically this will return @@ -123,8 +123,7 @@ a nil item and nil error will be returned if the item is not found. // account not found } - -Pagination +# Pagination All requests for resource collections support pagination. Pagination options are described in the recurly.PagerOptions struct and passed to the list methods directly. @@ -172,6 +171,5 @@ the next result set: pager := client.Accounts.List(&recurly.PagerOptions{ Cursor: cursor, }) - */ package recurly diff --git a/doc_test.go b/doc_test.go index 4a64953..671ceab 100644 --- a/doc_test.go +++ b/doc_test.go @@ -6,7 +6,7 @@ import ( "net/http" "time" - "github.com/blacklightcms/recurly" + "github.com/togglhire/recurly" ) var client *recurly.Client diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..19b572d --- /dev/null +++ b/go.mod @@ -0,0 +1,7 @@ +module github.com/togglhire/recurly + +go 1.19 + +require ( + github.com/google/go-cmp v0.2.0 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..a1ba6b1 --- /dev/null +++ b/go.sum @@ -0,0 +1,4 @@ +github.com/togglhire/recurly v2.0.0+incompatible h1:6AKOc/8ocaAalNWcwiV6aEkeGFcjGRZDDRvcR9WcrZk= +github.com/togglhire/recurly v2.0.0+incompatible/go.mod h1:EkFu4RfxshuQOLAm3n2et9QANHQStCGP6SVC4BNOWOU= +github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= diff --git a/invoices_test.go b/invoices_test.go index 0f18c4c..eb8dbd9 100644 --- a/invoices_test.go +++ b/invoices_test.go @@ -9,8 +9,8 @@ import ( "strconv" "testing" - "github.com/blacklightcms/recurly" "github.com/google/go-cmp/cmp" + "github.com/togglhire/recurly" ) func TestInvoices_Encoding(t *testing.T) { diff --git a/items_test.go b/items_test.go index 9bd0fd6..26aa996 100644 --- a/items_test.go +++ b/items_test.go @@ -8,8 +8,8 @@ import ( "strconv" "testing" - "github.com/blacklightcms/recurly" "github.com/google/go-cmp/cmp" + "github.com/togglhire/recurly" ) // Ensure structs are encoded to XML properly. diff --git a/mock/accounts.go b/mock/accounts.go index 0de250f..e88414b 100644 --- a/mock/accounts.go +++ b/mock/accounts.go @@ -3,7 +3,7 @@ package mock import ( "context" - "github.com/blacklightcms/recurly" + "github.com/togglhire/recurly" ) var _ recurly.AccountsService = &AccountsService{} @@ -25,6 +25,9 @@ type AccountsService struct { OnUpdate func(ctx context.Context, code string, a recurly.Account) (*recurly.Account, error) UpdateInvoked bool + OnClear func(ctx context.Context, code string) error + ClearInvoked bool + OnClose func(ctx context.Context, code string) error CloseInvoked bool @@ -60,6 +63,11 @@ func (m *AccountsService) Update(ctx context.Context, code string, a recurly.Acc return m.OnUpdate(ctx, code, a) } +func (m *AccountsService) Clear(ctx context.Context, code string) error { + m.ClearInvoked = true + return m.OnClear(ctx, code) +} + func (m *AccountsService) Close(ctx context.Context, code string) error { m.CloseInvoked = true return m.OnClose(ctx, code) diff --git a/mock/add_ons.go b/mock/add_ons.go index ff4a984..e14f772 100644 --- a/mock/add_ons.go +++ b/mock/add_ons.go @@ -3,7 +3,7 @@ package mock import ( "context" - "github.com/blacklightcms/recurly" + "github.com/togglhire/recurly" ) var _ recurly.AddOnsService = &AddOnsService{} diff --git a/mock/adjustments.go b/mock/adjustments.go index 76bf4bb..c1cfd35 100644 --- a/mock/adjustments.go +++ b/mock/adjustments.go @@ -3,7 +3,7 @@ package mock import ( "context" - "github.com/blacklightcms/recurly" + "github.com/togglhire/recurly" ) var _ recurly.AdjustmentsService = &AdjustmentsService{} diff --git a/mock/automated_exports.go b/mock/automated_exports.go index 31a2eca..2364c58 100644 --- a/mock/automated_exports.go +++ b/mock/automated_exports.go @@ -4,7 +4,7 @@ import ( "context" "time" - "github.com/blacklightcms/recurly" + "github.com/togglhire/recurly" ) var _ recurly.AutomatedExportsService = &AutomatedExportsService{} diff --git a/mock/billing.go b/mock/billing.go index 27a6731..1995fb1 100644 --- a/mock/billing.go +++ b/mock/billing.go @@ -3,7 +3,7 @@ package mock import ( "context" - "github.com/blacklightcms/recurly" + "github.com/togglhire/recurly" ) var _ recurly.BillingService = &BillingService{} diff --git a/mock/client.go b/mock/client.go index bfe570a..72656f8 100644 --- a/mock/client.go +++ b/mock/client.go @@ -1,7 +1,7 @@ package mock import ( - "github.com/blacklightcms/recurly" + "github.com/togglhire/recurly" ) // Client is a test wrapper for recurly.Client holding mocks for diff --git a/mock/coupons.go b/mock/coupons.go index 617c82f..c210bd2 100644 --- a/mock/coupons.go +++ b/mock/coupons.go @@ -3,7 +3,7 @@ package mock import ( "context" - "github.com/blacklightcms/recurly" + "github.com/togglhire/recurly" ) var _ recurly.CouponsService = &CouponsService{} diff --git a/mock/credit_payments.go b/mock/credit_payments.go index 75f23e4..5d2200d 100644 --- a/mock/credit_payments.go +++ b/mock/credit_payments.go @@ -3,7 +3,7 @@ package mock import ( "context" - "github.com/blacklightcms/recurly" + "github.com/togglhire/recurly" ) var _ recurly.CreditPaymentsService = &CreditPaymentsService{} diff --git a/mock/doc.go b/mock/doc.go index 3bea7a5..27a7d24 100644 --- a/mock/doc.go +++ b/mock/doc.go @@ -6,7 +6,7 @@ This package makes it easy to test code using the Recurly API by focusing on the arguments passed into each function and returning the expected result as structs from the Recurly package. There is no need to deal with XML or make any HTTP requests. -Simple Setup +# Simple Setup The basic setup for a test involves creating a new mock client, attaching mocks, and returning expected results. @@ -35,7 +35,7 @@ and returning expected results. } } -More Common Setup +# More Common Setup If you created your own wrapper type to the library, let's call it PaymentsProvider: @@ -82,7 +82,7 @@ Then in your test suite you might configure your own wrapper similar to mock.Cli "context" "github.com/your-project/foo" - "github.com/blacklightcms/recurly/mock" + "github.com/togglhire/recurly/mock" ) // Provider is a test wrapper for foo.Provider. @@ -128,6 +128,5 @@ Then in your test suite you might configure your own wrapper similar to mock.Cli } See examples for more. - */ package mock diff --git a/mock/example_test.go b/mock/example_test.go index 7370929..cbb6687 100644 --- a/mock/example_test.go +++ b/mock/example_test.go @@ -4,9 +4,9 @@ import ( "context" "testing" - "github.com/blacklightcms/recurly" - "github.com/blacklightcms/recurly/mock" "github.com/google/go-cmp/cmp" + "github.com/togglhire/recurly" + "github.com/togglhire/recurly/mock" ) func ExampleNewClient(t *testing.T) { diff --git a/mock/invoices.go b/mock/invoices.go index 216379d..10ca3e7 100644 --- a/mock/invoices.go +++ b/mock/invoices.go @@ -4,7 +4,7 @@ import ( "bytes" "context" - "github.com/blacklightcms/recurly" + "github.com/togglhire/recurly" ) var _ recurly.InvoicesService = &InvoicesService{} diff --git a/mock/pager.go b/mock/pager.go index 1657f05..bf8a8bf 100644 --- a/mock/pager.go +++ b/mock/pager.go @@ -3,7 +3,7 @@ package mock import ( "context" - "github.com/blacklightcms/recurly" + "github.com/togglhire/recurly" ) var _ recurly.Pager = &Pager{} diff --git a/mock/plans.go b/mock/plans.go index 447856c..6168f62 100644 --- a/mock/plans.go +++ b/mock/plans.go @@ -3,7 +3,7 @@ package mock import ( "context" - "github.com/blacklightcms/recurly" + "github.com/togglhire/recurly" ) var _ recurly.PlansService = &PlansService{} diff --git a/mock/purchases.go b/mock/purchases.go index 5978775..24ac153 100644 --- a/mock/purchases.go +++ b/mock/purchases.go @@ -3,7 +3,7 @@ package mock import ( "context" - "github.com/blacklightcms/recurly" + "github.com/togglhire/recurly" ) var _ recurly.PurchasesService = &PurchasesService{} diff --git a/mock/redemptions.go b/mock/redemptions.go index 5464ef3..abe377c 100644 --- a/mock/redemptions.go +++ b/mock/redemptions.go @@ -3,7 +3,7 @@ package mock import ( "context" - "github.com/blacklightcms/recurly" + "github.com/togglhire/recurly" ) var _ recurly.RedemptionsService = &RedemptionsService{} diff --git a/mock/shipping_address.go b/mock/shipping_address.go index c843f2f..5a11f63 100644 --- a/mock/shipping_address.go +++ b/mock/shipping_address.go @@ -3,7 +3,7 @@ package mock import ( "context" - "github.com/blacklightcms/recurly" + "github.com/togglhire/recurly" ) var _ recurly.ShippingAddressesService = &ShippingAddressesService{} diff --git a/mock/shipping_methods.go b/mock/shipping_methods.go index 73a1c60..7d53dbd 100644 --- a/mock/shipping_methods.go +++ b/mock/shipping_methods.go @@ -3,7 +3,7 @@ package mock import ( "context" - "github.com/blacklightcms/recurly" + "github.com/togglhire/recurly" ) var _ recurly.ShippingMethodsService = &ShippingMethodsService{} diff --git a/mock/subscriptions.go b/mock/subscriptions.go index b6529d8..50cb4d8 100644 --- a/mock/subscriptions.go +++ b/mock/subscriptions.go @@ -4,7 +4,7 @@ import ( "context" "time" - "github.com/blacklightcms/recurly" + "github.com/togglhire/recurly" ) var _ recurly.SubscriptionsService = &SubscriptionsService{} @@ -53,7 +53,7 @@ type SubscriptionsService struct { OnResume func(ctx context.Context, uuid string) (*recurly.Subscription, error) ResumeInvoked bool - OnConvertTrial func(ctx context.Context, uuid string) (*recurly.Subscription, error) + OnConvertTrial func(ctx context.Context, uuid string) (*recurly.Subscription, error) ConvertTrialInvoked bool } @@ -130,4 +130,4 @@ func (m *SubscriptionsService) Resume(ctx context.Context, uuid string) (*recurl func (m *SubscriptionsService) ConvertTrial(ctx context.Context, uuid string) (*recurly.Subscription, error) { m.ConvertTrialInvoked = true return m.OnConvertTrial(ctx, uuid) -} \ No newline at end of file +} diff --git a/mock/transactions.go b/mock/transactions.go index 2c1b09d..2f7583a 100644 --- a/mock/transactions.go +++ b/mock/transactions.go @@ -3,7 +3,7 @@ package mock import ( "context" - "github.com/blacklightcms/recurly" + "github.com/togglhire/recurly" ) var _ recurly.TransactionsService = &TransactionsService{} diff --git a/pager_test.go b/pager_test.go index 7d70a62..9198c9c 100644 --- a/pager_test.go +++ b/pager_test.go @@ -6,8 +6,8 @@ import ( "net/url" "testing" - "github.com/blacklightcms/recurly" "github.com/google/go-cmp/cmp" + "github.com/togglhire/recurly" ) func TestPager(t *testing.T) { diff --git a/plans_test.go b/plans_test.go index 656d112..f049388 100644 --- a/plans_test.go +++ b/plans_test.go @@ -8,8 +8,8 @@ import ( "strconv" "testing" - "github.com/blacklightcms/recurly" "github.com/google/go-cmp/cmp" + "github.com/togglhire/recurly" ) // Ensure structs are encoded to XML properly. diff --git a/purchases_test.go b/purchases_test.go index 554dd9f..7051443 100644 --- a/purchases_test.go +++ b/purchases_test.go @@ -8,8 +8,8 @@ import ( "strconv" "testing" - "github.com/blacklightcms/recurly" "github.com/google/go-cmp/cmp" + "github.com/togglhire/recurly" ) // Ensure structs are encoded to XML properly. diff --git a/recurly.go b/recurly.go index bbc9168..87557c0 100644 --- a/recurly.go +++ b/recurly.go @@ -18,7 +18,7 @@ import ( // apiVersion is the API version in use by this client. // NOTE: v2.19: -// - Parent/child accounts not yet implemented. +// - Parent/child accounts not yet implemented. const apiVersion = "2.27" // uaVersion is the userAgent version sent to Recurly so they can track usage @@ -41,7 +41,7 @@ type Client struct { // userAgent sets the User-Agent header for requests so Recurly can // track usage of the client. - // See https://github.com/blacklightcms/recurly/issues/41 + // See https://github.com/togglhire/recurly/issues/41 userAgent string // Client is the HTTP Client used to communicate with the API. diff --git a/recurly_test.go b/recurly_test.go index 4a0b342..fcf0757 100644 --- a/recurly_test.go +++ b/recurly_test.go @@ -14,8 +14,8 @@ import ( "testing" "time" - "github.com/blacklightcms/recurly" "github.com/google/go-cmp/cmp" + "github.com/togglhire/recurly" ) // MustOpenFile opens a file in the testdata directory. diff --git a/redemptions_test.go b/redemptions_test.go index b23bff6..cf1366e 100644 --- a/redemptions_test.go +++ b/redemptions_test.go @@ -5,8 +5,8 @@ import ( "net/http" "testing" - "github.com/blacklightcms/recurly" "github.com/google/go-cmp/cmp" + "github.com/togglhire/recurly" ) func TestRedemptions_ListAccount(t *testing.T) { diff --git a/shipping_addresses_test.go b/shipping_addresses_test.go index 02f9b79..82cdf30 100644 --- a/shipping_addresses_test.go +++ b/shipping_addresses_test.go @@ -6,8 +6,8 @@ import ( "net/http" "testing" - "github.com/blacklightcms/recurly" "github.com/google/go-cmp/cmp" + "github.com/togglhire/recurly" ) func TestShippingAddresses_ListAccount(t *testing.T) { diff --git a/shipping_methods_test.go b/shipping_methods_test.go index 4ec9767..669322b 100644 --- a/shipping_methods_test.go +++ b/shipping_methods_test.go @@ -6,8 +6,8 @@ import ( "net/http" "testing" - "github.com/blacklightcms/recurly" "github.com/google/go-cmp/cmp" + "github.com/togglhire/recurly" ) func TestShippingMethods_Get(t *testing.T) { diff --git a/subscriptions_test.go b/subscriptions_test.go index 611f629..0f85b35 100644 --- a/subscriptions_test.go +++ b/subscriptions_test.go @@ -9,8 +9,8 @@ import ( "testing" "time" - "github.com/blacklightcms/recurly" "github.com/google/go-cmp/cmp" + "github.com/togglhire/recurly" ) // Ensure structs are encoded to XML properly. diff --git a/transactions_test.go b/transactions_test.go index a92e183..0ef4bf5 100644 --- a/transactions_test.go +++ b/transactions_test.go @@ -8,8 +8,8 @@ import ( "testing" "time" - "github.com/blacklightcms/recurly" "github.com/google/go-cmp/cmp" + "github.com/togglhire/recurly" ) func TestTransactions_List(t *testing.T) { diff --git a/webhooks/charge_invoices.go b/webhooks/charge_invoices.go index 5716d4c..680ca41 100644 --- a/webhooks/charge_invoices.go +++ b/webhooks/charge_invoices.go @@ -3,7 +3,7 @@ package webhooks import ( "encoding/xml" - "github.com/blacklightcms/recurly" + "github.com/togglhire/recurly" ) // Charge invoice notifications. diff --git a/webhooks/credit_invoices.go b/webhooks/credit_invoices.go index 6160502..b62edb9 100644 --- a/webhooks/credit_invoices.go +++ b/webhooks/credit_invoices.go @@ -3,7 +3,7 @@ package webhooks import ( "encoding/xml" - "github.com/blacklightcms/recurly" + "github.com/togglhire/recurly" ) // Credit invoice notifications. diff --git a/webhooks/credit_payments.go b/webhooks/credit_payments.go index 78df0cb..2c0b45e 100644 --- a/webhooks/credit_payments.go +++ b/webhooks/credit_payments.go @@ -3,7 +3,7 @@ package webhooks import ( "encoding/xml" - "github.com/blacklightcms/recurly" + "github.com/togglhire/recurly" ) // Credit payment notifications. diff --git a/webhooks/dunning_events.go b/webhooks/dunning_events.go index f89dbdd..9e19557 100644 --- a/webhooks/dunning_events.go +++ b/webhooks/dunning_events.go @@ -1,6 +1,6 @@ package webhooks -import "github.com/blacklightcms/recurly" +import "github.com/togglhire/recurly" // Dunning event constants. const ( diff --git a/webhooks/payments.go b/webhooks/payments.go index 8887e0e..ba7a6bb 100644 --- a/webhooks/payments.go +++ b/webhooks/payments.go @@ -3,7 +3,7 @@ package webhooks import ( "encoding/xml" - "github.com/blacklightcms/recurly" + "github.com/togglhire/recurly" ) // Payment notifications. diff --git a/webhooks/subscriptions.go b/webhooks/subscriptions.go index 6bd649b..0b69af1 100644 --- a/webhooks/subscriptions.go +++ b/webhooks/subscriptions.go @@ -1,6 +1,6 @@ package webhooks -import "github.com/blacklightcms/recurly" +import "github.com/togglhire/recurly" // Subscription notifications. // https://dev.recurly.com/page/webhooks#subscription-notifications diff --git a/webhooks/webhooks_test.go b/webhooks/webhooks_test.go index 7f1739b..bc16080 100644 --- a/webhooks/webhooks_test.go +++ b/webhooks/webhooks_test.go @@ -6,9 +6,9 @@ import ( "testing" "time" - "github.com/blacklightcms/recurly" - "github.com/blacklightcms/recurly/webhooks" "github.com/google/go-cmp/cmp" + "github.com/togglhire/recurly" + "github.com/togglhire/recurly/webhooks" ) func TestParse_BillingInfoUpdatedNotification(t *testing.T) { diff --git a/xml_test.go b/xml_test.go index 8fa28ba..05c29de 100644 --- a/xml_test.go +++ b/xml_test.go @@ -5,8 +5,8 @@ import ( "encoding/xml" "testing" - "github.com/blacklightcms/recurly" "github.com/google/go-cmp/cmp" + "github.com/togglhire/recurly" ) func TestXML_NullBool(t *testing.T) {