Saving transaction & customer info
This commit is contained in:
@ -76,7 +76,7 @@ func (c *Card) RetrievePaymentIntent(id string) (*stripe.PaymentIntent, error) {
|
||||
func (c *Card) SubscribeToPlan(
|
||||
cust *stripe.Customer,
|
||||
plan, email, last4, cardType string,
|
||||
) (string, error) {
|
||||
) (*stripe.Subscription, error) {
|
||||
stripeCustomerID := cust.ID
|
||||
items := []*stripe.SubscriptionItemsParams{
|
||||
{Plan: stripe.String(plan)},
|
||||
@ -92,9 +92,9 @@ func (c *Card) SubscribeToPlan(
|
||||
params.AddExpand("latest_invoice.payment_intent")
|
||||
subscription, err := subscription.New(params)
|
||||
if err != nil {
|
||||
return "", err
|
||||
return nil, err
|
||||
}
|
||||
return subscription.ID, nil
|
||||
return subscription, nil
|
||||
}
|
||||
|
||||
func (c *Card) CreateCustomer(pm, email string) (*stripe.Customer, string, error) {
|
||||
|
Reference in New Issue
Block a user