Обновите плагин Patreon для Discourse до API v2

Hey folks :waving_hand:

The Patreon Discourse plugin is still using Patreon’s API v1, which has been deprecated for several years. To keep the integration working properly, it needs to be updated to use API v2.

Patreon’s API v2 is the supported version and provides equivalent functionality to v1, along with a more consistent data model and improved resource relationships.
Docs:

Key migration notes:

  • Some API calls currently using /api/oauth2/ will need to be updated to the v2 endpoints.

  • The users of the plugin will need to create new Patreon OAuth clients with v2 scopes during the migration. v1 clients aren’t compatible.

  • The data structure (e.g. campaign, member, pledge) is modeled differently in v2.

I would like to know what’s the process for these kind of updates. Happy to help with guidance on this migration.

Thanks for maintaining this integration :folded_hands:

2 лайка

I wanted to follow up on this topic. Is this plugin still being actively maintained, or should we assume it is inactive and accept that the termination of the v1 API will result in the plugin no longer working?

1 лайк

Yes. I believe it is still actively maintained, as it’s an official plugin, has been included-in-core, and has the most recent commit only last week.

1 лайк

Last time we researched into this, Patreon had disbanded the team doing API v2 midway, so the API v1 would work indefinitely.

Can you link to any resources saying otherwise?

1 лайк

Thanks for getting back on this! Source on this - I’m an engineer on the Patreon team. Our public documentation and client creation flow have callouts about v1 deprecation. V2 has been the main API for about 5+ years, discourse is one of the last integrations that still isn’t using it.

EDIT: Feel free to DM or email (in case I don’t get notifications from discourse) if y’all need additional information.

6 лайков

Hi @Falco any updates / plans updating plugin? We would like to minimize the impact of killing v1. Thanks.

3 лайка

I will take a stab on updating next week. Can we get some testing credentials?

4 лайка

Awesome @falco, I appreciate that! Patreon does not have public testing users. The best way I would suggest testing this would be to:

  1. Create your test account (https://www.patreon.com/login) and verify your email.
  2. Only creators are allowed to create OAuth clients. You would need to launch your creator campaign by visiting https://patreon.com/create (email has to be verified to consider the campaign launched).
  3. Create a test tier https://patreon.com/c/yourvanity/membership.
  4. You can now create the v2 api client at https://www.patreon.com/portal/registration/register-clients

To test access gating / membership features you would create a separate test account. You could then either pledge to the free tier of your test campaign or potentially grant a gifted membership from the creator.

I’m happy to respond pair up / help you over DMs next week.

1 лайк

Я не могу заставить эту форму активировать кнопку отправки, что бы я ни пробовал.

Та же проблема, о которой сообщалось здесь:

Это единственное препятствие, мешающее мне объединить изменения:

4 лайка

@Falco мы выпустили исправление для этого сегодня утром, приносим извинения! Можете попробовать снова? Также, здорово — быстрый прогресс! :tada:

2 лайка

Хорошо, на моём тестовом сайте всё работает отлично, я внесу изменения в понедельник утром.

3 лайка

Быстро, спасибо!

Это не связано с обновлением до v2, но общий вопрос, пока вы готовите этот PR — не могли бы вы установить заголовок User Agent в пользовательское значение? Например, Discourse-Patreon-Plugin/vX.x. Это может помочь нам в будущем отлаживать проблемы с API и идентифицировать клиентов. При устаревании v1 я видел множество заголовков User Agent от Faraday, и именно так я выяснил, что Discourse — одно из оставшихся приложений на v1.

2 лайка

Хорошая идея, добавлено в PR.

4 лайка