lib/mangopay/kyc_document.rb
# Adds the file page (attachment) to the given document.
#
# See http://docs.mangopay.com/api-references/kyc/pages/ :
# - Document have to be in 'CREATED' Status
# - You can create as many pages as needed
# - Change Status to 'VALIDATION_ASKED' to submit KYC documents
#
# The file_content_base64 param may be:
# - Base64 encoded file content
# - or nil: in this case pass the file path in the next param
#
Adds the file page (attachment) to the given document.

The file_content_base64 param may be:
Base64 encoded file content
or nil: in this case pass the file path in the next param
Adds the file page ( attachment ) to the given document . The file_content_base64 param may be : Base64 encoded file content or nil : in this case pass the file path in the next param
def create_page(user_id, document_id, file_content_base64, file_path = nil, idempotency_key = nil)
        if file_content_base64.nil? && !file_path.nil?
          bts = File.open(file_path, 'rb') { |f| f.read }
          file_content_base64 = Base64.encode64(bts)
        end
        begin
          MangoPay.request(:post, url(user_id, document_id) + '/pages', {'File' => file_content_base64}, {}, idempotency_key)
        rescue ResponseError => ex
          raise ex unless ex.code == '204'
        end
      end
def create_page ( user_id , document_id , file_content_base64 , file_path = nil , idempotency_key = nil ) if file_content_base64 . nil? && ! file_path . nil? bts = File . open ( file_path , 'rb' ) { | f | f . read } file_content_base64 = Base64 . encode64 ( bts ) end begin MangoPay . request ( :post , url ( user_id , document_id ) + '/pages' , { 'File' => file_content_base64 } , { } , idempotency_key ) rescue ResponseError => ex raise ex unless ex . code == '204' end end
Adds the file page (attachment) to the given document.
Adds the file page ( attachment ) to the given document .
# normally it returns 204 HTTP code on success
user_id
<not_specific>
document_id
<not_specific>
file_content_base64
<not_specific>
file_path
<not_specific>
idempotency_key
<not_specific>