This repository has been archived by the owner on Oct 31, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding handling of updating a plaid link.
Adding wrapper for caching stripe prices.
- Loading branch information
1 parent
4176a41
commit 143a183
Showing
4 changed files
with
174 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package stripe_helper | ||
|
||
import ( | ||
"context" | ||
"github.com/stripe/stripe-go/v72" | ||
) | ||
|
||
type StripeCache interface { | ||
GetPriceById(ctx context.Context, id string) (*stripe.Price, bool) | ||
CachePrice(ctx context.Context, price stripe.Price) bool | ||
Close() error | ||
} | ||
|
||
var ( | ||
_ StripeCache = &noopStripeCache{} | ||
) | ||
|
||
type noopStripeCache struct{} | ||
|
||
func (n *noopStripeCache) GetPriceById(ctx context.Context, id string) (*stripe.Price, bool) { | ||
return nil, false | ||
} | ||
|
||
func (n *noopStripeCache) CachePrice(ctx context.Context, price stripe.Price) bool { | ||
return false | ||
} | ||
|
||
func (n *noopStripeCache) Close() error { | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters