Ask HN: Easiest way to implement payments on my website?

1 points by TekMol ↗ HN
The website I am working on right now is completely static, except for one page that does some serverside work.

What is an easy way to turn that page into a paid service?

Something like this would be perfect:

    <?php

    $token = $_GET['token'];

    if (file_get_contents("https://stripe.com/check?token=$token")!='ok')
        die("Please pay first: https://www.stripe.com/pay?domain=mysite.com");

    # User has paid .. let's do the work ...
If Stripe would send the user to "mysite.com/paidservice.php?token=..." after they paid, all I would need to implement in paidservice.php would be the 3 lines of code above.

But I guess nothing as simple as this exists? If not, what is the closest?

2 comments

[ 0.21 ms ] story [ 13.8 ms ] thread
You can pretty much do what you describe with Stripe Checkout.
Really? Looking at their documentation, it looks like you need to use a code library they provide.