Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

3.0.0

Compare
Choose a tag to compare
@IngenicoEPayments IngenicoEPayments released this 21 Jun 14:45
· 53 commits to master since this release
  • Added:
    • Added method upload_file to class DisputesClient and method files to class MerchantClient to support uploading and downloading of files for disputes.
    • Added support for binary requests and responses:
      • Added classes UploadableFile, MultipartFormDataObject and MultipartFormDataRequest for sending multipart/form-data requests.
      • Added get_with_binary_response, delete_with_binary_response, post_with_binary_response and put_with_binary_response methods to class Communicator that return, instead of a response object, a tuple with the response headers and a generator with chunks of the response body. The post, put, post_with_binary_response and put_with_binary_response methods have special support for objects of types MultipartFormDataObject and MultipartFormDataRequest.
      • Refactored interface Connection. Its methods no longer return a Response object but instead a tuple with the status code, response headers and a generator with chunks of the response body. Its post and put methods should also accept MultipartFormDataObject bodies instead of only string bodies.
      • Added method set_binary_body to class LogMessage to support logging binary content.
    • Added the following functions to module ingenico.connect.sdk.request_header:
      • get_header_value(headers, header_name) returns a single header value (or null).
      • get_header(headers, header_name) returns a single RequestHeader object (or null).
    • Added module ingenico.connect.sdk.response_header with the following methods:
      • get_header_value(headers, header_name) returns a single header value (or null).
      • get_header(headers, header_name) returns a single header as a name/value tuple (or null).
      • get_disposition_filename(headers) returns the filename of the Content-Disposition header (or null).
  • Removed:
    • Removed method public_key from class ProductsClient, and class PublicKey. Both were only used for encryption for Android Pay. Now that Android Pay has been replaced by Google Pay, which uses a different mechanism for encryption, this call is no longer needed.
    • Removed deprecated methods convertAmount and getIINdetails of class ServicesClient.
    • Removed class Response in favor of streaming responses.
    • Removed property response of class ResponseException.
    • Removed method _add_parameter of class ParamRequest. Its generated sub classes directly create RequestParam objects instead of calling the more generic _add_parameter method.
    • Removed method _add_to_dictionary of class DataObject. Its generated and manually written sub classes directly add data to the dictionary instead of calling the more generic _add_parameter method.

If you are not using custom implementations, this version is compatible with the previous version. Otherwise you need to perform the following steps:

  • If you have created your own implementation of Connection, you need to change the implementation of the get, delete, post and put methods. These should now return a tuple with the status code, response headers and a generator with chunks of the response body, and not a Response object. You also need to make sure the post and put methods accept MultipartFormDataObject bodies as well as string bodies. You probably also should take care to not log any binary request or response bodies.
  • If you have extended Communicator you need to change any overridden get, delete, post and put methods to also support MultipartFormDataRequest objects. You also need to override the new get_with_binary_response, delete_with_binary_response, post_with_binary_response and put_with_binary_response methods.