Skip to content
Snippets Groups Projects
Select Git revision
  • upgrade-to-nixos-25.05
  • develop default protected
  • production protected
  • nixpkgs-upgrade-2024-12-23
  • 190-our-regular-updates-fill-up-the-servers-boot-partitions
  • nixpkgs-upgrade-2024-10-14
  • hro-cloud protected
  • 162.flexible-grafana-module
  • nixpkgs-upgrade-2024-05-13
  • nixpkgs-upgrade-2024-04-22
  • nixpkgs-upgrade-2024-03-25
  • nixpkgs-upgrade-2024-03-18
  • nixpkgs-upgrade-2024-03-11
  • nixpkgs-upgrade-2024-03-04
  • 163.jp-to-ben-for-prod
  • nixpkgs-upgrade-2024-02-26
  • 164.grafana-alert-rules
  • 157.authorize-new-hro-key
  • nixpkgs-upgrade-2024-02-19
  • nixpkgs-upgrade-2024-02-12
20 results

PrivateStorageio

  • Clone with SSH
  • Clone with HTTPS
  • PaymentServer

    PaymentServer maintains the state of a voucher database with respect to payments. It receives payment notifications from payment processors and notes this in the database.

    Currently, Stripe is supported.

    Building

    Build using Stack:

    $ stack build

    Testing

    You can perform manual integration testing against Stripe. First, run the server:

    $ stack run

    Then configure Stripe with a webhook pointing at the server and receiving the charge.successful event. Configure Stripe with http://<youraddress>:8081/v1/stripe/webhook.

    Then create a testing charge using Stripe:

    $ STRIPE_SECRET_KEY=sk_test_...
    $ curl \
      https://api.stripe.com/v1/charges   \
      -u ${STRIPE_SECRET_KEY}:   \
      -d amount=999   \
      -d currency=usd   \
      -d source=tok_visa   \
      -d 'metadata[Voucher]=abcdefghijk'

    This results in Stripe making a callback to the PaymentServer with the charge details. The PaymentServer marks the voucher as paid in its database.