snowdrift/tasks
12
1

Stripe integration tests that actually hit the Stripe API #27

Open
opened 2017年07月09日 09:30:30 +02:00 by snowdriftimport · 4 comments
snowdriftimport commented 2017年07月09日 09:30:30 +02:00 (Migrated from gitlab.com)
Copy link

Using our account's test key will allow us to really communicate with Stripe and get real responses (albeit with imaginary money). We should use this to write tests about our Stripe assumptions.

  • Are we calculating the fee correctly?
  • Do the API commands we use exist and respond as we expect them to?

We don't want to spam the crap out of Stripe's servers, so access to the test key (and the ability to run integration tests) will be limited.

Using our account's **test key** will allow us to really communicate with Stripe and get real responses (albeit with imaginary money). We should use this to write tests about our Stripe assumptions. * Are we calculating the fee correctly? * Do the API commands we use exist and respond as we expect them to? We don't want to spam the crap out of Stripe's servers, so access to the test key (and the ability to run integration tests) will be limited.
snowdriftimport commented 2017年07月10日 19:38:05 +02:00 (Migrated from gitlab.com)
Copy link

What does an integration test look like? Perhaps we need 2 separate categories of tests:

  1. Stripe API tests, e.g. check balance, make payment, check balance again, make sure it changed
  2. Integration tests of the whole platform, e.g. get a project's balance, choose a random number of patrons with random attributes etc., run crowdmatch and makePayments simulating some amount of time, check balance again, compare to what the mechanism thinks the balance should now be according to our DB, and to a pure Haskell calculation of how much money is supposed to get paid, make sure all 3 give the same number

By Anatoly on 2017年07月10日T17:39:32 (imported from GitLab project)

What does an integration test look like? Perhaps we need 2 separate categories of tests: 1. Stripe API tests, e.g. check balance, make payment, check balance again, make sure it changed 2. Integration tests of the whole platform, e.g. get a project's balance, choose a random number of patrons with random attributes etc., run crowdmatch and makePayments simulating some amount of time, check balance again, compare to what the mechanism thinks the balance should now be according to our DB, and to a pure Haskell calculation of how much money is supposed to get paid, make sure all 3 give the same number *By Anatoly on 2017年07月10日T17:39:32 (imported from GitLab project)*
snowdriftimport commented 2017年07月12日 03:43:21 +02:00 (Migrated from gitlab.com)
Copy link

I think that makes sense, yes.

By Bryan on 2017年07月12日T01:43:21 (imported from GitLab project)

I think that makes sense, yes. *By Bryan on 2017年07月12日T01:43:21 (imported from GitLab project)*

marked this issue as related to #602

marked this issue as related to #602

changed title from {-Need to implement -}Stripe integration tests that actually hit Stripe API to Stripe integration tests that actually hit {+the +}Stripe API

changed title from **{-Need to implement -}Stripe integration tests that actually hit Stripe API** to **Stripe integration tests that actually hit {+the +}Stripe API**
Sign in to join this conversation.
No Branch/Tag specified
master
master-pre-reset
v0.1.4
v0.1.3
v0.1.2
v0.1.1
release-0.1.0.1
Labels
Clear labels
Blocked
Confidential
We track some issues in a private repo, typically when they contain personal information. In the interest of transparency (and ease of tracking for us), we also keep a stub here in the public issues.
design
Visual design and assets
dev
dev/frontend

Archived

docs
Documentation
finances
Management of financial accounts; Grants and other funding sources
good first issue
Issues that do not require in-depth understanding of background or code
governance
Organisational structure and bylaws
legal
Legal terms, policies and documents
needs-info

Archived

ops
Operations
outreach
Community messaging and recruitment
product/blog
For the blog / Ghost
product/crm
For the CRM / CiviCRM
product/elm-site
Relates to https://codeberg.org/snowdrift/elm-website
product/forum
For the forum / Discourse
product/wiki
product/yesod-site
Relates to https://codeberg.org/snowdrift/snowdrift
research
Research, reference materials and studies
security
Issues about authorisation and authentication
type
bug
Broken feature or regression
type
chore
Housekeeping
type
feature
New feature or functionality
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
snowdrift/tasks#27
Reference in a new issue
snowdrift/tasks
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?