This repository has been archived by the owner on Mar 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ingenico ePayments
committed
Aug 4, 2017
1 parent
2f3bbf2
commit 75b7f3a
Showing
20 changed files
with
389 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
22
examples/merchant/payments/get_third_party_status_example.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
ingenico/connect/sdk/domain/payment/complete_payment_request.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
17
ingenico/connect/sdk/domain/payment/complete_payment_response.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...ect/sdk/domain/payment/definitions/complete_payment_card_payment_method_specific_input.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.