Mock stripe calls for tests

I am writing tests and I need to mock stripe calls and I can not mock it. Help!
Thanks :slight_smile:

What do you mean by ‘stripe calls’?

when i want to get stripe customer, charge, invoice or smth

So you talk about https://stripe.com/, right?

Please help us helping you.

  • What do you want to mock: a REST API? Which?
  • Do you use any mocking library? Which? How do you use it?
  • Do you have written any code? Show us the relevant parts.
  • Do you get any errors? Which?
  • What result do you expect? What actual result do you get?

yes about that stripe

i want to mock the hooks i get from stripe
i use github.com/stretchr/testify/mock

type mockClient struct {
	client.API
	mock.Mock
} 

and i override the methods i use

i am getting error that i cant use mockClient as client.API

could you send your code and catched Error?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.