Mangopay / mangopay2-ruby-sdk

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

The requested resource does not support http method 'POST' on MangoPay::KycDocument.create_page #183

Closed DavidZisky closed 3 years ago

DavidZisky commented 3 years ago

I am getting MangoPay::ResponseError (The requested resource does not support http method 'POST'.): when trying to add pages to KYC_document with the following code:

kyc_document = MangoPay::KycDocument.create(current_user.mangopay_id, { 'Type': 'IDENTITY_PROOF' })
kyc_page = MangoPay::KycDocument.create_page(current_user.mangopay_id, kyc_document[:Id], file)

kyc_document is getting created properly (I am getting response from the API with "Status"=>"Created"

gem 'mangopay', '~> 3.0.33'

DavidZisky commented 3 years ago

Update: just for a test I removed the first line (creating kyc_document) from the code since I know that this part is working fine and I hardcoded kyc_document Id in second line and run the code again and now I am getting:

MangoPay::ResponseError (One or several required parameters are missing or incorrect. An incorrect resource ID also raises this kind of error. File: The file is too small to be readable):

DavidZisky commented 3 years ago

And for another test I provided base64 encoded file to the sdk (even tho your docs says that if using sdk then there is no need to do it because sdk will base64 encode the files automatically) and I am not getting any errors anymore but also I have no idea if it worked because I am not getting any response from SDK and in my sandbox dashboard I don't see any files? current code looks like this:

encoded = Base64.encode64(file.read)
id_pages = MangoPay::KycDocument.create_page(current_user.mangopay_id, 95430563, encoded)
puts(id_pages)
mangomaxoasis commented 3 years ago

Hi @DavidZisky We're looking into it Max

SoloJr commented 3 years ago

Hi,

We've run the existing tests and they all work as intended. See here, and here more details.

Mircea

DavidZisky commented 3 years ago

Wow... super (un)helpful. Took you a week to run automated tests and not give me any clues what could be wrong. Thanks a lot, now I know how to solve my problem... :/