lib/gocardless/client.rb
# Generate the URL for creating a limit of type +type+, including the
# provided params, nonce, timestamp and signature
#
# @param [Symbol] type the limit type (+:subscription+, etc)
# @param [Hash] params the bill parameters
# @return [String] the generated URL
Generate the URL for creating a limit of type +type+, including the
provided params, nonce, timestamp and signature
Generate the URL for creating a limit of type + type + including the provided params nonce timestamp and signature
def new_limit_url(type, limit_params)
      url = URI.parse("#{base_url}/connect/#{type}s/new")
      limit_params[:merchant_id] = merchant_id
      redirect_uri = limit_params.delete(:redirect_uri)
      cancel_uri = limit_params.delete(:cancel_uri)
      state = limit_params.delete(:state)
      params = {
        :nonce       => generate_nonce,
        :timestamp   => Time.now.getutc.strftime('%Y-%m-%dT%H:%M:%SZ'),
        :client_id   => @app_id,
        type         => limit_params,
      }
      params[:redirect_uri] = redirect_uri unless redirect_uri.nil?
      params[:cancel_uri] = cancel_uri unless cancel_uri.nil?
      params[:state] = state unless state.nil?
      sign_params(params)
      url.query = Utils.normalize_params(params)
      url.to_s
    end
def new_limit_url ( type , limit_params ) url = URI . parse ( "#{base_url}/connect/#{type}s/new" ) limit_params [ :merchant_id ] = merchant_id redirect_uri = limit_params . delete ( :redirect_uri ) cancel_uri = limit_params . delete ( :cancel_uri ) state = limit_params . delete ( :state ) params = { :nonce => generate_nonce , :timestamp => Time . now . getutc . strftime ( '%Y-%m-%dT%H:%M:%SZ' ) , :client_id => @app_id , type => limit_params , } params [ :redirect_uri ] = redirect_uri unless redirect_uri . nil? params [ :cancel_uri ] = cancel_uri unless cancel_uri . nil? params [ :state ] = state unless state . nil? sign_params ( params ) url . query = Utils . normalize_params ( params ) url . to_s end
Generate the URL for creating a limit of type +type+, including the
provided params, nonce, timestamp and signature
Generate the URL for creating a limit of type + type + including the provided params nonce timestamp and signature
the generated URL
the generated URL
String
type
<not_specific>
limit_params
<not_specific>
<not_specific>
params the bill parameters
params the bill parameters