diff --git a/CHANGELOG.md b/CHANGELOG.md index ab9af74b2..49ec5f731 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + +### Added + +- Set the user id in the _Stripe_ callback + ## 1.21.0 - 22.06.2021 ### Changed diff --git a/apps/api/src/app/subscription/subscription.service.ts b/apps/api/src/app/subscription/subscription.service.ts index 02fee3fb4..4f9207922 100644 --- a/apps/api/src/app/subscription/subscription.service.ts +++ b/apps/api/src/app/subscription/subscription.service.ts @@ -38,9 +38,6 @@ export class SubscriptionService { quantity: 1 } ], - metadata: { - user_id: userId - }, mode: 'payment', payment_method_types: ['card'], success_url: `${this.configurationService.get( @@ -81,6 +78,10 @@ export class SubscriptionService { } } }); + + await this.stripe.customers.update(session.customer as string, { + description: session.client_reference_id + }); } catch (error) { console.error(error); }