stripe-perl icon indicating copy to clipboard operation
stripe-perl copied to clipboard

Sessions?

Open youradds opened this issue 5 years ago • 9 comments

Hi,

Great module. Are we able to use sessions?

https://stripe.com/docs/api/checkout/sessions/object

Cheers

Andy

youradds avatar Jun 20 '20 08:06 youradds

Here is the equivalent I'm looking for: (this does what I need in PHP using their API, but I'd rather not use PHP if possible!)

  $test = $stripe->checkout->sessions->create([
    'success_url' => $success_url,
    'cancel_url' => "https://www.foo.com",
    'payment_method_types' => ['card'],
    'line_items' => [
      [
        'price' => 'price_1Gw1wxL5DvJXzJbhuVAb3Les',
        'quantity' => 1,
      ],
    ],
    'metadata' => [
          'who' => $_GET["who"],
          'total' => $_GET["total"],
          'period' => $_GET["period"],
          'description' => $_GET["description"],
          'district' => $_GET["district"],
          'what' => $_GET["what"],
          'ip' => $_SERVER["REMOTE_ADDR"]
    ],
    'mode' => 'subscription' //'payment',
  ]);

youradds avatar Jun 20 '20 09:06 youradds

@youradds, we do not currently support sessions, but i am leaving this open as a reminder to review during the next major push.

sherrardb avatar Jun 21 '20 01:06 sherrardb

@youradds, we do not currently support sessions, but i am leaving this open as a reminder to review during the next major push.

Ah thats a shame. For the moment I've just had to learn a bit of PHP and create the PHP version of my token generator. At least the rest of it (web hooks etc), I can do in Perl :)

youradds avatar Jun 21 '20 06:06 youradds

indeed. depending on your perl skill level and inclination, and especially since you have a real-world use-case, you could consider putting together a pull request, and associated unit tests.

sherrardb avatar Jun 21 '20 13:06 sherrardb

haha I wish I had the time to do that :)

youradds avatar Jun 22 '20 05:06 youradds

Hey @sherrardb,

CJ here from Stripe. We just heard from another user interested in this feature. Curious if there's anything I might be able to do to help get this into stripe-perl :)

Thanks!

cjavilla-stripe avatar Jan 28 '21 23:01 cjavilla-stripe

Hi @cjavilla-stripe,

In case @sherrardb's too shy to say this, he's maintaining stripe-perl in his own time so I recommend that Stripe fund this project to buy a few days out of his tight schedule.

As a Stripe customer using Perl I'd also feel more comfortable if there was steady ongoing support to keep this package up to date.

andrewsolomon avatar Jan 29 '21 00:01 andrewsolomon

Thanks for following up @andrewsolomon,

Curious if @sherrardb could weigh in on future plans with the library. Looks like the last commit was about ~10 months ago. I'm bumping into some odd errors when running the test suite that I suspect are related to the API version used by the Stripe account the test secret keys are pinned to.

I'd be happy to make some contributions if I can get unblocked and run the tests 🙏

cjavilla-stripe avatar Jan 29 '21 19:01 cjavilla-stripe

@cjavilla-stripe sorry for the delay. been tied up with some work projects.

can you provide some detailed output and context for your errors. IIRC, there were some known errors related to modern, threaded perls and one of the sub-sub-dependencies. see: https://github.com/lukec/stripe-perl/issues/202

by all means, i would love for you to be able to contribute. i've been fairly focused on some major projects at work, so i need to go back through some past emails and refamiliarize myself with the roadmap i had started on mentally.

sherrardb avatar Feb 05 '21 21:02 sherrardb