Parsa-29/loop-config / skills/flitt-payments
flitt-payments
VerifiedFlitt payment API implementation guidance for auth, SHA1 request/callback signatures, sandbox testing, hosted checkout, Payment (redirect), Payment (direct), saved-card /api/recurring charges, card token saving, scheduled subscriptions, reversals/refunds, captures for preauth payments, reservation_data payloads, supported currencies, callback/webhook handling, response codes, 3DS steps, order status polling, and response handling. Use when Codex needs to integrate or debug Flitt payments, create payment requests, build or verify signatures, attach reservation_data, validate currency support, implement callback handlers, interpret response codes, obtain or charge a rectoken, create/cancel subscriptions, reverse/refund through /api/reverse/order_id, capture through /api/capture/order_id, poll status, or troubleshoot Flitt API failures.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 12.7 KB |
| references/additional-data.md | markdown | 5.3 KB |
| references/callbacks.md | markdown | 4.4 KB |
| references/capture.md | markdown | 4.8 KB |
| references/currencies.md | markdown | 1.1 KB |
| references/payment-direct.md | markdown | 6.7 KB |
| references/payment-redirect.md | markdown | 7.3 KB |
| references/payment-saved-card.md | markdown | 5.0 KB |
| references/response-codes.md | markdown | 8.1 KB |
| references/reversal.md | markdown | 5.4 KB |
| references/saving-cards.md | markdown | 3.3 KB |
| references/sending-request.md | markdown | 3.9 KB |
| references/signature.md | markdown | 3.9 KB |
| references/subscriptions.md | markdown | 5.6 KB |
| references/testing-auth.md | markdown | 3.5 KB |
| scripts/flitt_signature.pyexecutable | script | 2.6 KB |
scripts/flitt_signature.py
View on GitHub#!/usr/bin/env python3
"""Generate or verify Flitt API signatures."""
from __future__ import annotations
import argparse
import hashlib
import json
import sys
from pathlib import Path
from typing import Any
EXCLUDED_KEYS = {"signature", "response_signature_string"}
def load_params(raw: str | None, params_file: str | None) -> dict[str, Any]:
if bool(raw) == bool(params_file):
raise SystemExit("Provide exactly one of --params or --params-file.")
if params_file:
data = json.loads(Path(params_file).read_text(encoding="utf-8"))
else:
data = json.loads(raw or "{}")
if not isinstance(data, dict):
raise SystemExit("Parameters must be a JSON object.")
for root_key in ("request", "response"):
inner = data.get(root_key)
if isinstance(inner, dict):
return inner
return data
def is_present(value: Any) -> bool:
return value is not None and value != ""
def stringify(value: Any) -> str:
if isinstance(value, bool):
return "true" if value else "false"
return str(value)
def signature_string(secret: str, params: dict[str, Any]) -> str:
values = [
stringify(params[key])
for key in sorted(params)
if key not in EXCLUDED_KEYS and is_present(params[key])
]
return "|".join([secret, *values])
def generate_signature(secret: str, params: dict[str, Any]) -> str:
payload = signature_string(secret, params).encode("utf-8")
return hashlib.sha1(payload).hexdigest()
def main() -> int:
parser = argparse.ArgumentParser(description="Generate or verify Flitt SHA1 signatures.")
parser.add_argument("--secret", required=True, help="Flitt payment secret key.")
parser.add_argument("--params", help="JSON object with request/response parameters.")
parser.add_argument("--params-file", help="Path to JSON file with request/response parameters.")
parser.add_argument("--verify", help="Expected signature to compare against.")
parser.add_argument(
"--no-string",
action="store_true",
help="Do not print the pre-hash signature string.",
)
args = parser.parse_args()
params = load_params(args.params, args.params_file)
pre_hash = signature_string(args.secret, params)
digest = generate_signature(args.secret, params)
if not args.no_string:
print(f"string={pre_hash}")
print(f"signature={digest}")
if args.verify:
expected = args.verify.lower()
if digest == expected:
print("verified=true")
return 0
print("verified=false", file=sys.stderr)
return 1
return 0
if __name__ == "__main__":
raise SystemExit(main())
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |