No description
Find a file
2023-07-21 12:10:44 -04:00
src Initial commit 2021-09-02 14:14:54 -04:00
tests Initial commit 2021-09-02 14:14:54 -04:00
README.md Add POST example to README 2023-07-21 12:10:44 -04:00
stripe.nimble Initial commit 2021-09-02 14:14:54 -04:00

Very basic interface for interacting with Stripe.

GET example:

import stripe

proc main() {.async.} =
  let secret_key = "..."
  let client = newStripeClient(secret_key)
  let products = await stripeClient.get("/v1/products")
  echo $products

POST example:

import stripe
import std/tables

proc main {.async.} =
  let secret_key = "..."
  let stripeClient = newStripeClient(secret_key)
  let charge = await stripeClient.post("/v1/charges", {
        "amount": 1000,
        "currency": "usd",
        "description": "A Charge",
        "statement_descriptor": "Widget You Forgot Purchasing",
        "receipt_email": "bob@example.com",
        "source": "stripeToken",
      }.toTable())