Je monétise mes forums grâce à un plugin Discourse que j’ai développé pour accepter les paiements via Stripe Checkout (version 1).
C’était simple car Stripe gérait l’ensemble du flux de paiement côté client (JavaScript), avec un seul callback en cas de succès ou d’échec du paiement.
Cela pose problème car, à ma connaissance, ces deux API utilisent un flux de travail plus complexe, obligeant le consommateur à interroger régulièrement leur API pour attendre la finalisation du paiement, ou à utiliser des webhooks.
Je suis très inquiet de modifier mon plugin car :
Je ne suis pas un développeur Ruby / Ember très expérimenté (j’ai repris la majeure partie du code d’un plugin existant pour créer le mien)
Je ne sais pas si l’API des plugins Discourse propose un mécanisme adapté pour mettre en œuvre ce type de sondage (où le résultat final est très important)
Est-ce que quelqu’un a de l’expérience concernant a) l’intégration de Stripe V2 Checkout ou de Payment Intents avec Discourse, ou b) la gestion du sondage côté serveur via un plugin Discourse ?
Ça ressemble à une situation où il faudra demander des dons pour mettre à jour votre plugin de dons.
Je travaille moi-même sur un plugin Stripe. Et je vois qu’il est en v1.
EDIT : Oh !, mais peut-être que je suis sur la v3 : (dans plugin.rb) :
register_html_builder('server:before-head-close') do
"<script src='https://js.stripe.com/v3/'></script>"
end
Je suis presque certain que pour des personnes comme @angus ou @joebuhlig, l’interrogation et les webhooks ne posent pas de gros problèmes, mais j’ai peur d’en être au même stade que vous.
J’ai essayé de mettre à jour le gem Stripe vers la dernière version comme ceci :
Traceback (most recent call last):
/home/pfaffman/src/discourse/bin/unicorn: Bootsnap::LoadPathCache::FallbackScan
34: from /home/pfaffman/src/discourse/bin/unicorn:49:in `<main>'
33: from /home/pfaffman/src/discourse/bin/unicorn:49:in `load'
32: from /home/pfaffman/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/unicorn-5.5.1/bin/unicorn:128:in `<top (required)>'
31: from /home/pfaffman/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/unicorn-5.5.1/lib/unicorn/http_server.rb:141:in `start'
30: from /home/pfaffman/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/unicorn-5.5.1/lib/unicorn/http_server.rb:794:in `build_app!'
29: from /home/pfaffman/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/unicorn-5.5.1/lib/unicorn.rb:54:in
`block in builder'
28: from /home/pfaffman/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/unicorn-5.5.1/lib/unicorn.rb:54:in
`eval'
27: from config.ru:1:in `<main>'
26: from config.ru:1:in `new'
25: from /home/pfaffman/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:55:in `initialize'
24: from /home/pfaffman/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/rack-2.0.7/lib/rack/builder.rb:55:in `instance_eval'
23: from config.ru:7:in `block in <main>'
22: from config.ru:7:in `require'
21: from /home/pfaffman/src/discourse/config/environment.rb:4:in `<top (required)>'
20: from /home/pfaffman/src/discourse/config/environment.rb:4:in `require'
19: from /home/pfaffman/src/discourse/config/application.rb:57:in `<top (required)>'
18: from /home/pfaffman/src/discourse/config/application.rb:58:in `<module:Discourse>'
17: from /home/pfaffman/src/discourse/config/application.rb:261:in `<class:Application>'
16: from lib/discourse.rb:168:in `activate_plugins!'
15: from lib/discourse.rb:168:in `each'
14: from lib/discourse.rb:171:in `block in activate_plugins!'
13: from /home/pfaffman/src/discourse/lib/plugin/instance.rb:490:in `activate!'
12: from /home/pfaffman/src/discourse/lib/plugin/instance.rb:490:in `instance_eval'
11: from /home/pfaffman/src/discourse/plugins/lc-billing/plugin.rb:8:in `activate!'
10: from /home/pfaffman/src/discourse/lib/plugin/instance.rb:564:in `gem'
9: from /home/pfaffman/src/discourse/lib/plugin_gem.rb:22:in `load'
8: from /home/pfaffman/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `require'
7: from /home/pfaffman/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:257:in `load_dependency'
6: from /home/pfaffman/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/activesupport-5.2.3/lib/active_support/dependencies.rb:291:in `block in require'
5: from /home/pfaffman/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:26:in `require'
4: from /home/pfaffman/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:40:in `rescue in require'
3: from /home/pfaffman/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
2: from /home/pfaffman/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:89:in `register'
1: from /home/pfaffman/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/home/pfaffman/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/bootsnap-1.4.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require': cannot load such file -- net-http-persistent (LoadError)
procourse memberships utilise 3.28.0, mais cela fait toujours des appels à l’API v1.
@ChrisBeach Heureux de t’aider. Si tu pouvais créer une branche sur le plugin et nous donner un coup de main avec ce que tu arrives à identifier, je travaillerai avec toi / te donnerai des conseils précis pour nous assurer de boucler avant la date limite.