@@ -285,8 +285,8 @@ func (s *Service) Create(ctx context.Context, ch Checkout) (Checkout, error) {
285285 quantity = userCount
286286 }
287287 itemParams := & stripe.CheckoutSessionLineItemParams {
288- Price : stripe . String (productPrice .ProviderID ),
289- Quantity : stripe . Int64 (quantity ),
288+ Price : new (productPrice.ProviderID ),
289+ Quantity : new (quantity ),
290290 }
291291 subsItems = append (subsItems , itemParams )
292292 }
@@ -302,7 +302,7 @@ func (s *Service) Create(ctx context.Context, ch Checkout) (Checkout, error) {
302302 return Checkout {}, err
303303 }
304304 if plan .TrialDays > 0 && ! ch .SkipTrial && ! userHasTrialedBefore {
305- trialDays = stripe . Int64 (plan .TrialDays )
305+ trialDays = new (plan.TrialDays )
306306 }
307307
308308 // create subscription checkout link
@@ -311,10 +311,10 @@ func (s *Service) Create(ctx context.Context, ch Checkout) (Checkout, error) {
311311 Context : ctx ,
312312 },
313313 AutomaticTax : & stripe.CheckoutSessionAutomaticTaxParams {
314- Enabled : stripe . Bool (s .stripeAutoTax ),
314+ Enabled : new (s.stripeAutoTax ),
315315 },
316- Currency : stripe . String (billingCustomer .Currency ),
317- Customer : stripe . String (billingCustomer .ProviderID ),
316+ Currency : new (billingCustomer.Currency ),
317+ Customer : new (billingCustomer.ProviderID ),
318318 LineItems : subsItems ,
319319 Metadata : map [string ]string {
320320 "org_id" : billingCustomer .OrgID ,
@@ -324,11 +324,11 @@ func (s *Service) Create(ctx context.Context, ch Checkout) (Checkout, error) {
324324 "managed_by" : "frontier" ,
325325 },
326326 CustomerUpdate : & stripe.CheckoutSessionCustomerUpdateParams {
327- Address : stripe . String (addressCollectionParam ),
327+ Address : new (addressCollectionParam ),
328328 },
329329 Mode : stripe .String (string (stripe .CheckoutSessionModeSubscription )),
330330 SubscriptionData : & stripe.CheckoutSessionSubscriptionDataParams {
331- Description : stripe . String (fmt .Sprintf ("Checkout for %s" , plan .Name )),
331+ Description : new (fmt.Sprintf ("Checkout for %s" , plan .Name )),
332332 Metadata : map [string ]string {
333333 "org_id" : billingCustomer .OrgID ,
334334 CheckoutIDMetadataKey : checkoutID ,
@@ -342,10 +342,10 @@ func (s *Service) Create(ctx context.Context, ch Checkout) (Checkout, error) {
342342 },
343343 },
344344 },
345- AllowPromotionCodes : stripe . Bool (true ),
346- CancelURL : stripe . String (ch .CancelUrl ),
347- SuccessURL : stripe . String (ch .SuccessUrl ),
348- ExpiresAt : stripe . Int64 (time .Now ().Add (SessionValidity ).Unix ()),
345+ AllowPromotionCodes : new (true ),
346+ CancelURL : new (ch.CancelUrl ),
347+ SuccessURL : new (ch.SuccessUrl ),
348+ ExpiresAt : new (time.Now ().Add (SessionValidity ).Unix ()),
349349 PaymentMethodCollection : stripe .String (string (stripe .PaymentLinkPaymentMethodCollectionIfRequired )),
350350 })
351351 if err != nil {
@@ -408,17 +408,17 @@ func (s *Service) Create(ctx context.Context, ch Checkout) (Checkout, error) {
408408 continue
409409 }
410410 itemParams := & stripe.CheckoutSessionLineItemParams {
411- Price : stripe . String (productPrice .ProviderID ),
411+ Price : new (productPrice.ProviderID ),
412412 AdjustableQuantity : & stripe.CheckoutSessionLineItemAdjustableQuantityParams {
413- Enabled : stripe . Bool (adjustableQuantity ),
413+ Enabled : new (adjustableQuantity ),
414414 },
415415 }
416416 if adjustableQuantity {
417- itemParams .AdjustableQuantity .Minimum = stripe . Int64 (minQ )
418- itemParams .AdjustableQuantity .Maximum = stripe . Int64 (maxQ )
417+ itemParams .AdjustableQuantity .Minimum = new (minQ )
418+ itemParams .AdjustableQuantity .Maximum = new (maxQ )
419419 }
420420 if productPrice .UsageType == product .PriceUsageTypeLicensed {
421- itemParams .Quantity = stripe . Int64 (defaultQ )
421+ itemParams .Quantity = new (defaultQ )
422422 }
423423
424424 if productPrice .Currency == s .defaultCurrency {
@@ -435,7 +435,7 @@ func (s *Service) Create(ctx context.Context, ch Checkout) (Checkout, error) {
435435 var paymentMethodTypes []* string
436436 for _ , paymentMethodConfig := range s .paymentMethodConfig {
437437 if paymentMethodConfig .IsAllowedForAmount (amountSubtotal ) {
438- paymentMethodTypes = append (paymentMethodTypes , stripe . String (paymentMethodConfig .Type ))
438+ paymentMethodTypes = append (paymentMethodTypes , new (paymentMethodConfig.Type ))
439439 }
440440 }
441441
@@ -445,12 +445,12 @@ func (s *Service) Create(ctx context.Context, ch Checkout) (Checkout, error) {
445445 Context : ctx ,
446446 },
447447 AutomaticTax : & stripe.CheckoutSessionAutomaticTaxParams {
448- Enabled : stripe . Bool (s .stripeAutoTax ),
448+ Enabled : new (s.stripeAutoTax ),
449449 },
450- Currency : stripe . String (s .defaultCurrency ),
451- Customer : stripe . String (billingCustomer .ProviderID ),
450+ Currency : new (s.defaultCurrency ),
451+ Customer : new (billingCustomer.ProviderID ),
452452 InvoiceCreation : & stripe.CheckoutSessionInvoiceCreationParams {
453- Enabled : stripe . Bool (true ),
453+ Enabled : new (true ),
454454 },
455455 LineItems : subsItems ,
456456 Mode : stripe .String (string (stripe .CheckoutSessionModePayment )),
@@ -463,12 +463,12 @@ func (s *Service) Create(ctx context.Context, ch Checkout) (Checkout, error) {
463463 "managed_by" : "frontier" ,
464464 },
465465 CustomerUpdate : & stripe.CheckoutSessionCustomerUpdateParams {
466- Address : stripe . String (addressCollectionParam ),
466+ Address : new (addressCollectionParam ),
467467 },
468- AllowPromotionCodes : stripe . Bool (true ),
469- CancelURL : stripe . String (ch .CancelUrl ),
470- SuccessURL : stripe . String (ch .SuccessUrl ),
471- ExpiresAt : stripe . Int64 (time .Now ().Add (SessionValidity ).Unix ()),
468+ AllowPromotionCodes : new (true ),
469+ CancelURL : new (ch.CancelUrl ),
470+ SuccessURL : new (ch.SuccessUrl ),
471+ ExpiresAt : new (time.Now ().Add (SessionValidity ).Unix ()),
472472 PaymentMethodTypes : paymentMethodTypes ,
473473 PaymentMethodOptions : & stripe.CheckoutSessionPaymentMethodOptionsParams {
474474 CustomerBalance : & stripe.CheckoutSessionPaymentMethodOptionsCustomerBalanceParams {
@@ -554,7 +554,7 @@ func (s *Service) SyncWithProvider(ctx context.Context, customerID string) error
554554 Context : ctx ,
555555 },
556556 Expand : []* string {
557- stripe . String ("line_items.data.price.product" ),
557+ new ("line_items.data .price.product "),
558558 },
559559 })
560560 if err != nil {
@@ -782,12 +782,12 @@ func (s *Service) CreateSessionForPaymentMethod(ctx context.Context, ch Checkout
782782 Params : stripe.Params {
783783 Context : ctx ,
784784 },
785- Customer : stripe . String (billingCustomer .ProviderID ),
786- Currency : stripe . String (billingCustomer .Currency ),
785+ Customer : new (billingCustomer.ProviderID ),
786+ Currency : new (billingCustomer.Currency ),
787787 Mode : stripe .String (string (stripe .CheckoutSessionModeSetup )),
788- CancelURL : stripe . String (ch .CancelUrl ),
789- SuccessURL : stripe . String (ch .SuccessUrl ),
790- ExpiresAt : stripe . Int64 (time .Now ().Add (SessionValidity ).Unix ()),
788+ CancelURL : new (ch.CancelUrl ),
789+ SuccessURL : new (ch.SuccessUrl ),
790+ ExpiresAt : new (time.Now ().Add (SessionValidity ).Unix ()),
791791 Metadata : map [string ]string {
792792 "org_id" : billingCustomer .OrgID ,
793793 "checkout_id" : checkoutID ,
@@ -827,11 +827,11 @@ func (s *Service) CreateSessionForCustomerPortal(ctx context.Context, ch Checkou
827827 Params : stripe.Params {
828828 Context : ctx ,
829829 },
830- Customer : stripe . String (billingCustomer .ProviderID ),
830+ Customer : new (billingCustomer.ProviderID ),
831831 }
832832
833833 if ch .CancelUrl != "" {
834- sessionParams .ReturnURL = stripe . String (ch .CancelUrl )
834+ sessionParams .ReturnURL = new (ch.CancelUrl )
835835 }
836836
837837 session , err := s .stripeClient .BillingPortalSessions .New (sessionParams )
@@ -870,7 +870,7 @@ func (s *Service) Apply(ctx context.Context, ch Checkout) (*subscription.Subscri
870870 }
871871
872872 autoTaxParams := & stripe.SubscriptionAutomaticTaxParams {
873- Enabled : stripe . Bool (s .stripeAutoTax ),
873+ Enabled : new (s.stripeAutoTax ),
874874 }
875875
876876 // checkout could be for a plan or a product
@@ -929,8 +929,8 @@ func (s *Service) Apply(ctx context.Context, ch Checkout) (*subscription.Subscri
929929 }
930930
931931 itemParams := & stripe.SubscriptionItemsParams {
932- Price : stripe . String (productPrice .ProviderID ),
933- Quantity : stripe . Int64 (quantity ),
932+ Price : new (productPrice.ProviderID ),
933+ Quantity : new (quantity ),
934934 Metadata : map [string ]string {
935935 "org_id" : billingCustomer .OrgID ,
936936 "product_id" : planProduct .ID ,
@@ -946,28 +946,28 @@ func (s *Service) Apply(ctx context.Context, ch Checkout) (*subscription.Subscri
946946
947947 var trialDays * int64 = nil
948948 if plan .TrialDays > 0 && ! ch .SkipTrial {
949- trialDays = stripe . Int64 (plan .TrialDays )
949+ trialDays = new (plan.TrialDays )
950950 }
951951
952952 if totalExpectedPrice == 0 {
953953 // if total price is 0, disable auto tax. This ensures that when the subscription is created without
954954 // user billing details while onboarding, creating 0 amount invoice doesn't fail
955955 // This will be toggled back on when the user changes it's plan to a paid one
956- autoTaxParams .Enabled = stripe . Bool (false )
956+ autoTaxParams .Enabled = new (false )
957957 }
958958
959959 var couponID * string
960960 if ch .ProviderCouponID != "" {
961- couponID = stripe . String (ch .ProviderCouponID )
961+ couponID = new (ch.ProviderCouponID )
962962 }
963963 // create subscription directly
964964 stripeSubscription , err := s .stripeClient .Subscriptions .New (& stripe.SubscriptionParams {
965965 Params : stripe.Params {
966966 Context : ctx ,
967967 },
968968 AutomaticTax : autoTaxParams ,
969- Customer : stripe . String (billingCustomer .ProviderID ),
970- Currency : stripe . String (billingCustomer .Currency ),
969+ Customer : new (billingCustomer.ProviderID ),
970+ Currency : new (billingCustomer.Currency ),
971971 Items : subsItems ,
972972 Metadata : map [string ]string {
973973 "org_id" : billingCustomer .OrgID ,
0 commit comments