Class: Spree::ClearSaleConfiguration

Inherits:
Preferences::Configuration
  • Object
show all
Defined in:
lib/spree/clear_sale_configuration.rb

Instance Method Summary collapse

Instance Method Details

#get_providersString

Retorna um json com as informacoes dos providers e seus tipos de pagamento (de acordo com a tabela da ClearSale) salvos

Returns:

  • (String)

Author:

  • Isabella Santos



18
19
20
# File 'lib/spree/clear_sale_configuration.rb', line 18

def get_providers
  preferred_providers.collect { |key, value| {id: key, text: key, payment_type: {id: value, text: Spree.t("payment_type_#{value}")}} }.to_json
end

#integration_urlString

Retorna a url de integracao de acordo com o modo selecionado (homologacao ou producao)

Returns:

  • (String)

Author:

  • Isabella Santos



29
30
31
32
33
34
35
# File 'lib/spree/clear_sale_configuration.rb', line 29

def integration_url
  if preferred_test_mode
    'https://homolog.clearsale.com.br/start/Entrada/EnviarPedido.aspx'
  else
    'https://www.clearsale.com.br/start/Entrada/EnviarPedido.aspx'
  end
end