lukec / stripe-perl

Perl library to connect to the Stripe API
https://stripe.com/docs
36 stars 31 forks source link

Sessions? #206

Open youradds opened 4 years ago

youradds commented 4 years ago

Hi,

Great module. Are we able to use sessions?

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

Cheers

Andy

youradds commented 4 years ago

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',
  ]);
sherrardb commented 4 years ago

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

youradds commented 4 years ago

@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 :)

sherrardb commented 4 years ago

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.

youradds commented 4 years ago

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

cjavilla-stripe commented 3 years ago

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!

andrewsolomon commented 3 years ago

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.

cjavilla-stripe commented 3 years ago

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 🙏

sherrardb commented 3 years ago

@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.