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

Commit

Permalink
Release 2.7.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ingenico ePayments committed Aug 4, 2017
1 parent 2f3bbf2 commit 75b7f3a
Show file tree
Hide file tree
Showing 20 changed files with 389 additions and 27 deletions.
6 changes: 3 additions & 3 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@
# built documents.
#
# The short X.Y version.
version = u'2.6.0'
version = u'2.7.0'
# The full version, including alpha/beta/rc tags.
release = u'2.6.0'
release = u'2.7.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down Expand Up @@ -138,7 +138,7 @@
# The name for this set of Sphinx documents.
# "<project> v<release> documentation" by default.
#
# html_title = u'Python SDK v2.6.0'
# html_title = u'Python SDK v2.7.0'

# A shorter title for the navigation bar. Default is the same as html_title.
#
Expand Down
36 changes: 36 additions & 0 deletions examples/merchant/payments/complete_payment_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#
# This class was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
#
import os

from ingenico.connect.sdk.factory import Factory
from ingenico.connect.sdk.domain.definitions.card_without_cvv import CardWithoutCvv
from ingenico.connect.sdk.domain.payment.complete_payment_request import CompletePaymentRequest
from ingenico.connect.sdk.domain.payment.definitions.complete_payment_card_payment_method_specific_input import CompletePaymentCardPaymentMethodSpecificInput


class CompletePaymentExample(object):

def example(self):
with self.__get_client() as client:
card = CardWithoutCvv()
card.card_number = "67030000000000003"
card.cardholder_name = "Wile E. Coyote"
card.expiry_date = "1220"

card_payment_method_specific_input = CompletePaymentCardPaymentMethodSpecificInput()
card_payment_method_specific_input.card = card

body = CompletePaymentRequest()
body.card_payment_method_specific_input = card_payment_method_specific_input

response = client.merchant("merchantId").payments().complete("paymentId", body)

def __get_client(self):
api_key_id = os.getenv("connect.api.apiKeyId", "someKey")
secret_api_key = os.getenv("connect.api.secretApiKey", "someSecret")
configuration_file_name = os.path.abspath(os.path.join(os.path.dirname(__file__),
'../../example_configuration.ini'))
return Factory.create_client_from_file(configuration_file_name=configuration_file_name,
api_key_id=api_key_id, secret_api_key=secret_api_key)
22 changes: 22 additions & 0 deletions examples/merchant/payments/get_third_party_status_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# This class was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
#
import os

from ingenico.connect.sdk.factory import Factory


class GetThirdPartyStatusExample(object):

def example(self):
with self.__get_client() as client:
response = client.merchant("merchantId").payments().third_party_status("paymentId")

def __get_client(self):
api_key_id = os.getenv("connect.api.apiKeyId", "someKey")
secret_api_key = os.getenv("connect.api.secretApiKey", "someSecret")
configuration_file_name = os.path.abspath(os.path.join(os.path.dirname(__file__),
'../../example_configuration.ini'))
return Factory.create_client_from_file(configuration_file_name=configuration_file_name,
api_key_id=api_key_id, secret_api_key=secret_api_key)
1 change: 1 addition & 0 deletions examples/merchant/products/get_payment_product_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def example(self):
query.locale = "en_US"
query.amount = 1000
query.is_recurring = True
query.force_basic_flow = False
query.add_hide("fields")

response = client.merchant("merchantId").products().get(1, query)
Expand Down
50 changes: 39 additions & 11 deletions index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,14 @@ API Reference
:special-members:
:exclude-members: __dict__,__weakref__,__module__,__get__

.. automodule:: ingenico.connect.sdk.domain.capture.captures_response
.. automodule:: ingenico.connect.sdk.domain.capture.capture_response
:members:
:show-inheritance:
:undoc-members:
:special-members:
:exclude-members: __dict__,__weakref__,__module__,__get__

.. automodule:: ingenico.connect.sdk.domain.capture.capture_response
.. automodule:: ingenico.connect.sdk.domain.capture.captures_response
:members:
:show-inheritance:
:undoc-members:
Expand Down Expand Up @@ -604,6 +604,20 @@ API Reference
:special-members:
:exclude-members: __dict__,__weakref__,__module__,__get__

.. automodule:: ingenico.connect.sdk.domain.payment.complete_payment_request
:members:
:show-inheritance:
:undoc-members:
:special-members:
:exclude-members: __dict__,__weakref__,__module__,__get__

.. automodule:: ingenico.connect.sdk.domain.payment.complete_payment_response
:members:
:show-inheritance:
:undoc-members:
:special-members:
:exclude-members: __dict__,__weakref__,__module__,__get__

.. automodule:: ingenico.connect.sdk.domain.payment.create_payment_request
:members:
:show-inheritance:
Expand Down Expand Up @@ -639,6 +653,13 @@ API Reference
:special-members:
:exclude-members: __dict__,__weakref__,__module__,__get__

.. automodule:: ingenico.connect.sdk.domain.payment.third_party_status_response
:members:
:show-inheritance:
:undoc-members:
:special-members:
:exclude-members: __dict__,__weakref__,__module__,__get__

.. automodule:: ingenico.connect.sdk.domain.payment.tokenize_payment_request
:members:
:show-inheritance:
Expand Down Expand Up @@ -800,6 +821,13 @@ API Reference
:special-members:
:exclude-members: __dict__,__weakref__,__module__,__get__

.. automodule:: ingenico.connect.sdk.domain.payment.definitions.complete_payment_card_payment_method_specific_input
:members:
:show-inheritance:
:undoc-members:
:special-members:
:exclude-members: __dict__,__weakref__,__module__,__get__

.. automodule:: ingenico.connect.sdk.domain.payment.definitions.contact_details
:members:
:show-inheritance:
Expand Down Expand Up @@ -1276,7 +1304,7 @@ API Reference
:special-members:
:exclude-members: __dict__,__weakref__,__module__,__get__

.. automodule:: ingenico.connect.sdk.domain.product.payment_products
.. automodule:: ingenico.connect.sdk.domain.product.payment_product_group_response
:members:
:show-inheritance:
:undoc-members:
Expand All @@ -1290,21 +1318,21 @@ API Reference
:special-members:
:exclude-members: __dict__,__weakref__,__module__,__get__

.. automodule:: ingenico.connect.sdk.domain.product.payment_product_group_response
.. automodule:: ingenico.connect.sdk.domain.product.payment_product_networks_response
:members:
:show-inheritance:
:undoc-members:
:special-members:
:exclude-members: __dict__,__weakref__,__module__,__get__

.. automodule:: ingenico.connect.sdk.domain.product.payment_product_networks_response
.. automodule:: ingenico.connect.sdk.domain.product.payment_product_response
:members:
:show-inheritance:
:undoc-members:
:special-members:
:exclude-members: __dict__,__weakref__,__module__,__get__

.. automodule:: ingenico.connect.sdk.domain.product.payment_product_response
.. automodule:: ingenico.connect.sdk.domain.product.payment_products
:members:
:show-inheritance:
:undoc-members:
Expand Down Expand Up @@ -1780,14 +1808,14 @@ API Reference
:special-members:
:exclude-members: __dict__,__weakref__,__module__,__get__

.. automodule:: ingenico.connect.sdk.domain.token.definitions.mandate_sepa_direct_debit_without_creditor
.. automodule:: ingenico.connect.sdk.domain.token.definitions.mandate_sepa_direct_debit_with_mandate_id
:members:
:show-inheritance:
:undoc-members:
:special-members:
:exclude-members: __dict__,__weakref__,__module__,__get__

.. automodule:: ingenico.connect.sdk.domain.token.definitions.mandate_sepa_direct_debit_with_mandate_id
.. automodule:: ingenico.connect.sdk.domain.token.definitions.mandate_sepa_direct_debit_without_creditor
:members:
:show-inheritance:
:undoc-members:
Expand Down Expand Up @@ -1871,21 +1899,21 @@ API Reference
:special-members:
:exclude-members: __dict__,__weakref__,__module__,__get__

.. automodule:: ingenico.connect.sdk.log.logging_capable
.. automodule:: ingenico.connect.sdk.log.log_message
:members:
:show-inheritance:
:undoc-members:
:special-members:
:exclude-members: __dict__,__weakref__,__module__,__get__

.. automodule:: ingenico.connect.sdk.log.logging_util
.. automodule:: ingenico.connect.sdk.log.logging_capable
:members:
:show-inheritance:
:undoc-members:
:special-members:
:exclude-members: __dict__,__weakref__,__module__,__get__

.. automodule:: ingenico.connect.sdk.log.log_message
.. automodule:: ingenico.connect.sdk.log.logging_util
:members:
:show-inheritance:
:undoc-members:
Expand Down
16 changes: 14 additions & 2 deletions ingenico/connect/sdk/domain/metadata/shopping_cart_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class ShoppingCartExtension(DataObject):
def __init__(self, creator, name, version):
def __init__(self, creator, name, version, extension_id=None):
if not creator:
raise ValueError("creator is required")
if not name:
Expand All @@ -12,12 +12,14 @@ def __init__(self, creator, name, version):
self.__creator = creator
self.__name = name
self.__version = version
self.__extension_id = extension_id

def to_dictionary(self):
dictionary = super(ShoppingCartExtension, self).to_dictionary()
self._add_to_dictionary(dictionary, "creator", self.__creator)
self._add_to_dictionary(dictionary, "name", self.__name)
self._add_to_dictionary(dictionary, "version", self.__version)
self._add_to_dictionary(dictionary, "extensionId", self.__extension_id)
return dictionary

def from_dictionary(self, dictionary):
Expand All @@ -28,6 +30,8 @@ def from_dictionary(self, dictionary):
self.__name = dictionary['name']
if 'version' in dictionary:
self.__version = dictionary['version']
if 'extensionId' in dictionary:
self.__extension_id = dictionary['extensionId']
return self

@staticmethod
Expand All @@ -44,7 +48,11 @@ def create_from_dictionary(dictionary):
version = dictionary['version']
else:
raise ValueError("version is required")
return ShoppingCartExtension(creator, name, version)
if 'extensionId' in dictionary:
extension_id = dictionary['extensionId']
else:
extension_id = None
return ShoppingCartExtension(creator, name, version, extension_id)

@property
def creator(self):
Expand All @@ -57,3 +65,7 @@ def name(self):
@property
def version(self):
return self.__version

@property
def extension_id(self):
return self.__extension_id
37 changes: 37 additions & 0 deletions ingenico/connect/sdk/domain/payment/complete_payment_request.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
#
from ingenico.connect.sdk.data_object import DataObject
from ingenico.connect.sdk.domain.payment.definitions.complete_payment_card_payment_method_specific_input import CompletePaymentCardPaymentMethodSpecificInput


class CompletePaymentRequest(DataObject):

__card_payment_method_specific_input = None

@property
def card_payment_method_specific_input(self):
"""
Type: :class:`ingenico.connect.sdk.domain.payment.definitions.complete_payment_card_payment_method_specific_input.CompletePaymentCardPaymentMethodSpecificInput`
"""
return self.__card_payment_method_specific_input

@card_payment_method_specific_input.setter
def card_payment_method_specific_input(self, value):
self.__card_payment_method_specific_input = value

def to_dictionary(self):
dictionary = super(CompletePaymentRequest, self).to_dictionary()
self._add_to_dictionary(dictionary, 'cardPaymentMethodSpecificInput', self.card_payment_method_specific_input)
return dictionary

def from_dictionary(self, dictionary):
super(CompletePaymentRequest, self).from_dictionary(dictionary)
if 'cardPaymentMethodSpecificInput' in dictionary:
if not isinstance(dictionary['cardPaymentMethodSpecificInput'], dict):
raise TypeError('value \'{}\' is not a dictionary'.format(dictionary['cardPaymentMethodSpecificInput']))
value = CompletePaymentCardPaymentMethodSpecificInput()
self.card_payment_method_specific_input = value.from_dictionary(dictionary['cardPaymentMethodSpecificInput'])
return self
17 changes: 17 additions & 0 deletions ingenico/connect/sdk/domain/payment/complete_payment_response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
#
from ingenico.connect.sdk.domain.payment.definitions.create_payment_result import CreatePaymentResult


class CompletePaymentResponse(CreatePaymentResult):

def to_dictionary(self):
dictionary = super(CompletePaymentResponse, self).to_dictionary()
return dictionary

def from_dictionary(self, dictionary):
super(CompletePaymentResponse, self).from_dictionary(dictionary)
return self
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def authorization_mode(self):
"""
| Determines the type of the authorization that will be used. Allowed values:
* FINAL_AUTHORISATION - The payment creation results in an authorization that is ready for capture. Final authorizations can't be reversed and need to be captured for the full amount within 7 days.
* PRE_AUTHORISATION - The payment creation results in a pre-authorisation that is ready for capture. Pre-authortizations can be reversed and can be captured within 30 days. The capture amount can be lower than the authorized amount.
* FINAL_AUTHORIZATION - The payment creation results in an authorization that is ready for capture. Final authorizations can't be reversed and need to be captured for the full amount within 7 days.
* PRE_AUTHORIZATION - The payment creation results in a pre-authorization that is ready for capture. Pre-authortizations can be reversed and can be captured within 30 days. The capture amount can be lower than the authorized amount.
| Only used with some acquirers, ingnored for acquirers that don't support this. In case the acquirer doesn't allow this to be specified the authorizationMode is 'unspecified', which behaves similar to a final authorization.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://epayments-api.developer-ingenico.com/s2sapi/v1/
#
from ingenico.connect.sdk.data_object import DataObject
from ingenico.connect.sdk.domain.definitions.card_without_cvv import CardWithoutCvv


class CompletePaymentCardPaymentMethodSpecificInput(DataObject):

__card = None

@property
def card(self):
"""
Type: :class:`ingenico.connect.sdk.domain.definitions.card_without_cvv.CardWithoutCvv`
"""
return self.__card

@card.setter
def card(self, value):
self.__card = value

def to_dictionary(self):
dictionary = super(CompletePaymentCardPaymentMethodSpecificInput, self).to_dictionary()
self._add_to_dictionary(dictionary, 'card', self.card)
return dictionary

def from_dictionary(self, dictionary):
super(CompletePaymentCardPaymentMethodSpecificInput, self).from_dictionary(dictionary)
if 'card' in dictionary:
if not isinstance(dictionary['card'], dict):
raise TypeError('value \'{}\' is not a dictionary'.format(dictionary['card']))
value = CardWithoutCvv()
self.card = value.from_dictionary(dictionary['card'])
return self
Loading

0 comments on commit 75b7f3a

Please sign in to comment.