Shell Script - Recieved UPI payment and send alert in streamelement obs

82 Views Asked by At

Streamelement API is working fine for me. Now I want to know payment confirmation and get data of transaction and use this data in streamelement api.

I have working API Code Mention Below :-

#!/bin/bash

# Define dynamic variables
API_URL="https://api.streamelements.com/kappa/v2/tips/STREAM_ELEMENTS_CHANNEL_ID"
AUTH_TOKEN="Bearer MY_TOKEN_HERE"  # Replace with your actual authentication token
USERNAME="user1"
EMAIL="[email protected]"
MESSAGE="Sent Alert via Script"
AMOUNT=20
CURRENCY="INR"
PROVIDER="My_Script"
IMPORTED=true

# Send the cURL request using the dynamic variables
/usr/bin/curl --request POST \
  --url "$API_URL" \
  --header "Accept: application/json; charset=utf-8, application/json" \
  --header "Authorization: $AUTH_TOKEN" \
  --header "Content-Type: application/json" \
  --data "{
  \"user\": {
    \"userId\": \"$API_URL\",
    \"username\": \"$USERNAME\",
    \"email\": \"$EMAIL\"
  },
  \"provider\": \"$PROVIDER\",
  \"message\": \"$MESSAGE\",
  \"amount\": $AMOUNT,
  \"currency\": \"$CURRENCY\",
  \"imported\": $IMPORTED
}"

Now I want to know how to integrate this code from Phonepe, Gpay, Paytm UPI? and get transaction data and send via this code. User Name, Amount, and more if required.

Streamelement API is working fine for me. Now I want to know payment confirmation and get data of transaction and use this data in streamelement api.

I have working API Code Mention Below :-

0

There are 0 best solutions below