#!/bin/bash
curl 'https://kan.gar.ooo/api/v1/user/order/save' -X POST -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0' -H 'Accept: */*' -H 'Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2' -H 'Accept-Encoding: gzip, deflate, br' -H 'Referer: https://kan.gar.ooo/' -H 'Content-Type: application/x-www-form-urlencoded' -H 'authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6NDIxLCJzZXNzaW9uIjoiNmFmZWQzM2RjZTViOGYzMjYzODBjYzA0MGJiMWE5NjUifQ.jIwPixBFnYjhj4mwEl7rAMym9SFO2s_EC9GNfsRHHIc' -H 'Content-Language: zh-CN' -H 'Origin: https://kan.gar.ooo' -H 'Connection: keep-alive' -H 'Cookie: crisp-client%2Fsession%2Fb39a328f-52c7-4342-9e00-021550f6ed4c=session_42658a7a-12b3-4a2d-81f6-d1dc4453cd50' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-origin' -H 'TE: trailers' --data-raw 'period=month_price&plan_id=1'
sleep 5
id=$(curl 'https://kan.gar.ooo/api/v1/user/order/fetch' -H 'authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6NDIxLCJzZXNzaW9uIjoiNmFmZWQzM2RjZTViOGYzMjYzODBjYzA0MGJiMWE5NjUifQ.jIwPixBFnYjhj4mwEl7rAMym9SFO2s_EC9GNfsRHHIc' | jq '.data[] | select(.status == 0) | .trade_no' | sed 's/"//g')
sleep 5
curl 'https://kan.gar.ooo/api/v1/user/order/checkout' -X POST -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Firefox/102.0' -H 'Accept: */*' -H 'Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2' -H 'Accept-Encoding: gzip, deflate, br' -H 'Referer: https://kan.gar.ooo/' -H 'Content-Type: application/x-www-form-urlencoded' -H 'authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6NDIxLCJzZXNzaW9uIjoiNmFmZWQzM2RjZTViOGYzMjYzODBjYzA0MGJiMWE5NjUifQ.jIwPixBFnYjhj4mwEl7rAMym9SFO2s_EC9GNfsRHHIc' -H 'Content-Language: zh-CN' -H 'Origin: https://kan.gar.ooo' -H 'Connection: keep-alive' -H 'Cookie: crisp-client%2Fsession%2Fb39a328f-52c7-4342-9e00-021550f6ed4c=session_42658a7a-12b3-4a2d-81f6-d1dc4453cd50' -H 'Sec-Fetch-Dest: empty' -H 'Sec-Fetch-Mode: cors' -H 'Sec-Fetch-Site: same-origin' -H 'TE: trailers' --data-raw "trade_no=$id" | jq