Skip to content

Commit ae88206

Browse files
feat: add store_for_future_use field and update payment tests (#176)
- Introduced `store_for_future_use` property in `PaymentRequestNetworkTokenSource`. - Marked multiple tests as skipped using `@pytest.mark.skip(reason='not available')`. - Enhanced `create_hosted_payments_request` to include `display_name`. - Removed assertions for warnings in payment link tests. - Refined `test_should_make_knet_payment` to validate payment response instead of checking errors.
1 parent dc3fc0c commit ae88206

11 files changed

+32
-19
lines changed

checkout_sdk/payments/payments.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,7 @@ class PaymentRequestNetworkTokenSource(PaymentRequestSource):
243243
cryptogram: str
244244
eci: str
245245
stored: bool
246+
store_for_future_use: bool
246247
name: str
247248
cvv: str
248249
billing_address: Address

tests/instruments/instruments_integration_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ def test_should_create_and_delete_instrument(default_api):
140140
default_api.instruments.get(create_instrument_response.id)
141141

142142

143+
@pytest.mark.skip(reason='not available')
143144
def test_should_get_bank_account_field_formatting(oauth_api):
144145
query = BankAccountFieldQuery()
145146
query.account_holder_type = AccountHolderType.INDIVIDUAL

tests/instruments/instruments_previous_integration_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from tests.checkout_test_utils import assert_response, phone, VisaCard, address, NAME
1010

1111

12+
@pytest.mark.skip(reason='not available')
1213
def test_should_create_and_get_instrument(previous_api):
1314
create_instrument_response = create_token_instrument(previous_api)
1415
assert_response(create_instrument_response,
@@ -52,6 +53,7 @@ def test_should_create_and_get_instrument(previous_api):
5253
'type')
5354

5455

56+
@pytest.mark.skip(reason='not available')
5557
def test_should_create_and_update_instrument(previous_api):
5658
create_instrument_response = create_token_instrument(previous_api)
5759

@@ -70,6 +72,7 @@ def test_should_create_and_update_instrument(previous_api):
7072
assert get_instrument_response.expiry_month == 12
7173

7274

75+
@pytest.mark.skip(reason='not available')
7376
def test_should_create_and_delete_instrument(previous_api):
7477
create_instrument_response = create_token_instrument(previous_api)
7578

tests/payments/hosted/hosted_payments_integration_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def create_hosted_payments_request():
8484
request.reference = 'reference'
8585
request.currency = Currency.GBP
8686
request.description = 'Payment for Gold Necklace'
87+
request.display_name = 'Gold Necklace'
8788
request.customer = customer_request
8889
request.shipping = shipping_details
8990
request.billing = billing_information

tests/payments/links/payments_links_integration_test.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,7 @@ def test_should_create_and_get_payment_link(default_api):
2828
'http_metadata',
2929
'id',
3030
'reference',
31-
'expires_on',
32-
'warnings')
33-
34-
for warning in response.warnings:
35-
assert_response(warning,
36-
'code',
37-
'value',
38-
'description')
31+
'expires_on')
3932

4033
hosted_details = default_api.payments_links.get_payment_link(response.id)
4134

tests/payments/links/payments_links_previous_integration_test.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,7 @@ def test_should_create_and_get_payment_link(previous_api):
2020
'expires_on',
2121
'_links',
2222
'_links.self',
23-
'_links.redirect',
24-
'warnings')
25-
26-
for warning in response.warnings:
27-
assert_response(warning,
28-
'code',
29-
'value',
30-
'description')
23+
'_links.redirect')
3124

3225
hosted_details = previous_api.payments_links.get_payment_link(response.id)
3326

tests/payments/previous/refund_payments_previous_integration_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22

33
from datetime import datetime, timezone
44

5+
import pytest
6+
57
from checkout_sdk.payments.payments import RefundRequest
68
from tests.checkout_test_utils import new_uuid, assert_response, new_idempotency_key, retriable
79
from tests.payments.previous.payments_previous_test_utils import make_card_payment
810

911

12+
@pytest.mark.skip(reason='not available')
1013
def test_should_refund_card_payment(previous_api):
1114
payment_response = make_card_payment(previous_api, capture_on=datetime.now(timezone.utc))
1215

@@ -24,6 +27,7 @@ def test_should_refund_card_payment(previous_api):
2427
'_links')
2528

2629

30+
@pytest.mark.skip(reason='not available')
2731
def test_should_refund_card_payment_idempotently(previous_api):
2832
payment_response = make_card_payment(previous_api, capture_on=datetime.now(timezone.utc))
2933

tests/payments/previous/request_payments_previous_integration_test.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from datetime import datetime, timezone
44

5+
import pytest
6+
57
from tests.checkout_test_utils import assert_response, new_idempotency_key
68
from tests.payments.previous.payments_previous_test_utils import make_card_payment, make_3ds_card_payment, \
79
make_token_payment
@@ -52,6 +54,7 @@ def test_should_request_card_payment(previous_api):
5254
assert payment_response.source.type == 'card'
5355

5456

57+
@pytest.mark.skip(reason='not available')
5558
def test_should_request_card_3ds_payment(previous_api):
5659
payment_response = make_3ds_card_payment(previous_api, False)
5760

@@ -67,6 +70,7 @@ def test_should_request_card_3ds_payment(previous_api):
6770
'customer.email')
6871

6972

73+
@pytest.mark.skip(reason='not available')
7074
def test_should_request_card_3ds_payment_n3d(previous_api):
7175
payment_response = make_3ds_card_payment(previous_api, True)
7276

@@ -112,6 +116,7 @@ def test_should_request_card_3ds_payment_n3d(previous_api):
112116
assert payment_response.source.type == 'card'
113117

114118

119+
@pytest.mark.skip(reason='not available')
115120
def test_should_request_token_payment(previous_api):
116121
payment_response = make_token_payment(previous_api)
117122

tests/payments/previous/request_payouts_previous_integration_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
from __future__ import absolute_import
22

3+
import pytest
4+
35
from checkout_sdk.common.enums import Currency
46
from checkout_sdk.payments.payments_previous import PayoutRequest, PaymentRequestCardDestination
57
from tests.checkout_test_utils import VisaCard, phone, LAST_NAME, FIRST_NAME, new_uuid, assert_response, retriable
68

79

10+
@pytest.mark.skip(reason='not available')
811
def test_should_request_payout(previous_api):
912
destination = PaymentRequestCardDestination()
1013
destination.name = VisaCard.name

tests/payments/request_apm_payments_integration_test.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def test_should_request_ideal_payment(default_api):
5858
'status')
5959

6060

61+
@pytest.mark.skip(reason='not available')
6162
def test_should_request_sofort_payment(default_api):
6263
payment_request = PaymentRequest()
6364
payment_request.source = RequestSofortSource()
@@ -263,9 +264,14 @@ def test_should_make_knet_payment(default_api):
263264
payment_request.success_url = SUCCESS_URL
264265
payment_request.failure_url = FAILURE_URL
265266

266-
check_error_item(callback=default_api.payments.request_payment,
267-
error_item=PAYEE_NOT_ONBOARDED,
268-
payment_request=payment_request)
267+
payment_response = retriable(callback=default_api.payments.request_payment,
268+
payment_request=payment_request)
269+
assert_response(payment_response,
270+
'http_metadata',
271+
'id',
272+
'status',
273+
'_links',
274+
'_links.self')
269275

270276

271277
def test_should_make_bancontact_payment(default_api):

tests/tokens/tokens_previous_integration_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
import pytest
2+
13
from checkout_sdk.tokens.tokens import CardTokenRequest
24
from tests.checkout_test_utils import assert_response, address, phone
35

46

7+
@pytest.mark.skip(reason='not available')
58
def test_should_create_card_token(previous_api):
69
request = CardTokenRequest()
710
request.number = '4242424242424242'

0 commit comments

Comments
 (0)