Problem/Motivation

When linking an account with a Patreon, the PatreonBridge calls getRelatedRewards() to look up the titles of the tiers the user could potentially be subscribed to.

The problem is that the Patreon Bridge method getRelatedRewards() assumes that a Campaign result is being passed in, which has an array of relationships.rewards.data.

But, when calling that method via patreon_user_assign_roles(), we are passing in the user's Pledge, and the API Response for a Pledge resource includes the singular relationships.reward.data.

"relationships": {
    "patron": ...<user>...
    "reward": ...<reward>...
    "creator": ...<user>...
    "address": ...<address>...
  }

Proposed resolution

Create a new API method getPledgeReward() and update patreon_user_assign_roles() to utilize it.

Remaining tasks

Review and test.

User interface changes

None.

API changes

New method getPledgeReward().

Data model changes

None.

CommentFileSizeAuthor
patreon-return-pledge-reward.patch2.4 KBtorgospizza

Comments

torgosPizza created an issue. See original summary.

torgospizza’s picture

Issue summary: View changes

Minor re-wording.

torgospizza’s picture

Issue summary: View changes

mrdalesmith’s picture

Cheers for the patch: I've committed into a new dev version of 7.2 to allow for testing.

mrdalesmith’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.