Last active
August 29, 2015 14:21
-
-
Save daniloisr/a4b318ffb8f5bb483837 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'httparty' | |
class SmartWallet | |
include HTTParty | |
KEY = 'E485075C-A77D-404A-A966-72AD93E1CB7D' | |
def self.create_account | |
url = 'http://smartwalletstaging.mundipagg.com' | |
account_url = "#{url}/Account" | |
headers = { | |
'Accept' => 'application/json', | |
'Content-Type' => 'application/json', | |
'SmartWalletKey' => KEY | |
} | |
query = { | |
'AccountReference': 'GenericReference', | |
'Addresses': [ | |
{ | |
'AddressNumber': '42', | |
'City': 'Rio de Janeiro', | |
'Complement': '', | |
'Country': 'Brasil', | |
'District': '', | |
'State': 'RJ', | |
'StreetAddress': 'GenericStreet', | |
'ZipCode': '123465' | |
} | |
], | |
'DbaName': 'Arthur', | |
'DocumentNumber': '123456789', | |
'DocumentType': 'CNPJ', | |
'Email': 'exempleexemple.com', | |
'FinancialDetails': [ | |
{ | |
'Bank': { | |
'AccountNumber': '000', | |
'AgencyNumber': '123456', | |
'BankCode': '789' | |
}, | |
'Destination': 'sample', | |
'Email': 'exempleexemple.com' | |
} | |
], | |
'LegalName': 'Arthur Dent', | |
'MCC': 0042, | |
'PhoneNumber': '9999999999', | |
'RequestKey': '4636d485-583e-4f7d-a776-bdc4d9654950', | |
'SmartWalletKey': KEY, | |
'SocialUserName': '' | |
} | |
HTTParty.post(account_url, body: JSON.dump(query), headers: headers ) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment