Skip to content

Commit

Permalink
MIT: Changed how the payload was sent to the gateway
Browse files Browse the repository at this point in the history
Closes #4655
  • Loading branch information
alejandrofloresm authored and jcreiff committed Jul 19, 2023
1 parent fdac501 commit 8f663b6
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 96 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* Borgun: Update authorization_from & message_from [almalee24] #4826
* Kushki: Add Brazil as supported country [almalee24] #4829
* Adyen: Add additional data for airline and lodging [javierpedrozaing] #4815
* MIT: Changed how the payload was sent to the gateway [alejandrofloresm] #4655

== Version 1.131.0 (June 21, 2023)
* Redsys: Add supported countries [jcreiff] #4811
Expand Down
36 changes: 18 additions & 18 deletions lib/active_merchant/billing/gateways/mit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ def authorize(money, payment, options = {})
post_to_json_encrypt = encrypt(post_to_json, @options[:key_session])

final_post = '<authorization>' + post_to_json_encrypt + '</authorization><dataID>' + @options[:user] + '</dataID>'
json_post = {}
json_post[:payload] = final_post
json_post = final_post
commit('sale', json_post)
end

Expand All @@ -114,8 +113,7 @@ def capture(money, authorization, options = {})
post_to_json_encrypt = encrypt(post_to_json, @options[:key_session])

final_post = '<capture>' + post_to_json_encrypt + '</capture><dataID>' + @options[:user] + '</dataID>'
json_post = {}
json_post[:payload] = final_post
json_post = final_post
commit('capture', json_post)
end

Expand All @@ -136,19 +134,26 @@ def refund(money, authorization, options = {})
post_to_json_encrypt = encrypt(post_to_json, @options[:key_session])

final_post = '<refund>' + post_to_json_encrypt + '</refund><dataID>' + @options[:user] + '</dataID>'
json_post = {}
json_post[:payload] = final_post
json_post = final_post
commit('refund', json_post)
end

def supports_scrubbing?
true
end

def extract_mit_responses_from_transcript(transcript)
groups = transcript.scan(/reading \d+ bytes(.*?)read \d+ bytes/m)
groups.map do |group|
group.first.scan(/-> "(.*?)"/).flatten.map(&:strip).join('')
end
end

def scrub(transcript)
ret_transcript = transcript
auth_origin = ret_transcript[/<authorization>(.*?)<\/authorization>/, 1]
unless auth_origin.nil?
auth_origin = auth_origin.gsub('\n', '')
auth_decrypted = decrypt(auth_origin, @options[:key_session])
auth_json = JSON.parse(auth_decrypted)
auth_json['card'] = '[FILTERED]'
Expand All @@ -162,6 +167,7 @@ def scrub(transcript)

cap_origin = ret_transcript[/<capture>(.*?)<\/capture>/, 1]
unless cap_origin.nil?
cap_origin = cap_origin.gsub('\n', '')
cap_decrypted = decrypt(cap_origin, @options[:key_session])
cap_json = JSON.parse(cap_decrypted)
cap_json['apikey'] = '[FILTERED]'
Expand All @@ -173,6 +179,7 @@ def scrub(transcript)

ref_origin = ret_transcript[/<refund>(.*?)<\/refund>/, 1]
unless ref_origin.nil?
ref_origin = ref_origin.gsub('\n', '')
ref_decrypted = decrypt(ref_origin, @options[:key_session])
ref_json = JSON.parse(ref_decrypted)
ref_json['apikey'] = '[FILTERED]'
Expand All @@ -182,15 +189,10 @@ def scrub(transcript)
ret_transcript = ret_transcript.gsub(/<refund>(.*?)<\/refund>/, ref_tagged)
end

res_origin = ret_transcript[/#{Regexp.escape('reading ')}(.*?)#{Regexp.escape('read')}/m, 1]
loop do
break if res_origin.nil?

resp_origin = res_origin[/#{Regexp.escape('"')}(.*?)#{Regexp.escape('"')}/m, 1]
resp_decrypted = decrypt(resp_origin, @options[:key_session])
ret_transcript[/#{Regexp.escape('reading ')}(.*?)#{Regexp.escape('read')}/m, 1] = resp_decrypted
ret_transcript = ret_transcript.sub('reading ', 'response: ')
res_origin = ret_transcript[/#{Regexp.escape('reading ')}(.*?)#{Regexp.escape('read')}/m, 1]
groups = extract_mit_responses_from_transcript(transcript)
groups.each do |group|
group_decrypted = decrypt(group, @options[:key_session])
ret_transcript = ret_transcript.gsub('Conn close', "\n" + group_decrypted + "\nConn close")
end

ret_transcript
Expand Down Expand Up @@ -219,9 +221,7 @@ def add_payment(post, payment)
end

def commit(action, parameters)
json_str = JSON.generate(parameters)
cleaned_str = json_str.gsub('\n', '')
raw_response = ssl_post(live_url, cleaned_str, { 'Content-type' => 'application/json' })
raw_response = ssl_post(live_url, parameters, { 'Content-type' => 'text/plain' })
response = JSON.parse(decrypt(raw_response, @options[:key_session]))

Response.new(
Expand Down
168 changes: 90 additions & 78 deletions test/unit/gateways/mit_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,88 +169,100 @@ def failed_void_response
end

def pre_scrubbed
<<-PRE_SCRUBBED
starting SSL for wpy.mitec.com.mx:443...
SSL established, protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384
<- "POST /ModuloUtilWS/activeCDP.htm HTTP/1.1\r\nContent-Type: application/json\r\nConnection: close\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Ruby\r\nHost: wpy.mitec.com.mx\r\nContent-Length: 607\r\n\r\n"
<- "{\"payload\":\"<authorization>1aUSihtRXgd+1nycRfVWgv0JDZsGLsrpsNkahpkx4jmnBRRAPPao+zJYqsN4xrGMIeVdJ3Y5LlQYXg5qu8O7iZmDPTqWbyKmsurCxJidr6AkFszwvRfugElyb5sAYpUcrnFSpVUgz2NGcIuMRalr0irf7q30+TzbLRHQc1Z5QTe6am3ndO8aSKKLwYYmfHcO8E/+dPiCsSP09P2heNqpMbf5IKdSwGCVS1Rtpcoijl3wXB8zgeBZ1PXHAmmkC1/CWRs/fh1qmvYFzb8YAiRy5q80Tyq09IaeSpQ1ydq3r95QBSJy6H4gz2OV/v2xdm1A63XEh2+6N6p2XDyzGWQrxKE41wmqRCxie7qY2xqdv4S8Cl8ldSMEpZY46A68hKIN6zrj6eMWxauwdi6ZkZfMDuh9Pn9x5gwwgfElLopIpR8fejB6G4hAQHtq2jhn5D4ccmAqNxkrB4w5k+zc53Rupk2u3MDp5T5sRkqvNyIN2kCE6i0DD9HlqkCjWV+bG9WcUiO4D7m5fWRE5f9OQ2XjeA==</authorization><dataID>IVCA33721</dataID>\"}"
-> "HTTP/1.1 200 \r\n"
-> "Strict-Transport-Security: max-age=31536000;includeSubDomains\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "X-XSS-Protection: 1; mode=block\r\n"
-> "Content-Type: text/html;charset=ISO-8859-1\r\n"
-> "Content-Length: 320\r\n"
-> "Date: Mon, 06 Sep 2021 19:02:08 GMT\r\n"
-> "Connection: close\r\n"
-> "Server: \r\n"
-> "Set-Cookie: UqZBpD3n=v1I4cyJQ__N2M; Expires=Mon, 06-Sep-2021 19:03:38 GMT; Path=/; Secure; HttpOnly\r\n"
-> "\r\n"
reading 320 bytes...
-> "hl0spHqAAamtY47Vo+W+dZcpDyK8QRqpx/gWzIM1F3X1VFV/zNUcKCuqaSL6F4S7MqOGUMOC3BXIZYaS9TpJf6xsMYeRDyMpiv+sE0VpY2a4gULhLv1ztgGHgF3OpMjD8ucgLbd9FMA5OZjd8wlaqn46JCiYNcNIPV7hkHWNCqSWow+C+SSkWZeaa9YpNT3E6udixbog30/li1FcSI+Ti80EWBIdH3JDcQvjQbqecNb87JYad0EhgqL1o7ZEMehfZ2kW9FG6OXjGzWyhiWd2GEFKe8em4vEJxARFdXsaHe3tX0jqnF2gYOiFRclqFkbk"
read 320 bytes
Conn close
opening connection to wpy.mitec.com.mx:443...
opened
starting SSL for wpy.mitec.com.mx:443...
SSL established, protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384
<- "POST /ModuloUtilWS/activeCDP.htm HTTP/1.1\r\nContent-Type: application/json\r\nConnection: close\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Ruby\r\nHost: wpy.mitec.com.mx\r\nContent-Length: 359\r\n\r\n"
<- "{\"payload\":\"<capture>Z6l24tZG2YfTOQTne8NVygr/YeuVRNya8ZUCM5NvRgOEL/Mt8PO0voNnspoiFSg+RVamC4V2BipmU3spPVBg6Dr0xMpPL7ryVB9mlM4PokUdHkZTjXJHbbr1GWdyEPMYYSH0f+M1qUDO57EyUuZv8o6QSv+a/tuOrrBwsHI8cnsv+y9qt5L9LuGRMeBYvZkkK+xw53eDqYsJGoCvpk/pljCCkGU7Q/sKsLOx0MT6dA/BLVGrGeo8ngO+W/cnOigGfIZJSPFTcrUKI/Q7AsHuP+3lG6q9VAri9UJZXm5pWOg=</capture><dataID>IVCA33721</dataID>\"}"
-> "HTTP/1.1 200 \r\n"
-> "Strict-Transport-Security: max-age=31536000;includeSubDomains\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "X-XSS-Protection: 1; mode=block\r\n"
-> "Content-Type: text/html;charset=ISO-8859-1\r\n"
-> "Content-Length: 280\r\n"
-> "Date: Mon, 06 Sep 2021 19:02:08 GMT\r\n"
-> "Connection: close\r\n"
-> "Server: \r\n"
-> "Set-Cookie: UqZBpD3n=v1JocyJQ__9tu; Expires=Mon, 06-Sep-2021 19:03:39 GMT; Path=/; Secure; HttpOnly\r\n"
-> "\r\n"
reading 280 bytes...
-> "BnuAgMOx9USBreICk027VY2ZqJA7xQcRT9Ytz8WpabDnqIglj43J/I03pKLtDlFrerKIAzhW1YCroDOS7mvtA5YnWezLstoOK0LbIcYqLzj1dCFW2zLb9ssTCxJa6ZmEQdzQdl8pyY4mC0QQ0JrOrsSA9QfX1XhkdcSVnsxQV1cEooL8/6EsVFCb6yVIMhVnGL6GRCc2J+rPigHsljLWRovgRKqFIURJjNWbfqepDRPG2hCNKsabM/lE2DFtKLMs4J5iwY9HiRbrAMG6BaGNiQ=="
read 280 bytes
Conn close
<<~PRE_SCRUBBED
starting SSL for wpy.mitec.com.mx:443...
SSL established, protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384
<- "POST /ModuloUtilWS/activeCDP.htm HTTP/1.1\r\nContent-Type: application/json\r\nConnection: close\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Ruby\r\nHost: wpy.mitec.com.mx\r\nContent-Length: 607\r\n\r\n"
<- "{\"payload\":\"<authorization>1aUSihtRXgd+1nycRfVWgv0JDZsGLsrpsNkahpkx4jmnBRRAPPao+zJYqsN4xrGMIeVdJ3Y5LlQYXg5qu8O7iZmDPTqWbyKmsurCxJidr6AkFszwvRfugElyb5sAYpUcrnFSpVUgz2NGcIuMRalr0irf7q30+TzbLRHQc1Z5QTe6am3ndO8aSKKLwYYmfHcO8E/+dPiCsSP09P2heNqpMbf5IKdSwGCVS1Rtpcoijl3wXB8zgeBZ1PXHAmmkC1/CWRs/fh1qmvYFzb8YAiRy5q80Tyq09IaeSpQ1ydq3r95QBSJy6H4gz2OV/v2xdm1A63XEh2+6N6p2XDyzGWQrxKE41wmqRCxie7qY2xqdv4S8Cl8ldSMEpZY46A68hKIN6zrj6eMWxauwdi6ZkZfMDuh9Pn9x5gwwgfElLopIpR8fejB6G4hAQHtq2jhn5D4ccmAqNxkrB4w5k+zc53Rupk2u3MDp5T5sRkqvNyIN2kCE6i0DD9HlqkCjWV+bG9WcUiO4D7m5fWRE5f9OQ2XjeA==</authorization><dataID>IVCA33721</dataID>\"}"
-> "HTTP/1.1 200 \r\n"
-> "Strict-Transport-Security: max-age=31536000;includeSubDomains\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "X-XSS-Protection: 1; mode=block\r\n"
-> "Content-Type: text/html;charset=ISO-8859-1\r\n"
-> "Content-Length: 320\r\n"
-> "Date: Mon, 06 Sep 2021 19:02:08 GMT\r\n"
-> "Connection: close\r\n"
-> "Server: \r\n"
-> "Set-Cookie: UqZBpD3n=v1I4cyJQ__N2M; Expires=Mon, 06-Sep-2021 19:03:38 GMT; Path=/; Secure; HttpOnly\r\n"
-> "\r\n"
reading 320 bytes...
-> "hl0spHqAAamtY47Vo+W+dZcpDyK8QRqpx/gWzIM1F3X1VFV/zNUcKCuqaSL6F4S7MqOGUMOC3BXIZYaS9TpJf6xsMYeRDyMpiv+sE0VpY2a4gULhLv1ztgGHgF3OpMjD8ucgLbd9FMA5OZjd8wlaqn46JCiYNcNIPV7hkHWNCqSWow+C+SSkWZeaa9YpNT3E6udixbog30/li1FcSI+Ti80EWBIdH3JDcQvjQbqecNb87JYad0EhgqL1o7ZEMehfZ2kW9FG6OXjGzWyhiWd2GEFKe8em4vEJxARFdXsaHe3tX0jqnF2gYOiFRclqFkbk"
read 320 bytes
Conn close
opening connection to wpy.mitec.com.mx:443...
opened
starting SSL for wpy.mitec.com.mx:443...
SSL established, protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384
<- "POST /ModuloUtilWS/activeCDP.htm HTTP/1.1\r\nContent-Type: application/json\r\nConnection: close\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Ruby\r\nHost: wpy.mitec.com.mx\r\nContent-Length: 359\r\n\r\n"
<- "{\"payload\":\"<capture>Z6l24tZG2YfTOQTne8NVygr/YeuVRNya8ZUCM5NvRgOEL/Mt8PO0voNnspoiFSg+RVamC4V2BipmU3spPVBg6Dr0xMpPL7ryVB9mlM4PokUdHkZTjXJHbbr1GWdyEPMYYSH0f+M1qUDO57EyUuZv8o6QSv+a/tuOrrBwsHI8cnsv+y9qt5L9LuGRMeBYvZkkK+xw53eDqYsJGoCvpk/pljCCkGU7Q/sKsLOx0MT6dA/BLVGrGeo8ngO+W/cnOigGfIZJSPFTcrUKI/Q7AsHuP+3lG6q9VAri9UJZXm5pWOg=</capture><dataID>IVCA33721</dataID>\"}"
-> "HTTP/1.1 200 \r\n"
-> "Strict-Transport-Security: max-age=31536000;includeSubDomains\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "X-XSS-Protection: 1; mode=block\r\n"
-> "Content-Type: text/html;charset=ISO-8859-1\r\n"
-> "Content-Length: 280\r\n"
-> "Date: Mon, 06 Sep 2021 19:02:08 GMT\r\n"
-> "Connection: close\r\n"
-> "Server: \r\n"
-> "Set-Cookie: UqZBpD3n=v1JocyJQ__9tu; Expires=Mon, 06-Sep-2021 19:03:39 GMT; Path=/; Secure; HttpOnly\r\n"
-> "\r\n"
reading 280 bytes...
-> "BnuAgMOx9USBreICk027VY2ZqJA7xQcRT9Ytz8WpabDnqIglj43J/I03pKLtDlFrerKIAzhW1YCroDOS7mvtA5YnWezLstoOK0LbIcYqLzj1dCFW2zLb9ssTCxJa6ZmEQdzQdl8pyY4mC0QQ0JrOrsSA9QfX1XhkdcSVnsxQV1cEooL8/6EsVFCb6yVIMhVnGL6GRCc2J+rPigHsljLWRovgRKqFIURJjNWbfqepDRPG2hCNKsabM/lE2DFtKLMs4J5iwY9HiRbrAMG6BaGNiQ=="
read 280 bytes
Conn close
PRE_SCRUBBED
end

def post_scrubbed
<<-POST_SCRUBBED
starting SSL for wpy.mitec.com.mx:443...
SSL established, protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384
<- "POST /ModuloUtilWS/activeCDP.htm HTTP/1.1\r\nContent-Type: application/json\r\nConnection: close\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Ruby\r\nHost: wpy.mitec.com.mx\r\nContent-Length: 607\r\n\r\n"
<- "{\"payload\":\"<authorization>{"operation":"Authorize","commerce_id":"147","user":"IVCA33721","apikey":"[FILTERED]","testMode":"YES","amount":"11.15","currency":"MXN","reference":"721","transaction_id":"721","installments":1,"card":"[FILTERED]","expmonth":9,"expyear":2025,"cvv":"[FILTERED]","name_client":"Pedro Flores Valdes","email":"nadie@mit.test","key_session":"[FILTERED]"}</authorization><dataID>IVCA33721</dataID>\"}"
-> "HTTP/1.1 200 \r\n"
-> "Strict-Transport-Security: max-age=31536000;includeSubDomains\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "X-XSS-Protection: 1; mode=block\r\n"
-> "Content-Type: text/html;charset=ISO-8859-1\r\n"
-> "Content-Length: 320\r\n"
-> "Date: Mon, 06 Sep 2021 19:02:08 GMT\r\n"
-> "Connection: close\r\n"
-> "Server: \r\n"
-> "Set-Cookie: UqZBpD3n=v1I4cyJQ__N2M; Expires=Mon, 06-Sep-2021 19:03:38 GMT; Path=/; Secure; HttpOnly\r\n"
-> "\r\n"
response: {"folio_cdp":"095492846","auth":"928468","response":"approved","message":"0C- Pago aprobado (test)","id_comercio":"147","reference":"721","amount":"11.15","time":"19:02:08 06:09:2021","operation":"Authorize"}read 320 bytes
Conn close
opening connection to wpy.mitec.com.mx:443...
opened
starting SSL for wpy.mitec.com.mx:443...
SSL established, protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384
<- "POST /ModuloUtilWS/activeCDP.htm HTTP/1.1\r\nContent-Type: application/json\r\nConnection: close\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Ruby\r\nHost: wpy.mitec.com.mx\r\nContent-Length: 359\r\n\r\n"
<- "{\"payload\":\"<capture>{"operation":"Capture","commerce_id":"147","user":"IVCA33721","apikey":"[FILTERED]","testMode":"YES","transaction_id":"721","amount":"11.15","key_session":"[FILTERED]"}</capture><dataID>IVCA33721</dataID>\"}"
-> "HTTP/1.1 200 \r\n"
-> "Strict-Transport-Security: max-age=31536000;includeSubDomains\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "X-XSS-Protection: 1; mode=block\r\n"
-> "Content-Type: text/html;charset=ISO-8859-1\r\n"
-> "Content-Length: 280\r\n"
-> "Date: Mon, 06 Sep 2021 19:02:08 GMT\r\n"
-> "Connection: close\r\n"
-> "Server: \r\n"
-> "Set-Cookie: UqZBpD3n=v1JocyJQ__9tu; Expires=Mon, 06-Sep-2021 19:03:39 GMT; Path=/; Secure; HttpOnly\r\n"
-> "\r\n"
response: {"folio_cdp":"095492915","auth":"929151","response":"approved","message":"0C- ","id_comercio":"147","reference":"721","amount":"11.15","time":"19:02:09 06:09:2021","operation":"Capture"}read 280 bytes
Conn close
<<~POST_SCRUBBED
starting SSL for wpy.mitec.com.mx:443...
SSL established, protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384
<- "POST /ModuloUtilWS/activeCDP.htm HTTP/1.1\r\nContent-Type: application/json\r\nConnection: close\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Ruby\r\nHost: wpy.mitec.com.mx\r\nContent-Length: 607\r\n\r\n"
<- "{\"payload\":\"<authorization>{\"operation\":\"Authorize\",\"commerce_id\":\"147\",\"user\":\"IVCA33721\",\"apikey\":\"[FILTERED]\",\"testMode\":\"YES\",\"amount\":\"11.15\",\"currency\":\"MXN\",\"reference\":\"721\",\"transaction_id\":\"721\",\"installments\":1,\"card\":\"[FILTERED]\",\"expmonth\":9,\"expyear\":2025,\"cvv\":\"[FILTERED]\",\"name_client\":\"Pedro Flores Valdes\",\"email\":\"nadie@mit.test\",\"key_session\":\"[FILTERED]\"}</authorization><dataID>IVCA33721</dataID>\"}"
-> "HTTP/1.1 200 \r\n"
-> "Strict-Transport-Security: max-age=31536000;includeSubDomains\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "X-XSS-Protection: 1; mode=block\r\n"
-> "Content-Type: text/html;charset=ISO-8859-1\r\n"
-> "Content-Length: 320\r\n"
-> "Date: Mon, 06 Sep 2021 19:02:08 GMT\r\n"
-> "Connection: close\r\n"
-> "Server: \r\n"
-> "Set-Cookie: UqZBpD3n=v1I4cyJQ__N2M; Expires=Mon, 06-Sep-2021 19:03:38 GMT; Path=/; Secure; HttpOnly\r\n"
-> "\r\n"
reading 320 bytes...
-> "hl0spHqAAamtY47Vo+W+dZcpDyK8QRqpx/gWzIM1F3X1VFV/zNUcKCuqaSL6F4S7MqOGUMOC3BXIZYaS9TpJf6xsMYeRDyMpiv+sE0VpY2a4gULhLv1ztgGHgF3OpMjD8ucgLbd9FMA5OZjd8wlaqn46JCiYNcNIPV7hkHWNCqSWow+C+SSkWZeaa9YpNT3E6udixbog30/li1FcSI+Ti80EWBIdH3JDcQvjQbqecNb87JYad0EhgqL1o7ZEMehfZ2kW9FG6OXjGzWyhiWd2GEFKe8em4vEJxARFdXsaHe3tX0jqnF2gYOiFRclqFkbk"
read 320 bytes

{\"folio_cdp\":\"095492846\",\"auth\":\"928468\",\"response\":\"approved\",\"message\":\"0C- Pago aprobado (test)\",\"id_comercio\":\"147\",\"reference\":\"721\",\"amount\":\"11.15\",\"time\":\"19:02:08 06:09:2021\",\"operation\":\"Authorize\"}

{\"folio_cdp\":\"095492915\",\"auth\":\"929151\",\"response\":\"approved\",\"message\":\"0C- \",\"id_comercio\":\"147\",\"reference\":\"721\",\"amount\":\"11.15\",\"time\":\"19:02:09 06:09:2021\",\"operation\":\"Capture\"}
Conn close
opening connection to wpy.mitec.com.mx:443...
opened
starting SSL for wpy.mitec.com.mx:443...
SSL established, protocol: TLSv1.2, cipher: ECDHE-RSA-AES256-GCM-SHA384
<- "POST /ModuloUtilWS/activeCDP.htm HTTP/1.1\r\nContent-Type: application/json\r\nConnection: close\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Ruby\r\nHost: wpy.mitec.com.mx\r\nContent-Length: 359\r\n\r\n"
<- "{\"payload\":\"<capture>{\"operation\":\"Capture\",\"commerce_id\":\"147\",\"user\":\"IVCA33721\",\"apikey\":\"[FILTERED]\",\"testMode\":\"YES\",\"transaction_id\":\"721\",\"amount\":\"11.15\",\"key_session\":\"[FILTERED]\"}</capture><dataID>IVCA33721</dataID>\"}"
-> "HTTP/1.1 200 \r\n"
-> "Strict-Transport-Security: max-age=31536000;includeSubDomains\r\n"
-> "X-Content-Type-Options: nosniff\r\n"
-> "X-XSS-Protection: 1; mode=block\r\n"
-> "Content-Type: text/html;charset=ISO-8859-1\r\n"
-> "Content-Length: 280\r\n"
-> "Date: Mon, 06 Sep 2021 19:02:08 GMT\r\n"
-> "Connection: close\r\n"
-> "Server: \r\n"
-> "Set-Cookie: UqZBpD3n=v1JocyJQ__9tu; Expires=Mon, 06-Sep-2021 19:03:39 GMT; Path=/; Secure; HttpOnly\r\n"
-> "\r\n"
reading 280 bytes...
-> "BnuAgMOx9USBreICk027VY2ZqJA7xQcRT9Ytz8WpabDnqIglj43J/I03pKLtDlFrerKIAzhW1YCroDOS7mvtA5YnWezLstoOK0LbIcYqLzj1dCFW2zLb9ssTCxJa6ZmEQdzQdl8pyY4mC0QQ0JrOrsSA9QfX1XhkdcSVnsxQV1cEooL8/6EsVFCb6yVIMhVnGL6GRCc2J+rPigHsljLWRovgRKqFIURJjNWbfqepDRPG2hCNKsabM/lE2DFtKLMs4J5iwY9HiRbrAMG6BaGNiQ=="
read 280 bytes

{\"folio_cdp\":\"095492846\",\"auth\":\"928468\",\"response\":\"approved\",\"message\":\"0C- Pago aprobado (test)\",\"id_comercio\":\"147\",\"reference\":\"721\",\"amount\":\"11.15\",\"time\":\"19:02:08 06:09:2021\",\"operation\":\"Authorize\"}

{\"folio_cdp\":\"095492915\",\"auth\":\"929151\",\"response\":\"approved\",\"message\":\"0C- \",\"id_comercio\":\"147\",\"reference\":\"721\",\"amount\":\"11.15\",\"time\":\"19:02:09 06:09:2021\",\"operation\":\"Capture\"}
Conn close
POST_SCRUBBED
end
end

0 comments on commit 8f663b6

Please sign in to comment.