Mangopay / mangopay2-ruby-sdk

Ruby Gem for MANGOPAY
https://rubygems.org/gems/mangopay
MIT License
42 stars 38 forks source link

One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error. #5

Closed Fred-grais closed 10 years ago

Fred-grais commented 10 years ago

Hello, since you released the v2, i gave it a try and i encoutered this issue with all the create methods for LegalUser, NaturalUser and Client

I ran the generator command and get my credentials

MangoPay.configure do |c| c.preproduction = true c.client_id = 'xxx' c.client_passphrase = 'xxx' end

Then in my controller i got , as following your wiki

MangoPay::LegalUser.create({ Name: 'Super', LegalPersonType: 'BUSINESS', HeadquartersAddress: 'Here', LegalRepresentativeFirstName: 'John', LegalRepresentativeLastName: 'Doe', LegalRepresentativeAdress: 'Here', LegalRepresentativeEmail: 'john@doe.com', LegalRepresentativeBirthday: '', LegalRepresentativeNationality: 'FR', LegalRepresentativeCountryOfResidence: 'FR', Statute: '', ProofOfRegistration: '', ShareholderDeclaration: '' })

or

MangoPay::NaturalUser.create({ "Tag" => 'test', "Email" => 'my@email.com', "FirstName" => 'John', "LastName" => 'Doe', "Address" => 'Here', "Birthday" => '10/10/1991', "Birthplace" => 'Paris', "Nationality" => 'FR', "CountryOfResidence" => 'FR', "Occupation" => 'Worker', "IncomeRange" => 1 })

Then it raises this error :

"One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error."

Any ideas?

Thanks!

Fred-grais commented 10 years ago

Ok well it seems that the wiki is not up to date,

i had to stipulate : "ProofOfIdentity" => :null, "ProofOfAddress" => :null,

so it become:

MangoPay::NaturalUser.create({ "Tag" => 'test', "Email" => 'my@email.com', "FirstName" => 'John', "LastName" => 'Doe', "Address" => 'Here', "Birthday" => '10/10/1991', "Birthplace" => 'Paris', "Nationality" => 'FR', "CountryOfResidence" => 'FR', "Occupation" => 'Worker', "IncomeRange" => 1, "ProofOfIdentity" => :null, "ProofOfAddress" => :null, })

RedaBenh commented 10 years ago

Hi, when i run the same command :

MangoPay::NaturalUser.create({
"Tag" => 'test',
"Email" => 'my@email.com',
"FirstName" => 'John',
"LastName" => 'Doe',
"Address" => 'Here',
"Birthday" => '10/10/1991',
"Birthplace" => 'Paris',
"Nationality" => 'FR',
"CountryOfResidence" => 'FR',
"Occupation" => 'Worker',
"IncomeRange" => 1,
"ProofOfIdentity" => :null,
"ProofOfAddress" => :null, 
})

I get the same error :

MangoPay::ResponseError: One or several required parameters are missing or incorrect. 
An incorrect resource ID also raises this kind of error.

how do you fix it ?

Thanks

RedaBenh commented 10 years ago

I fix it :-) by using a Timestamp format instead of text format. "Birthday" =>1300186358 and not "Birthday" => '10/10/1991'

PS: A text format like "Birthday" => '10/10/1991' can be used in the REST Client.