Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Switch to Trolley for Modrinth Payments #727

Merged
merged 14 commits into from
Oct 11, 2023
Merged

Switch to Trolley for Modrinth Payments #727

merged 14 commits into from
Oct 11, 2023

Conversation

Geometrically
Copy link
Member

@Geometrically Geometrically commented Oct 10, 2023

Switches to trolley as our payout provider.

Fixes MOD-530

Copy link
Contributor

@OmegaJak OmegaJak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just minor nitpicks about names/organization largely.

src/routes/analytics.rs Outdated Show resolved Hide resolved
src/auth/flows.rs Outdated Show resolved Hide resolved
src/auth/flows.rs Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
src/models/projects.rs Show resolved Hide resolved
src/queue/payouts.rs Outdated Show resolved Hide resolved
src/queue/payouts.rs Outdated Show resolved Hide resolved
src/queue/payouts.rs Outdated Show resolved Hide resolved
src/queue/payouts.rs Outdated Show resolved Hide resolved
if &*request_signature == v1 {
let webhook = serde_json::from_slice::<TrolleyWebhook>(&payload)?;

if webhook.model == "recipient" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inside of this if statement and the next one would make great separate methods (trolley_recipient_webhook and trolley_payment_webhook or something).

These several hundred line methods are not ideal

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once that's done, that also opens the door to doing some more focused tests where we supply it with a TrolleyWebhook with data we formed to be like what we would actually get from Trolley and make sure we update the database correctly in response. This lets us test parts of this flow easily without actually integrating with Trolley.

src/queue/payouts.rs Outdated Show resolved Hide resolved
@Geometrically Geometrically merged commit 07ecd13 into master Oct 11, 2023
9 checks passed
@Geometrically Geometrically deleted the trolley-wip branch October 11, 2023 22:55
thesuzerain pushed a commit that referenced this pull request Dec 5, 2023
* most of trolley

* Switch to trolley for payments

* run prepare

* fix clippy

* fix more

* Fix most tests + bitflags

* Update src/auth/flows.rs

Co-authored-by: Jackson Kruger <[email protected]>

* Finish trolley

* run prep for merge

* Update src/queue/payouts.rs

Co-authored-by: Jackson Kruger <[email protected]>

---------

Co-authored-by: Jackson Kruger <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants