Skip to content

Instantly share code, notes, and snippets.

View kaichogamirzp's full-sized avatar

Asish Panda kaichogamirzp

  • Razorpay
  • Bangalore
View GitHub Profile
@kaichogamirzp
kaichogamirzp / mulitple_request.py
Created March 11, 2020 03:14
Script to make several request in parallel for a Mozart endpoint. Purpose is to verify if redaction has a genuine problem or not
import requests
from concurrent.futures import ThreadPoolExecutor
from requests.auth import HTTPBasicAuth
list_of_urls = ["http://0.0.0.0:8090/cardPayments/paytm/v1/authenticate_init"] * 50
def get_url(url):
payload = "{\n \"payment\": {\n \"id\": \"C8bMQGQ7XaZHT6\"\n },\n \"card\": {\n \"type\": \"debit\",\n \"cvv\": \"102\",\n \"expiry_month\": 5,\n \"expiry_year\": 2021,\n \"number\": \"4280902033766247\"\n },\n \"amount\": {\n \"currency\": \"INR\",\n \"value\": \"3000\"\n },\n \"actions\": {\n \"z_validation\": {\n \"gateway_reference_id1\": \"0ff76830038345978638303a9347ce7d1580278522119\"\n }\n },\n \"terminal\": {\n \"procurer\": \"RAZORPAY\",\n \"gateway_access_code\": \"WEBSTAGING\",\n \"gateway_merchant_id\": \"skvJqi01482500655531\",\n \"gateway_secure_secret\": \"@NX%Krpzb5zS@oRV\"\n }\n}"
headers = {
'Content-Type': 'application/json'
@kaichogamirzp
kaichogamirzp / orchestrator.go
Last active October 25, 2019 07:56
Redact checker
d, _ := datasink.GetJSON(f.DataSink().Data)
if strings.Contains(d, "build_amex_url") {
random_string:= randSeq(7)
file_name := []string{"/Users/asishpanda/test_files/", random_string, ".txt"}
_ = ioutil.WriteFile(strings.Join(file_name, ""), []byte(d), 0644)
}
@kaichogamirzp
kaichogamirzp / file_integration.go
Last active October 21, 2019 07:50
test_copy_helper for new mozart contract
//make thise changes in the code of test files
if strings.Contains(fileName, "hitachi") {
var main_block map[string]interface{}
main_block = make(map[string]interface{})
main_block["responseStatusCode"] = 200
main_block["responseBody"] = jsonActualResponseBody