diff --git a/setup_stripe_production.sh b/setup_stripe_production.sh index 87048902..e0a86211 100755 --- a/setup_stripe_production.sh +++ b/setup_stripe_production.sh @@ -51,7 +51,7 @@ EXISTING_METERS=$(curl -s https://api.stripe.com/v1/billing/meters \ -u "${STRIPE_KEY}:" \ -H "Stripe-Version: 2024-11-20.acacia") -METER_ID=$(echo "$EXISTING_METERS" | grep -o '"event_name":"devices_monitored"' -B 20 | grep -o '"id":"mtr_[^"]*"' | head -1 | cut -d'"' -f4) +METER_ID=$(echo "$EXISTING_METERS" | grep -o '"event_name": "devices_monitored"' -B 20 | grep -o '"id": "mtr_[^"]*"' | head -1 | cut -d'"' -f4) if [[ -n "$METER_ID" ]]; then echo "✓ Found existing billing meter!" @@ -69,7 +69,7 @@ else -d "default_aggregation[formula]=sum" \ -d "value_settings[event_payload_key]=value") - METER_ID=$(echo "$METER_RESPONSE" | grep -o '"id":"mtr_[^"]*"' | head -1 | cut -d'"' -f4) + METER_ID=$(echo "$METER_RESPONSE" | grep -o '"id": "mtr_[^"]*"' | head -1 | cut -d'"' -f4) if [[ -z "$METER_ID" ]]; then echo "Error creating meter:" @@ -101,7 +101,7 @@ PRICE_RESPONSE=$(curl -s https://api.stripe.com/v1/prices \ -d "unit_amount=100" \ -d "nickname=Per Device Monthly") -PRICE_ID=$(echo "$PRICE_RESPONSE" | grep -o '"id":"price_[^"]*"' | head -1 | cut -d'"' -f4) +PRICE_ID=$(echo "$PRICE_RESPONSE" | grep -o '"id": "price_[^"]*"' | head -1 | cut -d'"' -f4) if [[ -z "$PRICE_ID" ]]; then echo "Error creating price:"