Skip to content
New issue

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

Add opencollective payment POST /pay endpoint #397

Merged
merged 17 commits into from
May 29, 2023
Merged

Conversation

rakici
Copy link
Contributor

@rakici rakici commented May 20, 2023

This pull request implements the POST /pay endpoint as part of #366

Why ?
We want to allow jobsika users to create new job offers only once they have paid for the service.

Steps to verify:

  • move to the backend folder with cd ./backend
  • you need to get an api-key from open-collective, find out more
  • cp .opencollective-env-example .opencollective-env
  • add you api key to the .opencollective-env
  • run make start-api to start the api
  • then run the command curl -vsS -X POST -H 'Content-Type: application/json' -d '{"email":"[email protected]", "tier": "je suis con", "job_offer_id": "1"}' http://localhost:7000/pay | jq you should see something like this
{
  "tier_url": "https://opencollective.com/osscameroon/contribute/jobsika-joboffer-56908"
}

The tier_url is the link to the newly created payment tier.

@rakici rakici changed the title Add opencollective payment Add opencollective payment POST /pay endpoint May 20, 2023
@elhmn elhmn force-pushed the add-opencollective-payments branch from 6a875b8 to 23547ed Compare May 20, 2023 23:50
@elhmn elhmn force-pushed the add-opencollective-payments branch from 8373df3 to 47f049a Compare May 21, 2023 08:37
@rakici
Copy link
Contributor Author

rakici commented May 21, 2023

We can now create a tier using the open collective API and return the URL of that tier to the client.

Next, we want to:

  • Store the job_offer id associated with that payment request. We will use that ID to create the URL the customer will use to update their job_offer. (Add a joboffer_id field in the POST /pay Json body.
  • Setup a webhook that will be notified once the payment is made and send an email to the customer with a link to update
  • Delete the tier once the payment is done
  • Write some tests
  • Write a doc in a new doc folder, on how to run and test the payment system

@elhmn elhmn force-pushed the add-opencollective-payments branch from 1a7df62 to 8ab6bbf Compare May 23, 2023 16:55
@elhmn elhmn force-pushed the add-opencollective-payments branch from d1e27eb to 9e2e545 Compare May 23, 2023 20:59
We now are able to check that a payment was performed, get the user
email, and delete a tier.
@elhmn elhmn force-pushed the add-opencollective-payments branch from 9e2e545 to 676a0e1 Compare May 23, 2023 21:13
@elhmn elhmn force-pushed the add-opencollective-payments branch from 6a36d00 to 1426d57 Compare May 28, 2023 19:57
elhmn added 2 commits May 28, 2023 23:45
Now we can provide the opencollective organisation slug
as an environment variable
@elhmn elhmn force-pushed the add-opencollective-payments branch from 3f57b8b to 423a913 Compare May 28, 2023 21:52
@rakici rakici requested a review from DipandaAser May 28, 2023 21:56
@rakici rakici marked this pull request as ready for review May 28, 2023 21:56
@rakici rakici merged commit ea16fb2 into main May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants