This repository was archived by the owner on Mar 19, 2024. It is now read-only.
3.0.0
·
53 commits
to master
since this release
- Added:
- Added method
upload_file
to classDisputesClient
and methodfiles
to classMerchantClient
to support uploading and downloading of files for disputes. - Added support for binary requests and responses:
- Added classes
UploadableFile
,MultipartFormDataObject
andMultipartFormDataRequest
for sendingmultipart/form-data
requests. - Added
get_with_binary_response
,delete_with_binary_response
,post_with_binary_response
andput_with_binary_response
methods to classCommunicator
that return, instead of a response object, a tuple with the response headers and a generator with chunks of the response body. Thepost
,put
,post_with_binary_response
andput_with_binary_response
methods have special support for objects of typesMultipartFormDataObject
andMultipartFormDataRequest
. - Refactored interface
Connection
. Its methods no longer return aResponse
object but instead a tuple with the status code, response headers and a generator with chunks of the response body. Itspost
andput
methods should also acceptMultipartFormDataObject
bodies instead of only string bodies. - Added method
set_binary_body
to classLogMessage
to support logging binary content.
- Added classes
- Added the following functions to module
ingenico.connect.sdk.request_header
:get_header_value(headers, header_name)
returns a single header value (ornull
).get_header(headers, header_name)
returns a singleRequestHeader
object (ornull
).
- Added module
ingenico.connect.sdk.response_header
with the following methods:get_header_value(headers, header_name)
returns a single header value (ornull
).get_header(headers, header_name)
returns a single header as a name/value tuple (ornull
).get_disposition_filename(headers)
returns the filename of theContent-Disposition
header (ornull
).
- Added method
- Removed:
- Removed method
public_key
from classProductsClient
, and classPublicKey
. 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
andgetIINdetails
of classServicesClient
. - Removed class
Response
in favor of streaming responses. - Removed property
response
of classResponseException
. - Removed method
_add_parameter
of classParamRequest
. Its generated sub classes directly createRequestParam
objects instead of calling the more generic_add_parameter
method. - Removed method
_add_to_dictionary
of classDataObject
. Its generated and manually written sub classes directly add data to the dictionary instead of calling the more generic_add_parameter
method.
- Removed 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 theget
,delete
,post
andput
methods. These should now return a tuple with the status code, response headers and a generator with chunks of the response body, and not aResponse
object. You also need to make sure thepost
andput
methods acceptMultipartFormDataObject
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 overriddenget
,delete
,post
andput
methods to also supportMultipartFormDataRequest
objects. You also need to override the newget_with_binary_response
,delete_with_binary_response
,post_with_binary_response
andput_with_binary_response
methods.