Skip to content

Commit

Permalink
2024-11-21 17:15:28.395503 new snippets
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardocerqueira committed Nov 21, 2024
1 parent 68f9043 commit dd9c391
Show file tree
Hide file tree
Showing 28 changed files with 955 additions and 1,490 deletions.
42 changes: 42 additions & 0 deletions seeker/report.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,45 @@
--------------------------------------------------------------------------------
2024-11-21 17:15:28.395503
--------------------------------------------------------------------------------
On branch main
Your branch is up to date with 'origin/main'.

Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
deleted: snippet/.bashrc
deleted: snippet/Setup Android build environment on Fedora
deleted: snippet/arc_unpacker.py
deleted: snippet/code.py
deleted: snippet/convert_archive.py
deleted: snippet/exercises.py
deleted: snippet/extract_table_example.py
modified: snippet/gistfile1.txt
deleted: snippet/interactive_gradio_using_blocks.py
modified: snippet/main.py
deleted: snippet/openwrt-lede-on-pogoplug-mobile.sh
deleted: snippet/ping_starter.py
deleted: snippet/process_better.py
deleted: snippet/simple_gradio_interface.py
deleted: snippet/simple_interactive_gradio_interface.py
deleted: snippet/torch_device.py
deleted: snippet/validate.go

Untracked files:
(use "git add <file>..." to include in what will be committed)
snippet/BCreate.java
snippet/BCreate.py
snippet/BUpdate.py
snippet/BValidate.java
snippet/BValidate.py
snippet/BValidateForm.java
snippet/BValidateForm.py
snippet/WorkSeven.py
snippet/bottle_song.py
snippet/phton.py

no changes added to commit (use "git add" and/or "git commit -a")

--------------------------------------------------------------------------------
2024-11-20 17:15:33.737339
--------------------------------------------------------------------------------
Expand Down
13 changes: 0 additions & 13 deletions seeker/snippet/.bashrc

This file was deleted.

168 changes: 168 additions & 0 deletions seeker/snippet/BCreate.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
//date: 2024-11-21T17:02:35Z
//url: https://api.github.com/gists/a0ab8ccb8b3a8db6f8b8b8360a90592c
//owner: https://api.github.com/users/sts-developer

import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class Main {
public static void main(String[] args) throws Exception {
String url = "https://testapi.taxbandits.com/v1.7.3/Form1099B/Create";
URL obj = new URL(url);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();

// Setting basic post request headers
con.setRequestMethod("POST");
con.setRequestProperty("Authorization", "YOUR_AUTH_TOKEN_HERE");
con.setRequestProperty("Content-Type", "application/json");

// Enabling POST parameters
con.setDoOutput(true);

// JSON payload as a single-line string (Updated JSON)
String postData = "{"
+ "\"SubmissionManifest\": {"
+ "\"TaxYear\": \"2024\","
+ "\"IRSFilingType\":\"IRIS\","
+ "\"IsFederalFiling\": true,"
+ "\"IsPostal\": true,"
+ "\"IsOnlineAccess\": true,"
+ "\"IsScheduleFiling\": false,"
+ "\"ScheduleFiling\": null"
+ "},"
+ "\"ReturnHeader\": {"
+ "\"Business\": {"
+ "\"BusinessId\": null,"
+ "\"BusinessNm\": \"Snowdaze LLC\","
+ "\"FirstNm\": null,"
+ "\"MiddleNm\": null,"
+ "\"LastNm\": null,"
+ "\"Suffix\": null,"
+ "\"PayerRef\": \"Snow123\","
+ "\"TradeNm\": \"Iceberg Icecreams\","
+ "\"IsEIN\": true,"
+ "\"EINorSSN\": \"71-3787159\","
+ "\"Email\": \"[email protected]\","
+ "\"ContactNm\": null,"
+ "\"Phone\": \"6634567890\","
+ "\"PhoneExtn\": \"12345\","
+ "\"Fax\": \"6634567890\","
+ "\"BusinessType\": \"ESTE\","
+ "\"SigningAuthority\": null,"
+ "\"KindOfEmployer\": \"FederalGovt\","
+ "\"KindOfPayer\": \"REGULAR941\","
+ "\"IsBusinessTerminated\": true,"
+ "\"IsForeign\": false,"
+ "\"USAddress\": {"
+ "\"Address1\": \"3576 AIRPORT WAY\","
+ "\"Address2\": \"UNIT 9\","
+ "\"City\": \"FAIRBANKS\","
+ "\"State\": \"AK\","
+ "\"ZipCd\": \"99709\""
+ "},"
+ "\"ForeignAddress\": null"
+ "}"
+ "},"
+ "\"ReturnData\": ["
+ "{"
+ "\"SequenceId\": \"1\","
+ "\"IsPostal\": true,"
+ "\"IsOnlineAccess\": true,"
+ "\"IsForced\": true,"
+ "\"Recipient\": {"
+ "\"RecipientId\": null,"
+ "\"TINType\": \"EIN\","
+ "\"TIN\": \"36-3814577\","
+ "\"FirstPayeeNm\": \"Dairy Delights LLC\","
+ "\"SecondPayeeNm\": \"Coco Milk\","
+ "\"FirstNm\": null,"
+ "\"MiddleNm\": null,"
+ "\"LastNm\": null,"
+ "\"Suffix\": null,"
+ "\"IsForeign\": true,"
+ "\"USAddress\": null,"
+ "\"ForeignAddress\": {"
+ "\"Address1\": \"120 Bremner Blvd\","
+ "\"Address2\": \"Suite 800\","
+ "\"City\": \"Toronto\","
+ "\"ProvinceOrStateNm\": \"Ontario\","
+ "\"Country\": \"CA\","
+ "\"PostalCd\": \"4168682600\""
+ "},"
+ "\"Email\": \"[email protected]\","
+ "\"Fax\": \"6834567890\","
+ "\"Phone\": \"7634567890\""
+ "},"
+ "\"BFormData\": {"
+ "\"B1aDescrOfProp\": \"RFC\","
+ "\"B1bDateAcquired\": \"07/01/2022\","
+ "\"B1cDateSoldOrDisposed\": \"09/04/2021\","
+ "\"B1dProceeds\": 40.55,"
+ "\"B1eCostOrOtherBasis\": 30.89,"
+ "\"B1fAccruedMktDisc\": 20.11,"
+ "\"B1gWashsaleLossDisallowed\": 4.25,"
+ "\"B2TypeOfGainLoss\": \"ordinary short term\","
+ "\"B3IsProceedsFromCollectibles\": true,"
+ "\"B3IsProceedsFromQOF\": false,"
+ "\"B4FedTaxWH\": 0,"
+ "\"B5IsNonCoveredSecurityNotReported\": false,"
+ "\"B5IsNonCoveredSecurityReported\": false,"
+ "\"B6IsGrossProceeds\": true,"
+ "\"B6IsNetProceeds\": false,"
+ "\"B7IsLossNotAllowedbasedOn1d\": false,"
+ "\"B8PLRealizedOnClosedContract\": 0,"
+ "\"B9PLUnrealizedOnOpenContractPrevTy\": 0,"
+ "\"B10UnrealizedPLOnOpenContractCurTy\": 0,"
+ "\"B11AggPLOnContract\": 0,"
+ "\"B12IsBasisReportedToIRS\": false,"
+ "\"B13Bartering\": 43,"
+ "\"AccountNum\": \"789121\","
+ "\"CUSIPNum\": \"8988932143534\","
+ "\"IsFATCA\": true,"
+ "\"Form8949Code\": \"X\","
+ "\"Is2ndTINnot\": true,"
+ "\"States\": ["
+ "{"
+ "\"StateCd\": \"WV\","
+ "\"StateIdNum\": \"99999999\","
+ "\"StateWH\": 257.94"
+ "},"
+ "{"
+ "\"StateCd\": \"ID\","
+ "\"StateIdNum\": \"999999999\","
+ "\"StateWH\": 15"
+ "}"
+ "]"
+ "}"
+ "}"
+ "]"
+ "}";

// Writing the POST data to the request
try (DataOutputStream wr = new DataOutputStream(con.getOutputStream())) {
wr.writeBytes(postData);
wr.flush();
}

// Reading the response
int responseCode = con.getResponseCode();
BufferedReader in;
if (responseCode >= 200 && responseCode <= 300) {
in = new BufferedReader(new InputStreamReader(con.getInputStream()));
} else {
in = new BufferedReader(new InputStreamReader(con.getErrorStream()));
}
String inputLine;
StringBuilder response = new StringBuilder();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();

// Printing the response
System.out.println(response.toString());
}
}
133 changes: 133 additions & 0 deletions seeker/snippet/BCreate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
#date: 2024-11-21T17:01:50Z
#url: https://api.github.com/gists/5b03d929935ccdcc1915c2625ca7639e
#owner: https://api.github.com/users/sts-developer

import http.client
import json

conn = http.client.HTTPSConnection("testapi.taxbandits.com")
payload = json.dumps({
"SubmissionManifest": {
"TaxYear": "2024",
"IRSFilingType": "IRIS",
"IsFederalFiling": True,
"IsPostal": True,
"IsOnlineAccess": True,
"IsScheduleFiling": False,
"ScheduleFiling": None
},
"ReturnHeader": {
"Business": {
"BusinessId": None,
"BusinessNm": "Snowdaze LLC",
"FirstNm": None,
"MiddleNm": None,
"LastNm": None,
"Suffix": None,
"PayerRef": "Snow123",
"TradeNm": "Iceberg Icecreams",
"IsEIN": True,
"EINorSSN": "71-3787159",
"Email": "[email protected]",
"ContactNm": None,
"Phone": "6634567890",
"PhoneExtn": "12345",
"Fax": "6634567890",
"BusinessType": "ESTE",
"SigningAuthority": None,
"KindOfEmployer": "FederalGovt",
"KindOfPayer": "REGULAR941",
"IsBusinessTerminated": True,
"IsForeign": False,
"USAddress": {
"Address1": "3576 AIRPORT WAY",
"Address2": "UNIT 9",
"City": "FAIRBANKS",
"State": "AK",
"ZipCd": "99709"
},
"ForeignAddress": None
}
},
"ReturnData": [
{
"SequenceId": "1",
"IsPostal": True,
"IsOnlineAccess": True,
"IsForced": True,
"Recipient": {
"RecipientId": None,
"TINType": "EIN",
"TIN": "36-3814577",
"FirstPayeeNm": "Dairy Delights LLC",
"SecondPayeeNm": "Coco Milk",
"FirstNm": None,
"MiddleNm": None,
"LastNm": None,
"Suffix": None,
"IsForeign": True,
"USAddress": None,
"ForeignAddress": {
"Address1": "120 Bremner Blvd",
"Address2": "Suite 800",
"City": "Toronto",
"ProvinceOrStateNm": "Ontario",
"Country": "CA",
"PostalCd": "4168682600"
},
"Email": "[email protected]",
"Fax": "6834567890",
"Phone": "7634567890"
},
"BFormData": {
"B1aDescrOfProp": "RFC",
"B1bDateAcquired": "07/01/2022",
"B1cDateSoldOrDisposed": "09/04/2021",
"B1dProceeds": 40.55,
"B1eCostOrOtherBasis": 30.89,
"B1fAccruedMktDisc": 20.11,
"B1gWashsaleLossDisallowed": 4.25,
"B2TypeOfGainLoss": "ordinary short term",
"B3IsProceedsFromCollectibles": True,
"B3IsProceedsFromQOF": False,
"B4FedTaxWH": 0,
"B5IsNonCoveredSecurityNotReported": False,
"B5IsNonCoveredSecurityReported": False,
"B6IsGrossProceeds": True,
"B6IsNetProceeds": False,
"B7IsLossNotAllowedbasedOn1d": False,
"B8PLRealizedOnClosedContract": 0,
"B9PLUnrealizedOnOpenContractPrevTy": 0,
"B10UnrealizedPLOnOpenContractCurTy": 0,
"B11AggPLOnContract": 0,
"B12IsBasisReportedToIRS": False,
"B13Bartering": 43,
"AccountNum": "789121",
"CUSIPNum": "8988932143534",
"IsFATCA": True,
"Form8949Code": "X",
"Is2ndTINnot": True,
"States": [
{
"StateCd": "WV",
"StateIdNum": "99999999",
"StateWH": 257.94
},
{
"StateCd": "ID",
"StateIdNum": "999999999",
"StateWH": 15
}
]
}
}
]
})
headers = {
'Authorization': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiJlNDdhN2I3MGMwNTY0NjI2OTU0M2RhNzQwZmNiNTZmNCIsImV4cCI6MTczMjAxNjY0OCwiaWF0IjoxNzMyMDEzMDQ4LCJpc3MiOiJodHRwczovL3Ricy1vYXV0aC5zdHNzcHJpbnQuY29tL3YyLyIsInN1YiI6ImJlZWQ0ZTAxYzM2NmQ4MjIiLCJ1c2VydW5pcXVlaWQiOiIifQ.S6hAjN56eo7fQuFL810aody1M-22xvhWj8ewVAHRxDU',
'Content-Type': 'application/json'
}
conn.request("POST", "/V1.7.3/form1099B/create", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Loading

0 comments on commit dd9c391

Please sign in to comment.