# Integrazione con la nuova versione di Stripe Checkout o Stripe Payment Intents?

**URL:** <https://meta.discourse.org/t/integrating-with-new-stripe-checkout-or-stripe-payment-intents-version/122818>\
**Category:** Development\
**Created:** [12 Luglio 2019, 5:48pm UTC](https://meta.discourse.org/t/integrating-with-new-stripe-checkout-or-stripe-payment-intents-version/122818 "2019-07-12T17:48:54Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [12 Luglio 2019, 6:12pm UTC](https://meta.discourse.org/t/integrating-with-new-stripe-checkout-or-stripe-payment-intents-version/122818/2 "2019-07-12T18:12:34Z")

</div>

Sembra che tu debba chiedere donazioni per aggiornare il tuo plugin delle donazioni. 🙂

Sto lavorando anch’io a un plugin per Stripe. E vedo che è alla `v1`.

EDIT: Oh!, ma forse sono io sulla v3: (in `plugin.rb`):

```plaintext
register_html_builder('server:before-head-close') do
  "<script src='https://js.stripe.com/v3/'></script>"
end

```

> [@ChrisBeach](#):
>
> Questo è problematico perché (per quanto riesco a vedere), entrambe queste API utilizzano un flusso di lavoro più complesso, che richiede al consumatore di interrogare la loro API in attesa del completamento del pagamento o di utilizzare web-hook.

Sono quasi certo che per qualcuno come @angus o @joebuhlig polling e webhook non siano un grosso problema, ma temo di essere arrivato allo stesso punto in cui sei tu. ☹

Ho provato ad aggiornare la Gemma Stripe all’ultima versione in questo modo:

```plaintext
gem 'net-http-persistent', '3.0.1'
gem 'stripe', '4.21.2'

```

ma fallisce così:

```plaintext
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](https://github.com/procourse/procourse-memberships) usa `3.28.0`, ma continua a effettuare chiamate all’API v1.

EDIT: Non vedo un’API `v2`. [API upgrades | Stripe Documentation](https://stripe.com/docs/upgrades#2019-05-16) sembra mostrare ancora `v1`. Ho aggiornato all’ultima versione secondo [Stripe Login | Sign in to the Stripe Dashboard](https://dashboard.stripe.com/test/developers)

---

_[View the full topic](https://meta.discourse.org/t/integrating-with-new-stripe-checkout-or-stripe-payment-intents-version/122818)._
