agentleFS
jholhewresjholhewres/devclaw-skills/skills/payments/SKILL.md

payments

Skill4 starsChanged 9 months agoMITView on GitHub

Payment processing — Stripe, PayPal, Lightning Network payments

  • Reads credentials
  • Installs packages
  • Sends data out

We split this skill into the rules it gives an agent

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check: vault_get stripe_secret_key — keys auto-inject as uppercase env vars

    line 22
  2. Distinctive:

    Always use HTTPS for payment APIs

    line 156

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Payments

Process payments using various payment providers.

Setup

API keys (store in vault, never use export):

  • Stripe: vault_save stripe_secret_key "sk_test_xxx"
  • PayPal: vault_save paypal_client_id "xxx" and vault_save paypal_secret "xxx"
  • Lightning (Alby): vault_save alby_access_token "xxx"
  • OpenNode: vault_save opennode_key "xxx"
  • Check: vault_get stripe_secret_key — keys auto-inject as uppercase env vars

Set PAYPAL_API manually for sandbox (https://api-m.sandbox.paypal.com) or live (https://api-m.paypal.com).

Stripe

# Create payment intent
curl -s -X POST "https://api.stripe.com/v1/payment_intents" \
  -u "$STRIPE_SECRET_KEY:" \
  -d "amount=2000" \
  -d "currency=usd" \
  -d "payment_method_types[]=card" | jq '.'

# Retrieve payment intent
curl -s "https://api.stripe.com/v1/payment_intents/pi_xxx" \
  -u "$STRIPE_SECRET_KEY:" | jq '.'

# Create customer
curl -s -X POST "https://api.stripe.com/v1/customers" \
  -u "$STRIPE_SECRET_KEY:" \
  -d "email=customer@example.com" \
  -d "name=John Doe" | jq '.'

# Create invoice
curl -s -X POST "https://api.stripe.com/v1/invoices" \
  -u "$STRIPE_SECRET_KEY:" \
  -d "customer=cus_xxx" | jq '.'

# List charges
curl -s "https://api.stripe.com/v1/charges?limit=10" \
  -u "$STRIPE_SECRET_KEY:" | jq '.data[]'

# Create checkout session
curl -s -X POST "https://api.stripe.com/v1/checkout/sessions" \
  -u "$STRIPE_SECRET_KEY:" \
  -d "mode=payment" \
  -d "success_url=https://example.com/success" \
  -d "line_items[0][price]=price_xxx" \
  -d "line_items[0][quantity]=1" | jq '.url'

PayPal

# PAYPAL_API: https://api-m.sandbox.paypal.com (sandbox) or api-m.paypal.com (live)
# Get access token
ACCESS_TOKEN=$(curl -s -X POST "$PAYPAL_API/v1/oauth2/token" \
  -u "$PAYPAL_CLIENT_ID:$PAYPAL_SECRET" \
  -d "grant_type=client_credentials" | jq -r '.access_token')

# Create order
curl -s -X POST "$PAYPAL_API/v2/checkout/orders" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
    "intent": "CAPTURE",
    "purchase_units": [{
      "amount": {"currency_code": "USD", "value": "100.00"}
    }]
  }' | jq '.'

# Capture order
curl -s -X POST "$PAYPAL_API/v2/checkout/orders/ORDER_ID/capture" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $ACCESS_TOKEN" | jq '.'

Lightning Network (Alby)

# Get balance
curl -s "https://api.getalby.com/balance" \
  -H "Authorization: Bearer $ALBY_ACCESS_TOKEN" | jq '.'

# Create invoice
curl -s -X POST "https://api.getalby.com/invoices" \
  -H "Authorization: Bearer $ALBY_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"amount": 1000, "description": "Payment for service"}' | jq '.'

# Pay invoice
curl -s -X POST "https://api.getalby.com/payments/bolt11" \
  -H "Authorization: Bearer $ALBY_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"invoice": "lnbc..."}' | jq '.'

# Check invoice status
curl -s "https://api.getalby.com/invoices/PAYMENT_HASH" \
  -H "Authorization: Bearer $ALBY_ACCESS_TOKEN" | jq '.'

OpenNode (Bitcoin)

# Create invoice
curl -s -X POST "https://api.opennode.com/v1/charges" \
  -H "Authorization: $OPENNODE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount": 1000, "currency": "USD", "description": "Order #123"}' | jq '.'

# Check charge status
curl -s "https://api.opennode.com/v1/charge/CHARGE_ID" \
  -H "Authorization: $OPENNODE_KEY" | jq '.'

LNURL (Lightning)

# Generate LNURL-pay
# Requires lnurl library
pip install lnurl

python3 -c "
from lnurl import LnurlPayResponse
import json

# Example LNURL-pay metadata
data = {
    'callback': 'https://your-domain.com/callback',
    'maxSendable': 1000000,
    'minSendable': 1000,
    'metadata': '[["text/plain", "Payment for service"]]',
    'tag': 'payRequest'
}
print(json.dumps(data))
"

Tips

  • Stripe: Test with sk_test_ keys first
  • PayPal: Use sandbox for testing
  • Lightning: Alby offers easy API for Bitcoin
  • Always use HTTPS for payment APIs
  • Store payment IDs for reconciliation

Triggers

payment, stripe, paypal, bitcoin, lightning, invoice, create payment, process payment, payment api

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.