Skip to content

Commit

Permalink
feat: add def pm to update customer
Browse files Browse the repository at this point in the history
  • Loading branch information
StashBank committed Dec 29, 2023
1 parent 0f650f9 commit 7b2eebf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libs/stripe/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@valor/nestjs-stripe",
"version": "0.0.18",
"version": "0.0.19",
"type": "commonjs",
"private": false,
"author": "opavlovskyi-valor-software",
Expand Down
5 changes: 5 additions & 0 deletions libs/stripe/src/lib/dto/update-customer.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,9 @@ export class UpdateCustomerDto {
@IsOptional()
@IsEnum(['exempt', 'none', 'reverse'])
taxExempt?: 'exempt' | 'none' | 'reverse';

@ApiPropertyOptional()
@IsOptional()
@IsString()
defaultPaymentMethod?: string;
}
1 change: 1 addition & 0 deletions libs/stripe/src/lib/stripe.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ export class StripeService {
phone: dto.phone,
address: this.addressFromDto(dto.address),
invoice_prefix: dto.invoicePrefix,
invoice_settings: dto.defaultPaymentMethod ? { default_payment_method: dto.defaultPaymentMethod } : undefined,
metadata:dto.metadata,
preferred_locales: dto.preferredLocales,
promotion_code: dto.promotionCode,
Expand Down

0 comments on commit 7b2eebf

Please sign in to comment.