Payment Check Every 10 Minutes #8707
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Payment Check Every 10 Minutes | |
| on: | |
| schedule: | |
| # Run every 10 minutes at times ending with 0 (10:00, 10:10, 10:20, etc.) | |
| - cron: '*/10 * * * *' | |
| workflow_dispatch: # Allow manual triggering | |
| jobs: | |
| check-payments: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check Razorpay Payments | |
| run: | | |
| echo "🔄 Checking Razorpay payments at $(date)" | |
| # Replace YOUR_VERCEL_DOMAIN with your actual Vercel domain | |
| RESPONSE=$(curl -s -X POST "https://fun-printing.vercel.app/api/manual-check-payments" \ | |
| -H "Content-Type: application/json" \ | |
| -w "HTTPSTATUS:%{http_code}") | |
| HTTP_STATUS=$(echo $RESPONSE | tr -d '\n' | sed -e 's/.*HTTPSTATUS://') | |
| BODY=$(echo $RESPONSE | sed -e 's/HTTPSTATUS:.*//g') | |
| echo "Response Status: $HTTP_STATUS" | |
| echo "Response Body: $BODY" | |
| if [ $HTTP_STATUS -eq 200 ]; then | |
| echo "✅ Payment check completed successfully" | |
| else | |
| echo "❌ Payment check failed with status: $HTTP_STATUS" | |
| exit 1 | |
| fi | |
| - name: Log Result | |
| if: always() | |
| run: | | |
| echo "🕐 Payment check completed at $(date)" | |
| echo "📊 This job runs every 10 minutes at times ending with 0" | |
| echo "⏰ Next runs: 10:00, 10:10, 10:20, 10:30, 10:40, 10:50, 11:00, etc." |