File tree Expand file tree Collapse file tree
src/infra/adapters/payment-gateway Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,12 +17,12 @@ export class StripeAdapter implements IPaymentGateway {
1717 }
1818
1919 async createCustomer ( user : User ) : Promise < string > {
20- const costumer = await this . stripe . customers . create ( {
20+ const customer = await this . stripe . customers . create ( {
2121 name : user . getName ,
2222 email : user . getEmail . getValue ,
2323 metadata : { userId : user . getId } ,
2424 } ) ;
25- return costumer . id ;
25+ return customer . id ;
2626 }
2727
2828 async charge (
@@ -66,6 +66,8 @@ export class StripeAdapter implements IPaymentGateway {
6666 save_default_payment_method : "on_subscription" ,
6767 } ,
6868 expand : [ "latest_invoice.confirmation_secret" ] ,
69+ collection_method : "charge_automatically" ,
70+ payment_behavior : "default_incomplete" ,
6971 trial_period_days : input . trialPeriodDays ,
7072 } ) ;
7173 const invoice = subscription . latest_invoice as Stripe . Invoice ;
You can’t perform that action at this time.
0 commit comments