| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- # Test saveRecharge with real order data from step 3
- # Order created: objectId=IqV8pb4PXw, detail.apigAuth.objectId=Vo3ROWEvDy
- $apigId = "Vo3ROWEvDy"
- # Test with fcompany (original field)
- Write-Host "=== saveRecharge (authComp, original) ===" -ForegroundColor Cyan
- $body1 = @{
- authComp = "test-openclaw-user"
- authid = $apigId
- apigid = $apigId
- oldCount = 0
- count = 100
- orderid = "IqV8pb4PXw"
- } | ConvertTo-Json -Compress
- try {
- $r1 = Invoke-RestMethod -Uri "https://server.fmode.cn/api/apig/saveRecharge" -Method POST -ContentType "application/json" -Body $body1 -TimeoutSec 60
- Write-Host "Response:" -ForegroundColor Green
- $r1 | ConvertTo-Json -Depth 5
- } catch {
- Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red
- if ($_.Exception.Response) {
- $reader = New-Object System.IO.StreamReader($_.Exception.Response.GetResponseStream())
- Write-Host "Body: $($reader.ReadToEnd())" -ForegroundColor Yellow
- }
- }
- Write-Host ""
- # Test with user (new field)
- Write-Host "=== saveRecharge (user, new) ===" -ForegroundColor Cyan
- $body2 = @{
- user = "test-openclaw-user"
- authid = $apigId
- apigid = $apigId
- oldCount = 0
- count = 100
- orderid = "IqV8pb4PXw"
- } | ConvertTo-Json -Compress
- try {
- $r2 = Invoke-RestMethod -Uri "https://server.fmode.cn/api/apig/saveRecharge" -Method POST -ContentType "application/json" -Body $body2 -TimeoutSec 60
- Write-Host "Response:" -ForegroundColor Green
- $r2 | ConvertTo-Json -Depth 5
- } catch {
- Write-Host "Error: $($_.Exception.Message)" -ForegroundColor Red
- if ($_.Exception.Response) {
- $reader = New-Object System.IO.StreamReader($_.Exception.Response.GetResponseStream())
- Write-Host "Body: $($reader.ReadToEnd())" -ForegroundColor Yellow
- }
- }
|