Skip to content

Commit a4d9b1c

Browse files
committed
Added check that billing cycle anchor is in the future
1 parent f25a753 commit a4d9b1c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/helpers/StripeHelper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export class StripeHelper {
2222
const subscriptionData: any = {
2323
customer,
2424
metadata,
25-
billing_cycle_anchor: billing_cycle_anchor ? billing_cycle_anchor / 1000 : "now",
25+
billing_cycle_anchor: (billing_cycle_anchor && billing_cycle_anchor > new Date().getTime()) ? billing_cycle_anchor / 1000 : "now",
2626
items: [{
2727
price_data: {
2828
currency: 'usd',

0 commit comments

Comments
 (0)