From 4bd37013638986119628f50396f925c69e8893ec Mon Sep 17 00:00:00 2001 From: Conor Macpherson Date: Wed, 12 Apr 2023 14:15:11 -0400 Subject: [PATCH] remove new model in favor of making self hosted confirm payment method request more generic. --- model/hosted_customer.go | 10 +++------- server/channels/einterfaces/mocks/CloudInterface.go | 6 +++--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/model/hosted_customer.go b/model/hosted_customer.go index 2337a48569..f4cb8b999f 100644 --- a/model/hosted_customer.go +++ b/model/hosted_customer.go @@ -29,13 +29,9 @@ type SelfHostedCustomerForm struct { } type SelfHostedConfirmPaymentMethodRequest struct { - StripeSetupIntentID string `json:"stripe_setup_intent_id"` - Subscription CreateSubscriptionRequest `json:"subscription"` -} - -type SelfHostedExpansionConfirmPaymentMethodRequest struct { - StripeSetupIntentID string `json:"stripe_setup_intent_id"` - ExpandRequest SelfHostedExpansionRequest `json:"expand_request"` + StripeSetupIntentID string `json:"stripe_setup_intent_id"` + Subscription *CreateSubscriptionRequest `json:"subscription"` + ExpandRequest *SelfHostedExpansionRequest `json:"expand_request"` } // SelfHostedSignupPaymentResponse contains feels needed for self hosted signup to confirm payment and receive license. diff --git a/server/channels/einterfaces/mocks/CloudInterface.go b/server/channels/einterfaces/mocks/CloudInterface.go index b287dc0680..9b133ce079 100644 --- a/server/channels/einterfaces/mocks/CloudInterface.go +++ b/server/channels/einterfaces/mocks/CloudInterface.go @@ -89,11 +89,11 @@ func (_m *CloudInterface) ConfirmCustomerPayment(userID string, confirmRequest * } // ConfirmSelfHostedExpansion provides a mock function with given fields: req, requesterEmail -func (_m *CloudInterface) ConfirmSelfHostedExpansion(req model.SelfHostedExpansionConfirmPaymentMethodRequest, requesterEmail string) (*model.SelfHostedSignupConfirmResponse, error) { +func (_m *CloudInterface) ConfirmSelfHostedExpansion(req model.SelfHostedConfirmPaymentMethodRequest, requesterEmail string) (*model.SelfHostedSignupConfirmResponse, error) { ret := _m.Called(req, requesterEmail) var r0 *model.SelfHostedSignupConfirmResponse - if rf, ok := ret.Get(0).(func(model.SelfHostedExpansionConfirmPaymentMethodRequest, string) *model.SelfHostedSignupConfirmResponse); ok { + if rf, ok := ret.Get(0).(func(model.SelfHostedConfirmPaymentMethodRequest, string) *model.SelfHostedSignupConfirmResponse); ok { r0 = rf(req, requesterEmail) } else { if ret.Get(0) != nil { @@ -102,7 +102,7 @@ func (_m *CloudInterface) ConfirmSelfHostedExpansion(req model.SelfHostedExpansi } var r1 error - if rf, ok := ret.Get(1).(func(model.SelfHostedExpansionConfirmPaymentMethodRequest, string) error); ok { + if rf, ok := ret.Get(1).(func(model.SelfHostedConfirmPaymentMethodRequest, string) error); ok { r1 = rf(req, requesterEmail) } else { r1 = ret.Error(1)