Przeglądaj źródła

Use pointer for trialspec

Mauricio Araujo 2 lat temu
rodzic
commit
b32c2b99f4
2 zmienionych plików z 2 dodań i 2 usunięć
  1. 1 1
      api/types/billing_metronome.go
  2. 1 1
      internal/billing/metronome.go

+ 1 - 1
api/types/billing_metronome.go

@@ -36,7 +36,7 @@ type AddCustomerPlanRequest struct {
 	// NetPaymentTermDays is the number of days after issuance of invoice after which the invoice is due
 	NetPaymentTermDays int `json:"net_payment_terms_days,omitempty"`
 	// Trial is the trial period for the plan
-	Trial TrialSpec `json:"trial_spec,omitempty"`
+	Trial *TrialSpec `json:"trial_spec,omitempty"`
 }
 
 // TrialSpec is the trial period for the plan

+ 1 - 1
internal/billing/metronome.go

@@ -133,7 +133,7 @@ func (m MetronomeClient) addCustomerPlan(ctx context.Context, customerID uuid.UU
 	}
 
 	if trialDays != 0 {
-		req.Trial = types.TrialSpec{
+		req.Trial = &types.TrialSpec{
 			LengthInDays: int64(trialDays),
 		}
 	}