#!/usr/bin/env bash # Smoke-test the Stripe connector with YOUR Stripe test key. # Usage: ./test_stripe.sh rk_test_xxx [limit] # # Use a RESTRICTED, READ-ONLY test-mode key (Stripe Dashboard → Developers → # API keys → Create restricted key → read access: Customers, Invoices, # Subscriptions). Make sure your Stripe TEST account has a couple of customers. # The key is sent to the live Space over HTTPS, used in-memory, and not stored. set -euo pipefail KEY="${1:?Pass your Stripe test key: ./test_stripe.sh rk_test_xxx [limit]}" LIMIT="${2:-25}" BASE="https://shaankar39-revai-api.hf.space" # These two headers simulate the RapidAPI gateway. For a real gateway call, # use your RapidAPI key against revai1.p.rapidapi.com instead. curl -s -m60 \ -H "X-RapidAPI-User: stripe-smoke" \ -H "X-RapidAPI-Proxy-Secret: ${REVAI_PROXY_SECRET:?export REVAI_PROXY_SECRET=}" \ -H "Content-Type: application/json" \ -X POST "$BASE/v1/connect/stripe" \ -d "{\"stripe_key\":\"$KEY\",\"limit\":$LIMIT,\"model_type\":\"churn\"}" \ | python3 -m json.tool