@@ -2054,15 +2054,21 @@ export class GitpodServerEEImpl extends GitpodServerImpl {
2054
2054
}
2055
2055
2056
2056
async createOrUpdateStripeCustomerForTeam ( ctx : TraceContext , teamId : string , currency : string ) : Promise < void > {
2057
+ log . warn ( `XXXX: createOrUpdateStripeCustomerForTeam ${ teamId } ${ currency } ` ) ;
2057
2058
const user = this . checkAndBlockUser ( "createOrUpdateStripeCustomerForTeam" ) ;
2058
2059
const team = await this . guardTeamOperation ( teamId , "update" ) ;
2059
2060
await this . ensureStripeApiIsAllowed ( { team } ) ;
2060
2061
try {
2062
+ log . warn ( "XXXX: looking for existing customer" ) ;
2061
2063
let customer = await this . stripeService . findCustomerByTeamId ( team ! . id ) ;
2062
2064
if ( ! customer ) {
2065
+ log . warn ( "XXXX: no customer, creating one..." ) ;
2063
2066
customer = await this . stripeService . createCustomerForTeam ( user , team ! ) ;
2067
+ log . warn ( "XXXX: created" ) ;
2064
2068
}
2069
+ log . warn ( "XXXX: setting the currency..." ) ;
2065
2070
await this . stripeService . setPreferredCurrencyForCustomer ( customer , currency ) ;
2071
+ log . warn ( "XXXX: currency set" ) ;
2066
2072
} catch ( error ) {
2067
2073
log . error ( `Failed to update Stripe customer profile for team '${ teamId } '` , error ) ;
2068
2074
throw new ResponseError (
@@ -2074,15 +2080,19 @@ export class GitpodServerEEImpl extends GitpodServerImpl {
2074
2080
2075
2081
protected defaultSpendingLimit = 100 ;
2076
2082
async subscribeTeamToStripe ( ctx : TraceContext , teamId : string , setupIntentId : string ) : Promise < void > {
2083
+ log . warn ( `XXXX: subscribeTeamToStripe ${ teamId } ` ) ;
2077
2084
this . checkAndBlockUser ( "subscribeUserToStripe" ) ;
2078
2085
const team = await this . guardTeamOperation ( teamId , "update" ) ;
2079
2086
await this . ensureStripeApiIsAllowed ( { team } ) ;
2080
2087
try {
2088
+ log . warn ( "XXXX: sub looking for existing customer" ) ;
2081
2089
let customer = await this . stripeService . findCustomerByTeamId ( team ! . id ) ;
2082
2090
if ( ! customer ) {
2083
2091
throw new Error ( `No Stripe customer profile for team '${ team . id } '` ) ;
2084
2092
}
2093
+ log . warn ( "XXXX: sub setting default payment method" ) ;
2085
2094
await this . stripeService . setDefaultPaymentMethodForCustomer ( customer , setupIntentId ) ;
2095
+ log . warn ( "XXXX: sub creating subscription" ) ;
2086
2096
await this . stripeService . createSubscriptionForCustomer ( customer ) ;
2087
2097
2088
2098
const attributionId = AttributionId . render ( { kind : "team" , teamId } ) ;
0 commit comments