revdotcom/rev-ruby-sdk

`sandbox_mode` support

Opened this issue · 2 comments

Hi there! Does this gem support sandbox mode for creating orders?

Hi, for anyone needing to use Rev's sandbox environment, according to their docs we need to pass sandbox_mode=true as a param to the post. When building the request object, you can include it with:

inputs = [Input.new(uri: @client.create_input_from_link(@video.url, 'video/mp4'))]
options = CaptionOptions.new(inputs, output_file_formats: [CaptionOptions::OUTPUT_FILE_FORMATS[:webvtt]])
request = OrderRequest.new(caption_options: options)

# Include sandbox_mode param for the current environment
request = JSON.parse(request.to_json).to_h.merge(sandbox_mode: !Rails.env.production?)

I tried adding sandbox_mode=true in the request and it didn't work (and I didn't notice until too late and sadly wasted some money...

I also tried the method described in the README (Rev::Api::SANDBOX_HOST) and that didn't work either, getting an error: SocketError (Failed to open TCP connection to api-sandbox.rev.com:443 (getaddrinfo: nodename nor servname provided, or not known))