Skip to content

Commit 0ec33de

Browse files
Release 6.4.0
1 parent f94de15 commit 0ec33de

28 files changed

Lines changed: 1765 additions & 22 deletions

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,11 @@ Web Api client: [*link*](https://checkout.postfinance.ch//api/client)<br>
263263
&nbsp;&nbsp;&nbsp;&nbsp;<strong>GET</strong> /payment/bank-transactions/search
264264
&nbsp;&nbsp;&nbsp;&nbsp;Search bank transactions
265265
<br><br>
266+
- <strong>BogusExpressCheckoutService</strong><br>
267+
&nbsp;&nbsp;* <code>post_bogus_express_checkout_on_approve</code>
268+
&nbsp;&nbsp;&nbsp;&nbsp;<strong>POST</strong> /bogus-express-checkout/on-approve
269+
&nbsp;&nbsp;&nbsp;&nbsp;Approve express checkout wallet payment
270+
<br><br>
266271
- <strong>ChargeAttemptsService</strong><br>
267272
&nbsp;&nbsp;* <code>get_payment_charge_attempts</code>
268273
&nbsp;&nbsp;&nbsp;&nbsp;<strong>GET</strong> /payment/charge-attempts
@@ -658,6 +663,16 @@ Web Api client: [*link*](https://checkout.postfinance.ch//api/client)<br>
658663
&nbsp;&nbsp;&nbsp;&nbsp;<strong>GET</strong> /payment/dunning-flows/search
659664
&nbsp;&nbsp;&nbsp;&nbsp;Search dunning flows
660665
<br><br>
666+
- <strong>ExpressCheckoutService</strong><br>
667+
&nbsp;&nbsp;* <code>patch_express_checkout_shipping_address_change</code>
668+
&nbsp;&nbsp;&nbsp;&nbsp;<strong>PATCH</strong> /express-checkout/shipping/address-change
669+
&nbsp;&nbsp;&nbsp;&nbsp;Change shipping address
670+
<br><br>
671+
- <strong>ExpressCheckoutService</strong><br>
672+
&nbsp;&nbsp;* <code>patch_express_checkout_shipping_method_change</code>
673+
&nbsp;&nbsp;&nbsp;&nbsp;<strong>PATCH</strong> /express-checkout/shipping/method-change
674+
&nbsp;&nbsp;&nbsp;&nbsp;Change shipping method
675+
<br><br>
661676
- <strong>ExpressCheckoutService</strong><br>
662677
&nbsp;&nbsp;* <code>post_express_checkout_create_session</code>
663678
&nbsp;&nbsp;&nbsp;&nbsp;<strong>POST</strong> /express-checkout/create-session
@@ -2530,6 +2545,8 @@ Additional Api models documentation: [*link*](https://checkout.postfinance.ch/en
25302545
* <strong>BillingCycleModel</strong>
25312546
* <strong>BillingCycleType</strong>
25322547
* <strong>BillingDayCustomization</strong>
2548+
* <strong>BogusExpressCheckoutApprovalRequest</strong>
2549+
* <strong>BogusExpressCheckoutPaymentData</strong>
25332550
* <strong>CardAuthenticationResponse</strong>
25342551
* <strong>CardAuthenticationVersion</strong>
25352552
* <strong>CardCryptogram</strong>
@@ -2629,10 +2646,15 @@ Additional Api models documentation: [*link*](https://checkout.postfinance.ch/en
26292646
* <strong>DunningFlowSearchResponse</strong>
26302647
* <strong>DunningFlowType</strong>
26312648
* <strong>Environment</strong>
2649+
* <strong>ExpressCheckoutApprovalResponse</strong>
26322650
* <strong>ExpressCheckoutCreateResponse</strong>
26332651
* <strong>ExpressCheckoutSession</strong>
26342652
* <strong>ExpressCheckoutSessionCreate</strong>
26352653
* <strong>ExpressCheckoutSessionState</strong>
2654+
* <strong>ExpressCheckoutShippingAddressChangeRequest</strong>
2655+
* <strong>ExpressCheckoutShippingAddressChangeResponse</strong>
2656+
* <strong>ExpressCheckoutShippingMethodChangeRequest</strong>
2657+
* <strong>ExpressCheckoutShippingMethodChangeResponse</strong>
26362658
* <strong>ExpressCheckoutShippingOption</strong>
26372659
* <strong>ExpressCheckoutWalletType</strong>
26382660
* <strong>ExternalTransferBankTransaction</strong>

postfinancecheckout/__init__.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"""
2626

2727

28-
__version__ = "6.3.0"
28+
__version__ = "6.4.0"
2929

3030
# import apis into sdk package
3131
from postfinancecheckout.service.accounts_service import AccountsService
@@ -34,6 +34,7 @@
3434
from postfinancecheckout.service.application_users_roles_service import ApplicationUsersRolesService
3535
from postfinancecheckout.service.bank_accounts_service import BankAccountsService
3636
from postfinancecheckout.service.bank_transactions_service import BankTransactionsService
37+
from postfinancecheckout.service.bogus_express_checkout_service import BogusExpressCheckoutService
3738
from postfinancecheckout.service.charge_attempts_service import ChargeAttemptsService
3839
from postfinancecheckout.service.charge_bank_transactions_service import ChargeBankTransactionsService
3940
from postfinancecheckout.service.charge_flow_levels_service import ChargeFlowLevelsService
@@ -197,6 +198,8 @@
197198
from postfinancecheckout.models.billing_cycle_model import BillingCycleModel
198199
from postfinancecheckout.models.billing_cycle_type import BillingCycleType
199200
from postfinancecheckout.models.billing_day_customization import BillingDayCustomization
201+
from postfinancecheckout.models.bogus_express_checkout_approval_request import BogusExpressCheckoutApprovalRequest
202+
from postfinancecheckout.models.bogus_express_checkout_payment_data import BogusExpressCheckoutPaymentData
200203
from postfinancecheckout.models.card_authentication_response import CardAuthenticationResponse
201204
from postfinancecheckout.models.card_authentication_version import CardAuthenticationVersion
202205
from postfinancecheckout.models.card_cryptogram import CardCryptogram
@@ -296,10 +299,15 @@
296299
from postfinancecheckout.models.dunning_flow_search_response import DunningFlowSearchResponse
297300
from postfinancecheckout.models.dunning_flow_type import DunningFlowType
298301
from postfinancecheckout.models.environment import Environment
302+
from postfinancecheckout.models.express_checkout_approval_response import ExpressCheckoutApprovalResponse
299303
from postfinancecheckout.models.express_checkout_create_response import ExpressCheckoutCreateResponse
300304
from postfinancecheckout.models.express_checkout_session import ExpressCheckoutSession
301305
from postfinancecheckout.models.express_checkout_session_create import ExpressCheckoutSessionCreate
302306
from postfinancecheckout.models.express_checkout_session_state import ExpressCheckoutSessionState
307+
from postfinancecheckout.models.express_checkout_shipping_address_change_request import ExpressCheckoutShippingAddressChangeRequest
308+
from postfinancecheckout.models.express_checkout_shipping_address_change_response import ExpressCheckoutShippingAddressChangeResponse
309+
from postfinancecheckout.models.express_checkout_shipping_method_change_request import ExpressCheckoutShippingMethodChangeRequest
310+
from postfinancecheckout.models.express_checkout_shipping_method_change_response import ExpressCheckoutShippingMethodChangeResponse
303311
from postfinancecheckout.models.express_checkout_shipping_option import ExpressCheckoutShippingOption
304312
from postfinancecheckout.models.express_checkout_wallet_type import ExpressCheckoutWalletType
305313
from postfinancecheckout.models.external_transfer_bank_transaction import ExternalTransferBankTransaction

postfinancecheckout/api_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ def param_serialize(
181181

182182
# predefined default headers
183183
default_headers = {
184-
'x-meta-sdk-version': '6.3.0',
184+
'x-meta-sdk-version': '6.4.0',
185185
'x-meta-sdk-language': 'python',
186186
'x-meta-sdk-provider': 'postfinancecheckout',
187187
'x-meta-sdk-language-version': platform.python_version()

postfinancecheckout/configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def to_debug_report(self) -> str:
347347
"OS: {env}\n"\
348348
"Python Version: {pyversion}\n"\
349349
"Version of the API: 2.0\n"\
350-
"SDK Package Version: 6.3.0".\
350+
"SDK Package Version: 6.4.0".\
351351
format(env=sys.platform, pyversion=sys.version)
352352

353353
def get_host_settings(self) -> List[HostSetting]:

postfinancecheckout/models/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@
8787
from postfinancecheckout.models.billing_cycle_model import BillingCycleModel
8888
from postfinancecheckout.models.billing_cycle_type import BillingCycleType
8989
from postfinancecheckout.models.billing_day_customization import BillingDayCustomization
90+
from postfinancecheckout.models.bogus_express_checkout_approval_request import BogusExpressCheckoutApprovalRequest
91+
from postfinancecheckout.models.bogus_express_checkout_payment_data import BogusExpressCheckoutPaymentData
9092
from postfinancecheckout.models.card_authentication_response import CardAuthenticationResponse
9193
from postfinancecheckout.models.card_authentication_version import CardAuthenticationVersion
9294
from postfinancecheckout.models.card_cryptogram import CardCryptogram
@@ -186,10 +188,15 @@
186188
from postfinancecheckout.models.dunning_flow_search_response import DunningFlowSearchResponse
187189
from postfinancecheckout.models.dunning_flow_type import DunningFlowType
188190
from postfinancecheckout.models.environment import Environment
191+
from postfinancecheckout.models.express_checkout_approval_response import ExpressCheckoutApprovalResponse
189192
from postfinancecheckout.models.express_checkout_create_response import ExpressCheckoutCreateResponse
190193
from postfinancecheckout.models.express_checkout_session import ExpressCheckoutSession
191194
from postfinancecheckout.models.express_checkout_session_create import ExpressCheckoutSessionCreate
192195
from postfinancecheckout.models.express_checkout_session_state import ExpressCheckoutSessionState
196+
from postfinancecheckout.models.express_checkout_shipping_address_change_request import ExpressCheckoutShippingAddressChangeRequest
197+
from postfinancecheckout.models.express_checkout_shipping_address_change_response import ExpressCheckoutShippingAddressChangeResponse
198+
from postfinancecheckout.models.express_checkout_shipping_method_change_request import ExpressCheckoutShippingMethodChangeRequest
199+
from postfinancecheckout.models.express_checkout_shipping_method_change_response import ExpressCheckoutShippingMethodChangeResponse
193200
from postfinancecheckout.models.express_checkout_shipping_option import ExpressCheckoutShippingOption
194201
from postfinancecheckout.models.express_checkout_wallet_type import ExpressCheckoutWalletType
195202
from postfinancecheckout.models.external_transfer_bank_transaction import ExternalTransferBankTransaction
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# coding: utf-8
2+
3+
"""
4+
PostFinance Python SDK
5+
6+
This library allows to interact with the PostFinance payment service.
7+
8+
Copyright owner: Wallee AG
9+
Website: https://www.postfinance.ch/en/private.html
10+
Developer email: ecosystem-team@wallee.com
11+
12+
Licensed under the Apache License, Version 2.0 (the "License");
13+
you may not use this file except in compliance with the License.
14+
You may obtain a copy of the License at
15+
16+
http://www.apache.org/licenses/LICENSE-2.0
17+
18+
Unless required by applicable law or agreed to in writing, software
19+
distributed under the License is distributed on an "AS IS" BASIS,
20+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21+
See the License for the specific language governing permissions and
22+
limitations under the License.
23+
"""
24+
25+
26+
from __future__ import annotations
27+
import pprint
28+
import re # noqa: F401
29+
import json
30+
31+
from pydantic import BaseModel, ConfigDict, Field
32+
from typing import Any, ClassVar, Dict, List, Optional
33+
from postfinancecheckout.models.bogus_express_checkout_payment_data import BogusExpressCheckoutPaymentData
34+
from typing import Optional, Set
35+
from typing_extensions import Self
36+
37+
class BogusExpressCheckoutApprovalRequest(BaseModel):
38+
"""
39+
BogusExpressCheckoutApprovalRequest
40+
""" # noqa: E501
41+
payment_data: Optional[BogusExpressCheckoutPaymentData] = Field(default=None, alias="paymentData")
42+
__properties: ClassVar[List[str]] = ["paymentData"]
43+
44+
model_config = ConfigDict(
45+
populate_by_name=True,
46+
validate_assignment=True,
47+
protected_namespaces=(),
48+
)
49+
50+
51+
def to_str(self) -> str:
52+
"""Returns the string representation of the model using alias"""
53+
return pprint.pformat(self.model_dump(by_alias=True))
54+
55+
def to_json(self) -> str:
56+
"""Returns the JSON representation of the model using alias"""
57+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
58+
return json.dumps(self.to_dict())
59+
60+
@classmethod
61+
def from_json(cls, json_str: str) -> Optional[Self]:
62+
"""Create an instance of BogusExpressCheckoutApprovalRequest from a JSON string"""
63+
return cls.from_dict(json.loads(json_str))
64+
65+
def to_dict(self) -> Dict[str, Any]:
66+
"""Return the dictionary representation of the model using alias.
67+
68+
This has the following differences from calling pydantic's
69+
`self.model_dump(by_alias=True)`:
70+
71+
* `None` is only added to the output dict for nullable fields that
72+
were set at model initialization. Other fields with value `None`
73+
are ignored.
74+
"""
75+
excluded_fields: Set[str] = set([
76+
])
77+
78+
_dict = self.model_dump(
79+
by_alias=True,
80+
exclude=excluded_fields,
81+
exclude_none=True,
82+
)
83+
# override the default output from pydantic by calling `to_dict()` of payment_data
84+
if self.payment_data:
85+
_dict['paymentData'] = self.payment_data.to_dict()
86+
return _dict
87+
88+
@classmethod
89+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
90+
"""Create an instance of BogusExpressCheckoutApprovalRequest from a dict"""
91+
if obj is None:
92+
return None
93+
94+
if not isinstance(obj, dict):
95+
return cls.model_validate(obj)
96+
97+
_obj = cls.model_validate({
98+
"paymentData": BogusExpressCheckoutPaymentData.from_dict(obj["paymentData"]) if obj.get("paymentData") is not None else None
99+
})
100+
return _obj
101+
102+
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# coding: utf-8
2+
3+
"""
4+
PostFinance Python SDK
5+
6+
This library allows to interact with the PostFinance payment service.
7+
8+
Copyright owner: Wallee AG
9+
Website: https://www.postfinance.ch/en/private.html
10+
Developer email: ecosystem-team@wallee.com
11+
12+
Licensed under the Apache License, Version 2.0 (the "License");
13+
you may not use this file except in compliance with the License.
14+
You may obtain a copy of the License at
15+
16+
http://www.apache.org/licenses/LICENSE-2.0
17+
18+
Unless required by applicable law or agreed to in writing, software
19+
distributed under the License is distributed on an "AS IS" BASIS,
20+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21+
See the License for the specific language governing permissions and
22+
limitations under the License.
23+
"""
24+
25+
26+
from __future__ import annotations
27+
import pprint
28+
import re # noqa: F401
29+
import json
30+
31+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
32+
from typing import Any, ClassVar, Dict, List, Optional
33+
from typing import Optional, Set
34+
from typing_extensions import Self
35+
36+
class BogusExpressCheckoutPaymentData(BaseModel):
37+
"""
38+
BogusExpressCheckoutPaymentData
39+
""" # noqa: E501
40+
payment_token: Optional[StrictStr] = Field(default=None, description="Wallet-generated payment token collected during approval.", alias="paymentToken")
41+
cryptogram: Optional[StrictStr] = Field(default=None, description="Wallet-generated cryptogram collected during approval.")
42+
__properties: ClassVar[List[str]] = ["paymentToken", "cryptogram"]
43+
44+
model_config = ConfigDict(
45+
populate_by_name=True,
46+
validate_assignment=True,
47+
protected_namespaces=(),
48+
)
49+
50+
51+
def to_str(self) -> str:
52+
"""Returns the string representation of the model using alias"""
53+
return pprint.pformat(self.model_dump(by_alias=True))
54+
55+
def to_json(self) -> str:
56+
"""Returns the JSON representation of the model using alias"""
57+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
58+
return json.dumps(self.to_dict())
59+
60+
@classmethod
61+
def from_json(cls, json_str: str) -> Optional[Self]:
62+
"""Create an instance of BogusExpressCheckoutPaymentData from a JSON string"""
63+
return cls.from_dict(json.loads(json_str))
64+
65+
def to_dict(self) -> Dict[str, Any]:
66+
"""Return the dictionary representation of the model using alias.
67+
68+
This has the following differences from calling pydantic's
69+
`self.model_dump(by_alias=True)`:
70+
71+
* `None` is only added to the output dict for nullable fields that
72+
were set at model initialization. Other fields with value `None`
73+
are ignored.
74+
* OpenAPI `readOnly` fields are excluded.
75+
* OpenAPI `readOnly` fields are excluded.
76+
"""
77+
excluded_fields: Set[str] = set([
78+
"payment_token",
79+
"cryptogram",
80+
])
81+
82+
_dict = self.model_dump(
83+
by_alias=True,
84+
exclude=excluded_fields,
85+
exclude_none=True,
86+
)
87+
return _dict
88+
89+
@classmethod
90+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
91+
"""Create an instance of BogusExpressCheckoutPaymentData from a dict"""
92+
if obj is None:
93+
return None
94+
95+
if not isinstance(obj, dict):
96+
return cls.model_validate(obj)
97+
98+
_obj = cls.model_validate({
99+
"paymentToken": obj.get("paymentToken"),
100+
"cryptogram": obj.get("cryptogram")
101+
})
102+
return _obj
103+
104+

0 commit comments

Comments
 (0)