Ver Fonte

Add expiration details

Mauricio Araujo há 2 anos atrás
pai
commit
ecd7f6877b
2 ficheiros alterados com 4 adições e 0 exclusões
  1. 2 0
      api/types/billing.go
  2. 2 0
      internal/billing/stripe.go

+ 2 - 0
api/types/billing.go

@@ -11,4 +11,6 @@ type PaymentMethod = struct {
 	ID           string `json:"id"`
 	ID           string `json:"id"`
 	DisplayBrand string `json:"display_brand"`
 	DisplayBrand string `json:"display_brand"`
 	Last4        string `json:"last4"`
 	Last4        string `json:"last4"`
+	ExpMonth     int64  `json:"exp_month"`
+	ExpYear      int64  `json:"exp_year"`
 }
 }

+ 2 - 0
internal/billing/stripe.go

@@ -73,6 +73,8 @@ func (s *StripeBillingManager) ListPaymentMethod(proj *models.Project) (paymentM
 			ID:           stripePaymentMethod.ID,
 			ID:           stripePaymentMethod.ID,
 			DisplayBrand: stripePaymentMethod.Card.DisplayBrand,
 			DisplayBrand: stripePaymentMethod.Card.DisplayBrand,
 			Last4:        stripePaymentMethod.Card.Last4,
 			Last4:        stripePaymentMethod.Card.Last4,
+			ExpMonth:     stripePaymentMethod.Card.ExpMonth,
+			ExpYear:      stripePaymentMethod.Card.ExpYear,
 		})
 		})
 	}
 	}