houdiniproject / houdini

Free and open source fundraising infrastructure for nonprofits and NGOs
https://houdiniproject.org
Other
182 stars 94 forks source link

REST API around subtransactions and payments #730

Open wwahammy opened 2 years ago

wwahammy commented 2 years ago

Discussed in https://github.com/houdiniproject/houdini/discussions/719

Originally posted by **wwahammy** September 7, 2021 I'm looking into developing the REST API around subtransactions and payments. As implemented in #684, you can list the transactions for a nonprofit by calling: `GET /api/nonprofits/:nonprofit_id/transactions` Or you can get the information about a specific transaction by calling `GET /api/nonprofits/:nonprofit_id/transactions/:id` How should we get subtransactions though? Or payments? ## Proposal **To get the subtransactions for a transaction:** `GET /api/nonprofits/:nonprofit_id/transactions/:transaction_id/subtransaction` **To get all payments for a subtransaction:** `GET /api/nonprofits/:nonprofit_id/transactions/:transaction_id/subtransaction/payments` **To get a payment on a subtransaction:** `GET /api/nonprofits/:nonprofit_id/transactions/:transaction_id/subtransaction/payments/:id` **NOTE: this is the canonical URL for a payment. **To get all payments on a transaction:** `GET /api/nonprofits/:nonprofit_id/transactions/:transaction_id/payments` NOTE: the urls in the JSON will display the canoncial URLs. **To get a payment on a transaction:** `GET /api/nonprofits/:nonprofit_id/transactions/:transaction_id/payments/:id` *NOTE: the url in the JSON will display the canonical URL for the payment, NOT this URL* What do folks think? Does this make sense? @clarissalimab?
wwahammy commented 2 years ago

I edited this because I remembered: you can't have multiple subtransactions on a transaction, only one.