diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 615b721..57a4b97 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,6 @@ on: env: TEST_API_KEY: ${{secrets.TEST_API_KEY}} TEST_API_PASSWORD: ${{secrets.TEST_API_PASSWORD}} - TEST_DOMAIN: ${{vars.TEST_DOMAIN}} TEST_SUBDOMAIN: ${{vars.TEST_SUBDOMAIN}} jobs: diff --git a/test/component_allocations_test.go b/test/component_allocations_test.go index 91023e4..10f5f01 100644 --- a/test/component_allocations_test.go +++ b/test/component_allocations_test.go @@ -44,13 +44,7 @@ func (s *ComponentAlocationSuite) TestComponentAllocations() { }, }, }, - UnitPrice: models.ToPointer(models.OnOffComponentUnitPriceContainer.FromString("100")), - Prices: []models.Price{ - { - StartingQuantity: models.PriceStartingQuantityContainer.FromNumber(1), - UnitPrice: models.PriceUnitPriceContainer.FromPrecision(1), - }, - }, + UnitPrice: models.OnOffComponentUnitPriceContainer.FromString("100"), }, }, ) diff --git a/test/suite.go b/test/suite.go index e42825b..d20b42b 100644 --- a/test/suite.go +++ b/test/suite.go @@ -17,7 +17,6 @@ import ( type Config struct { APIKey string `env:"TEST_API_KEY,required"` Password string `env:"TEST_API_PASSWORD,required"` - Domain string `env:"TEST_DOMAIN,required"` Subdomain string `env:"TEST_SUBDOMAIN,required"` } @@ -63,8 +62,7 @@ func (s *APISuite) SetupTest() { cfg.Password, ), ), - advancedbilling.WithDomain(cfg.Domain), - advancedbilling.WithSubdomain(cfg.Subdomain), + advancedbilling.WithSite(cfg.Subdomain), ) configUnauthorized := advancedbilling.CreateConfiguration( @@ -74,8 +72,7 @@ func (s *APISuite) SetupTest() { "abc", ), ), - advancedbilling.WithDomain(cfg.Domain), - advancedbilling.WithSubdomain(cfg.Subdomain), + advancedbilling.WithSite(cfg.Subdomain), ) s.client = advancedbilling.NewClient(config) @@ -153,11 +150,11 @@ func (s *APISuite) generateProduct(ctx context.Context, productFamilyID int) mod } func (s *APISuite) generateCoupon(ctx context.Context, productFamilyID int) models.Coupon { - coupon := &models.CreateOrUpdatePercentageCoupon{ + coupon := &models.CouponPayload{ Name: s.fkr.RandomStringWithLength(20), Code: "100OFF" + s.fkr.RandomStringWithLength(30), Description: strPtr(s.fkr.RandomStringWithLength(20)), - Percentage: models.CreateOrUpdatePercentageCouponPercentageContainer.FromString("50"), + Percentage: models.CouponPayloadPercentage.FromString("50"), AllowNegativeBalance: boolPtr(false), Recurring: boolPtr(false), EndDate: timePtr(time.Now().AddDate(1, 0, 0)), @@ -167,8 +164,8 @@ func (s *APISuite) generateCoupon(ctx context.Context, productFamilyID int) mode ApplyOnCancelAtEndOfPeriod: boolPtr(true), } - resp, err := s.client.CouponsController().CreateCoupon(ctx, productFamilyID, &models.CreateOrUpdateCoupon{ - Coupon: models.ToPointer(models.CreateOrUpdateCouponCouponContainer.FromCreateOrUpdatePercentageCoupon(*coupon)), + resp, err := s.client.CouponsController().CreateCoupon(ctx, productFamilyID, &models.CouponRequest{ + Coupon: models.ToPointer(*coupon), }) s.NoError(err)