Permalink
Browse files

verify ok!

  • Loading branch information...
Juan Maiz
Juan Maiz committed Jun 24, 2011
1 parent 6c0bdf9 commit 88a82b37f9855572bd82a3bf5d8d1e805de53996
Showing with 23 additions and 2 deletions.
  1. +2 −2 Gemfile.lock
  2. +21 −0 lib/moip/client.rb
View
@@ -9,12 +9,12 @@ PATH
GEM
remote: http://rubygems.org/
specs:
- activesupport (3.0.7)
+ activesupport (3.0.8)
crack (0.1.8)
diff-lcs (1.1.2)
httparty (0.6.1)
crack (= 0.1.8)
- nokogiri (1.4.4)
+ nokogiri (1.4.6)
rspec (2.1.0)
rspec-core (~> 2.1.0)
rspec-expectations (~> 2.1.0)
View
@@ -15,6 +15,27 @@ class Client
class << self
+ # Verifica conta
+ # URL Produção: https://www.moip.com.br/ws/alpha/VerificarConta/{login_moip}
+ # URL SandBox: https://desenvolvedor.moip.com.br/sandbox/ws/alpha/VerificarConta/{login_moip}
+ # XML de Resposta:
+ # <ns1:verificarContaResponse>
+ # <RespostaVerificarConta>
+ # <Status>{status da conta}</Status>
+ # </RespostaVerificarConta>
+ # </ns1:verificarContaResponse>
+ #
+ # Valores Esperados: {status da conta}
+ # Inexistente " Login inexistente no sistema MoIP "
+ # Criado " Login criado, porem não verificado "
+ # Verificado " Login verificado "
+# MoIP::Client.verify 'aaa'
+
+ def verify account
+ full_data = peform_action!(:get, "VerificarConta/#{account}")
+ return full_data["ns1:verificarContaResponse"]["RespostaVerificarConta"]["Status"] == "Verificado"
+ end
+
# Envia uma instrução para pagamento único
def checkout(attributes = {})
full_data = peform_action!(:post, 'EnviarInstrucao/Unica', :body => DirectPayment.body(attributes))

0 comments on commit 88a82b3

Please sign in to comment.