Skip to content

Instantly share code, notes, and snippets.

@havenwood
Created June 6, 2022 19:13
Show Gist options
  • Save havenwood/f909568b77c8b4a6e90e48433f82bcd8 to your computer and use it in GitHub Desktop.
Save havenwood/f909568b77c8b4a6e90e48433f82bcd8 to your computer and use it in GitHub Desktop.
require 'net/http'
require 'uri'
require 'json'
uri = URI('https://eoftqqzi7ii7mmn.m.pipedream.net')
request = Net::HTTP::Post.new(uri)
request.content_type = 'application/json'
json = {
card_cvc: 'tok_sandbox_sXTRFEQqsidYhF6uwW1w9r',
card_exp: '10/25',
card_number: 'tok_sandbox_uQPorT8AJ5g4e3727Q93bm'
}.to_json
request.body = json
response = Net::HTTP.start uri.hostname, uri.port, use_ssl: true do |http|
http.request(request)
end
pp response.body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment