Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
39c1550
Refactored `IyzipayResource` to remove v1 auth structure and redundan…
osman-keser Dec 14, 2025
faaa9ff
Added missing `api_key` and `secret_key` to API test configuration.
osman-keser Dec 14, 2025
9b90403
Updated image path in sample scripts to use `./images/` directory and…
osman-keser Dec 14, 2025
b61b1c5
Added `ThreedsV2Payment` resource and sample script for 3D Secure v2 …
osman-keser Dec 15, 2025
99b443f
Updated sample `create_threeds_v2_payment.py` with realistic test dat…
osman-keser Dec 15, 2025
0d53bf1
Added `fast_link` method to `IyziLinkProduct` and sample script for g…
osman-keser Dec 28, 2025
7dbdb62
Added `update_product_status` method to `IyziLinkProduct` and sample …
osman-keser Dec 28, 2025
29e0baf
Added `update_item` method for Marketplace sub merchants and a sample…
osman-keser Dec 29, 2025
3b4839c
Added `refund` Payment service method to `IyzipayResource` and sample…
osman-keser Dec 29, 2025
497e8cf
Added `PayWithIyzico` resource and sample script for initializing Pay…
osman-keser Dec 29, 2025
5be1523
Updated `RetrievePaymentDetails` method to support `paymentId` as an …
osman-keser Jan 4, 2026
9ebd66b
Added `ReportingScrollTransaction` resource to retrieve paginated tra…
osman-keser Jan 4, 2026
88cdcc8
Added `SubscriptionProduct` resource and sample script for creating s…
osman-keser Feb 1, 2026
201955b
Added `list` method to `SubscriptionProduct` and sample script for li…
osman-keser Feb 1, 2026
ccf90c4
Added `retrieve` method to `SubscriptionProduct` and sample script fo…
osman-keser Feb 1, 2026
b228d29
Added `delete` method to `SubscriptionProduct` and sample script for …
osman-keser Feb 1, 2026
61d3136
Added `update` method to `SubscriptionProduct` and sample script for …
osman-keser Feb 1, 2026
92ac179
Added `SubscriptionPricingPlan` resource and sample script for creati…
osman-keser Feb 1, 2026
c4a4666
Added `list` method to `SubscriptionPricingPlan` and sample script fo…
osman-keser Feb 1, 2026
832f80e
Added `update` method to `SubscriptionPricingPlan` and sample script …
osman-keser Feb 1, 2026
d519706
Added `retrieve` method to `SubscriptionPricingPlan` and sample scrip…
osman-keser Feb 1, 2026
e0d7e0f
Added `delete` method to `SubscriptionPricingPlan` and sample script …
osman-keser Feb 1, 2026
8698dc7
Added `create` method to `SubscriptionCheckoutForm` and sample script…
osman-keser Feb 1, 2026
33e7679
Added `retrieve` method to `SubscriptionCheckoutForm` and sample scri…
osman-keser Feb 1, 2026
8e61a15
Added `retrieve` method to `Subscription` and sample script for listi…
osman-keser Feb 1, 2026
06dd325
Refactored variable names in subscription samples for clarity and con…
osman-keser Feb 1, 2026
356eabc
Added `initialize` method to `Subscription` and sample script for ini…
osman-keser Feb 1, 2026
1aafa0c
Added `initialize_with_customer` method to `Subscription` and sample …
osman-keser Feb 1, 2026
603c9cc
Renamed `subscription_list.py` to `subscription_retrieve.py` in subsc…
osman-keser Feb 1, 2026
dc15660
Added `payment_card_pki` method to `iyzipay_resource.py` for building…
osman-keser Feb 1, 2026
d5bbe83
Added `list` method to `Subscription` and sample script for listing s…
osman-keser Feb 1, 2026
996b10d
Added `activate` method to `Subscription` and sample script for activ…
osman-keser Feb 2, 2026
68ec60c
Added `retry` method to `Subscription` and sample script for retrying…
osman-keser Feb 2, 2026
a7770d5
Added `cancel` method to `Subscription` and sample script for canceli…
osman-keser Feb 2, 2026
4ed2d39
Added `upgrade` method to `Subscription` and sample script for upgrad…
osman-keser Feb 2, 2026
7f3daaa
Added `SubscriptionCardUpdate` class with `initialize` and `initializ…
osman-keser Feb 2, 2026
f8fe94a
Added `SubscriptionCustomer` class with `create` method and sample sc…
osman-keser Feb 2, 2026
8fcdade
Added `update` method to `SubscriptionCustomer` and sample script for…
osman-keser Feb 2, 2026
871a50f
Added `retrieve` method to `SubscriptionCustomer` and sample script f…
osman-keser Feb 2, 2026
7eafd6d
Added `delete` method to `SubscriptionCustomer` and sample script for…
osman-keser Feb 2, 2026
19ea4f7
Added `list` method to `SubscriptionCustomer` and sample script for l…
osman-keser Feb 2, 2026
d031f8e
Added `PayWithIyzico` to imports and corrected HTTP method for `Subsc…
osman-keser Feb 16, 2026
cef1892
Removed debug print statement from `delete` method in `iyzipay_resource`
osman-keser Feb 16, 2026
576f573
Fixed incorrect print statement in `subscription_pricing_plan_delete.…
osman-keser Feb 17, 2026
78e20ef
Updated Python version classifiers in `setup.py`, added support for P…
osman-keser Feb 18, 2026
04da959
Updated GitHub Actions: Upgraded `actions/checkout` to v4, `actions/s…
osman-keser Feb 18, 2026
4ac8462
Merge branch 'master' into @basefy/subscription
byasarcse Feb 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/github_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: '3.x'

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/github_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:

strategy:
matrix:
python-version: ['3.12', '3.13', '3.14']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
13 changes: 11 additions & 2 deletions iyzipay/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
Payment,
ThreedsInitialize,
ThreedsPayment,
ThreedsV2Payment,
Cancel,
Refund,
Card,
Expand Down Expand Up @@ -49,11 +50,19 @@
BasicBkmInitialize,
RetrievePaymentDetails,
RetrieveTransactions,
ReportingScrollTransaction,
IyziLinkProduct,
IyziFileBase64Encoder,
RetrieveLoyalty)
RetrieveLoyalty,
PayWithIyzico,
SubscriptionProduct,
SubscriptionPricingPlan,
SubscriptionCheckoutForm,
Subscription,
SubscriptionCardUpdate,
SubscriptionCustomer
)

from iyzipay.pki_builder import ( # noqa
PKIBuilder,
)

874 changes: 246 additions & 628 deletions iyzipay/iyzipay_resource.py

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion samples/api_test.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import iyzipay

options = {
'base_url': iyzipay.base_url
'secret_key': iyzipay.secret_key,
'api_key': iyzipay.api_key,
'base_url': iyzipay.base_url,
}

api_test = iyzipay.ApiTest().retrieve(options)
Expand Down
33 changes: 33 additions & 0 deletions samples/create_threeds_v2_payment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import json
import iyzipay

options = {
'api_key': iyzipay.api_key,
'secret_key': iyzipay.secret_key,
'base_url': iyzipay.base_url
}

request = {
'locale': 'tr',
'conversationId': '123456789',
'paymentId': '1',
'paidPrice': 1.2,
'basketId': 'B67832',
'currency': 'TRY'
}

threeds_payment = iyzipay.ThreedsV2Payment()
threeds_payment_result = threeds_payment.create(request, options)
threeds_payment_response = json.load(threeds_payment_result)
print('response:', threeds_payment_response)

if threeds_payment_response['status'] == 'success':
secret_key = options['secret_key']
paymentId = threeds_payment_response['paymentId']
currency = threeds_payment_response['currency']
basketId = threeds_payment_response['basketId']
conversationId = threeds_payment_response['conversationId']
paidPrice = threeds_payment.strip_zero(str(threeds_payment_response['paidPrice']))
price = threeds_payment.strip_zero(str(threeds_payment_response['price']))
signature = threeds_payment_response['signature']
threeds_payment.verify_signature([paymentId, currency, basketId, conversationId, paidPrice, price], secret_key, signature)
Binary file added samples/images/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions samples/initialize_pay_with_iyzico.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import iyzipay

options = {
'api_key': iyzipay.api_key,
'secret_key': iyzipay.secret_key,
'base_url': iyzipay.base_url
}

buyer = {
"id": "buyerID",
"name": "buyerName",
"surname": "buyerSurname",
"identityNumber": "11111",
"email": "test@gmail.com",
"gsmNumber": "+905554443322",
"registrationAddress": "Burhaniye Mahallesi Atilla Sokak No:7 Üsküdar",
"city": "Istanbul",
"country": "Turkey",
"ip": "85.34.78.112"
}

address = {
"address": "Burhaniye Mahallesi Atilla Sokak No:7 Üsküdar",
"contactName": "Contact Name",
"city": "Istanbul",
"country": "Turkey"
}

basket_items = [
{
"id": "ItemID",
"price": "1000.0",
"name": "IPHONE 11 64GB WHITE NON ACC Beden:KK06 ,Renk:Beyaz",
"category1": "IPHONE 11",
"itemType": "PHYSICAL",
"chargedFromMerchant": "True"
}
]

request = {
"locale": "tr",
"conversationId": "conversationID",
"price": "1000.0",
"basketId": "B67832",
"paymentGroup": "PRODUCT",
"callbackUrl": "https://callback.requestcatcher.com/test",
"currency": "TRY",
"cancelUrl": "https://www.cancelUrl.com/",
"paidPrice": "30.0",
"enabledInstallments": [
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
],
'buyer': buyer,
'shippingAddress': address,
'billingAddress': address,
'basketItems': basket_items
}

report = iyzipay.PayWithIyzico().create(request, options)

print(report.read().decode('utf-8'))
2 changes: 1 addition & 1 deletion samples/iyzilink_create_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"conversationId": "123456789",
"currencyCode": "TRY",
"description": "test product new",
"encodedImageFile": iyzipay.IyziFileBase64Encoder.encode("image.png"),
"encodedImageFile": iyzipay.IyziFileBase64Encoder.encode("./images/image.png"),
"installmentRequested": False,
"locale": "tr",
"name": "awsome product",
Expand Down
19 changes: 19 additions & 0 deletions samples/iyzilink_fast_link.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import iyzipay

options = {
'api_key': iyzipay.api_key,
'secret_key': iyzipay.secret_key,
'base_url': iyzipay.base_url
}

request = {
"description": "ft-description-fast-link",
"price": 10,
"currencyCode": "TRY",
"sourceType": "WEB",
"locale": "tr",
"conversationId": "123456789"
}

report = iyzipay.IyziLinkProduct().fast_link(request, options)
print(report.read().decode('utf-8'))
2 changes: 1 addition & 1 deletion samples/iyzilink_update_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"conversationId": "123456789",
"currencyCode": "TRY",
"description": "iyzi product name",
"encodedImageFile": iyzipay.IyziFileBase64Encoder.encode("image.png"),
"encodedImageFile": iyzipay.IyziFileBase64Encoder.encode("./images/image.png"),
"installmentRequested": False,
"locale": "tr",
"name": "iyzi product",
Expand Down
17 changes: 17 additions & 0 deletions samples/iyzilink_update_product_status.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import iyzipay

options = {
'api_key': iyzipay.api_key,
'secret_key': iyzipay.secret_key,
'base_url': iyzipay.base_url
}

request = {
"conversationId": "123456789",
"locale": "tr",
"token": "WxI",
"status": "PASSIVE"
}

report = iyzipay.IyziLinkProduct().update_product_status(request, options)
print(report.read().decode('utf-8'))
19 changes: 19 additions & 0 deletions samples/refund_payment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import iyzipay

options = {
'api_key': iyzipay.api_key,
'secret_key': iyzipay.secret_key,
'base_url': iyzipay.base_url
}

request = {
"locale": "tr",
"conversationId": "conversationId",
"paymentId": "2921546163",
"price": "3.0",
"ip": "85.34.78.112"
}

sub_merchant = iyzipay.Payment().refund(request, options)

print(sub_merchant.read().decode('utf-8'))
6 changes: 4 additions & 2 deletions samples/retrieve_payment_detail.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
}

request = {
'paymentConversationId': '123456s789'
'paymentConversationId': '123456s789',
'paymentId': 1
}
# Both parameters are not mandatory; one of two is enough

report = iyzipay.RetrievePaymentDetails().retrieve(request, options)
print(report.read().decode('utf-8'))

15 changes: 15 additions & 0 deletions samples/subscriptions/subscription_activate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import iyzipay

options = {
'api_key': iyzipay.api_key,
'secret_key': iyzipay.secret_key,
'base_url': iyzipay.base_url
}

request = {
"referenceCode": "a2077643-bab7-4b73-85a5-7676c78d7c66"
}

subscription = iyzipay.Subscription().activate(request, options)

print(subscription.read().decode('utf-8'))
15 changes: 15 additions & 0 deletions samples/subscriptions/subscription_cancel.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import iyzipay

options = {
'api_key': iyzipay.api_key,
'secret_key': iyzipay.secret_key,
'base_url': iyzipay.base_url
}

request = {
"subscriptionReferenceCode": "a2077643-bab7-4b73-85a5-7676c78d7c66"
}

subscription = iyzipay.Subscription().cancel(request, options)

print(subscription.read().decode('utf-8'))
17 changes: 17 additions & 0 deletions samples/subscriptions/subscription_card_update_init.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import iyzipay

options = {
'api_key': iyzipay.api_key,
'secret_key': iyzipay.secret_key,
'base_url': iyzipay.base_url
}

request = {
"locale": "tr",
"callbackUrl": "https://www.merchant.com/callback",
"customerReferenceCode": "7d96e96c-7850-4c63-9ae0-1c9d359e6565"
}

subscription = iyzipay.SubscriptionCardUpdate().initialize(request, options)

print(subscription.read().decode('utf-8'))
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import iyzipay

options = {
'api_key': iyzipay.api_key,
'secret_key': iyzipay.secret_key,
'base_url': iyzipay.base_url
}

request = {
"locale": "tr",
"conversationId": "123456",
"callbackUrl": "https://www.merchant.com/callback",
"subscriptionReferenceCode": "7d96e96c-7850-4c63-9ae0-1c9d359e6565"
}

subscription = iyzipay.SubscriptionCardUpdate().initialize_with_subscription(request, options)

print(subscription.read().decode('utf-8'))
39 changes: 39 additions & 0 deletions samples/subscriptions/subscription_checkout_form_initialize.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import iyzipay

options = {
'api_key': iyzipay.api_key,
'secret_key': iyzipay.secret_key,
'base_url': iyzipay.base_url
}

request = {
"callbackUrl": "http://localhost",
"pricingPlanReferenceCode": "36fcd8e3-f99b-4b19-9dc4-f7c30d7f0cd4",
"subscriptionInitialStatus": "ACTIVE",
"conversationId": "123456789",
"customer": {
"name": "John",
"surname": "Stone",
"email": "john@gmail.com",
"gsmNumber": "+905545545512",
"identityNumber": "1234567890",
"billingAddress": {
"address": "Altunizade Mah. İnci Çıkmazı Sokak No: 3 İç Kapı No: 10 Üsküdar İstanbul",
"zipCode": "34345",
"contactName": "contactName",
"city": "Istanbul",
"country": "Türkiye"
},
"shippingAddress": {
"address": "Altunizade Mah. İnci Çıkmazı Sokak No: 3 İç Kapı No: 10 Üsküdar İstanbul",
"zipCode": "34345",
"contactName": "contactName",
"city": "Istanbul",
"country": "Türkiye"
}
}
}

checkout_form = iyzipay.SubscriptionCheckoutForm().create(request, options)

print(checkout_form.read().decode('utf-8'))
15 changes: 15 additions & 0 deletions samples/subscriptions/subscription_checkout_form_retrieve.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import iyzipay

options = {
'api_key': iyzipay.api_key,
'secret_key': iyzipay.secret_key,
'base_url': iyzipay.base_url
}

token = {
'token': 'b94c27b3-e65f-4e87-880c-54720174d970'
}

checkout_form = iyzipay.SubscriptionCheckoutForm().retrieve(token, options)

print(checkout_form.read().decode('utf-8'))
Loading