We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Go function to fetch Subscriptions:
func FetchSubscriptions() ([]entities.Subscription, error) { var result []entities.Subscription ctx := context.TODO() subscriptions, err := goCardLessClient.Subscriptions.List(ctx, gocardless.SubscriptionListParams{Limit: 100}) if err != nil { log.Println("Error in api.FetchSubscriptions 1:", err) return result, appjoy.ErrSomethingWentWrong } for _, subscription := range subscriptions.Subscriptions { var eSubscription entities.Subscription eSubscription.ID = subscription.Id switch subscription.IntervalUnit { case "weekly": eSubscription.Pricing = fmt.Sprintf("%d€ / w", subscription.Amount/1000) case "monthly": eSubscription.Pricing = fmt.Sprintf("%d€ / m", subscription.Amount/1000) } result = append(result, eSubscription) } return result, nil }
Desired result: getting the subscriptions Actual result: no error is returned, but the slice of Subscriptions is empty.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Go function to fetch Subscriptions:
Desired result: getting the subscriptions
Actual result: no error is returned, but the slice of Subscriptions is empty.
The text was updated successfully, but these errors were encountered: