Skip to content

V2 - #259

Merged
nuryagdym merged 144 commits into
masterfrom
v2
Jul 9, 2026
Merged

V2#259
nuryagdym merged 144 commits into
masterfrom
v2

Conversation

@nuryagdym

@nuryagdym nuryagdym commented Dec 31, 2024

Copy link
Copy Markdown
Collaborator

Minimum PHP sürümü 8.0'a yükseltildi. symfony/http-foundation bağımlılığı kaldırıldı.

Geçiş adımları için UPGRADE-v2.md dosyasına bakınız.


Yeni Gateway'ler

  • IyzicoPos — NonSecure, 3DSecure, 3DHost
  • PayTrPos — 3DPay (Direkt API), 3DHost (iFrame API). Diğer gateway'lerden farklı bir callback akışı vardır; detaylar için THREED-PAYMENT-PAYTR_EXAMPLE.md dosyasına bakınız.
  • Param3DHostPos — 3DHost. ParamPos'un 3DHost ödeme akışı ayrı bir gateway'e taşındı;

Yeni Özellik: PosQuery

  • PosQueryInterface (src/PosQuery/PosQueryInterface.php) eklendi.
    Sipariş ile ilişkili olmayan banka sorguları ayrı bir arayüze taşındı:
    genel işlem geçmişi (history), ham API çağrıları (customQuery).
  • QUERY_TYPE_INSTALLMENT_RATES ve QUERY_TYPE_INSTALLMENT_PRICES — yeni sorgu tipleri.
    Bkz. INSTALLMENT-RATES-PRICES-EXAMPLE.md.
    • getInstallmentRates(array $params): verilen BIN için taksit oranlarını döndürür.
    • getInstallmentPrices(array $params): verilen BIN ve tutar için her taksitte ödenecek hesaplanmış tutarları döndürür.
  • QUERY_TYPE_BIN_LIST — yeni sorgu tipi.
    • getBinList(array $params): verilen BIN numarasına ait kart bilgilerini sorgular. Bkz. BIN-LIST-EXAMPLE.md.
  • PosQueryRequestDataPreparedEventPosQuery isteklerinde API verisini değiştirmeye olanak tanıyan yeni event.

Kırıcı Değişiklikler

  • PosInterface::TX_TYPE_HISTORY ve TX_TYPE_CUSTOM_QUERY kaldırıldı.
    Bu sabitler ve ilgili history() / customQuery() metotları PosQueryInterface'e taşındı; (bkz. UPGRADE-v2.md).
  • Fluent interface kaldırıldı. payment(), cancel(), refund(), status() ve diğer tüm işlem metotları artık doğrudan array döndürüyor; getResponse() çağrısına gerek kalmadı.
  • 3D callback parametresi değişti. make3DPayment() ve benzeri metotlar artık Symfony Request nesnesi değil,
    düz PHP dizisi ($_POST / $_GET) kabul ediyor.
  • PosFactory::createPosGateway()PosFactory::create() olarak yeniden adlandırıldı.
  • AccountFactory$lang ve $model parametreleri kaldırıldı.
    Dil artık gateway_configs.lang config anahtarıyla ayarlanıyor.
  • get3DFormData()$createWithoutCard varsayılanı true'dan false'a değişti.
  • Gateway'e özel sipariş verileri artık $order dizisiyle geçiliyor.
    KuveytPos için alıcı bilgisi (buyer), adres ve sepet içeriği gibi ekstra alanlar v1'de RequestDataPreparedEvent listener'ı içinde ekleniyordu.
    v2'de bu veriler doğrudan $order dizisine dahil ediliyor.
  • KuveytPos ve VakifKatilimPos get3DFormData() artık HTML string döndürüyor.
  • setTestMode() kaldırıldı. Test modu artık gateway_configs.test_mode config anahtarıyla ayarlanıyor.
  • status_detail response alanı kaldırıldı. 3D ödeme response'larından md_status_detail da kaldırıldı.
  • Config currencies anahtarı kaldırıldı. v1'de config dosyasına üst düzey currencies anahtarı eklenerek para birimi eşleştirmeleri özelleştirilebiliyordu.
  • Config name anahtarı kaldırıldı. Banka config dosyalarındaki (pos_test.php, pos_production.php) name anahtarı hiçbir zaman kodda kullanılmıyordu ve kaldırıldı.
  • Config endpoint değişiklikleri. ParamPos yapılandırmasından payment_api_2 ve gateway_3d_host anahtarları kaldırıldı;
    3DHost akışı artık ayrı Param3DHostPos gateway'i üzerinden yürütülüyor.
    KuveytPos, VakifKatilimPos ve PayFlexCPV4Pos yapılandırmalarından gateway_3d anahtarı kaldırıldı (gateway tarafından dahili olarak türetiliyor);
    PayFlexCPV4Pos için payment_api URL'i de kısaltıldı.
  • Gateway ve namespace yeniden adlandırmaları: GatewaysGateway, ExceptionsException, EntityModel; EstPos/EstV3PosAssecoPos, PosNetPosNetPos ve ilgili account/factory isimleri güncellendi.
  • AbstractPosAccount metot yeniden adlandırmaları: getBank()getBankName(), getClientId()getMerchantId(), getStoreKey()getSecretKey(), getLang() kaldırıldı.
  • Exception yeniden adlandırması: BankClassNullExceptionGatewayClassNotConfiguredException.
  • BankNotFoundException kaldırıldı.

Gateway'e Özel Davranış Değişiklikleri

  • PosNet — iptal işleminde işlem tipi artık dinamik. v1'de PosNet iptal isteğinde işlem tipi sabit olarak sale gönderiliyordu;

Yeni Özellikler

  • AccountFactory::createForGateway() — gateway sınıfı ve kimlik bilgilerinin düz bir dizi olarak geçilmesiyle account oluşturmayı sağlar;
    framework entegrasyonlarında kullanışlıdır.
  • PosException marker interface — kütüphaneden fırlatılan tüm exception'lar bu interface'i implement ediyor;
    tek catch bloğuyla tüm kütüphane hatalarını yakalamak mümkün.
  • AbstractGateway::getCrypt() — gateway'in dahili crypt nesnesine erişim için yeni public metot; özel sorgu (customQuery) imzalamada kullanışlıdır.
  • get3DFormData() — yeni $formFormat parametresiFORM_FORMAT_ARRAY veya FORM_FORMAT_HTML seçeneklerinden biri belirtilebilir.

Don't parse HTML to array and just return as it is. Parsing may cause issues in the future.
Don't parse HTML to array and just return as it is. Parsing may cause issues in the future.
$paymentModel   = PosInterface::MODEL_3D_SECURE;
$paymentModel   = PosInterface::MODEL_NON_SECURE;
$postParameters = $request->request;
nuryagdym and others added 13 commits June 29, 2026 13:45
The method exposed raw config internals and is not part of PosInterface.
No callers exist outside of tests. Removed the method and the
corresponding assertions in every gateway unit test.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…g 3dform data.

also fixed broken functional tests
…nfig

Exposes PSR-18 client injection in PosFactory::createPosGateway() so callers
can pass a pre-configured client (e.g. with verify_peer/verify_host disabled
for bank test endpoints with self-signed certs).

Also adds functional-test composer scripts for convenience.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… 8.5 compatibility

assert() is a no-op when zend.assertions is disabled, causing a TypeError
on return type mismatch instead of the expected AssertionError on PHP 8.5.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ThreeDSessionId is now appended to the base gateway URL inside
ToslaPosRequestDataMapper::create3DFormData(), matching the pattern
used by PayTrPos. The get3DGatewayURL() override in ToslaPos is
removed and get3DFormData() passes the plain base URL to the mapper.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Delete the 7 no-op prepare*() hook methods from AbstractRequestDataMapper
and clean up all 16 concrete mappers:
- No-op callers removed (prepareStatusOrder, prepareCancelOrder, etc.)
- Single-use methods inlined into their one caller and deleted
- Multi-use methods kept as private helpers renamed to applyPaymentDefaults()
  (and applyStatusDefaults() / applyCancelDefaults() for GarantiPos)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nuryagdym
nuryagdym force-pushed the v2 branch 3 times, most recently from b025d7b to 2118b3f Compare July 6, 2026 14:45
nuryagdym and others added 6 commits July 8, 2026 10:20
BREAKING CHANGE:
The reason is we don't want to overcrowd PosInterface, because we also added QUERY_TYPE_INSTALLMENT_RATES, QUERY_TYPE_INSTALLMENT_PRICES and QUERY_TYPE_BIN_LIST queries.

`history()` and `customQuery()` moved to `PosQueryInterface`

`PosInterface::history()` and `PosInterface::customQuery()` have been **removed**.
Non-order-related queries are now handled by a separate `PosQueryInterface` obtained
from `PosQueryFactory::create()`.

#### Constant renames

| Old constant | New constant |
|---|---|
| `PosInterface::TX_TYPE_HISTORY` | `PosQueryInterface::QUERY_TYPE_HISTORY` |
| `PosInterface::TX_TYPE_CUSTOM_QUERY` | `PosQueryInterface::QUERY_TYPE_CUSTOM_QUERY` |
BREAKING CHANGE
posfactory creates pos gateway classes, create method does not need a descriptive name.

also create() is follows the convention we use in this library.
… config

PosFactory::create() and PosQueryFactory::create() previously received the
entire multi-bank config array and performed an internal lookup via
$posAccount->getBankName(). Since the account already carries the bank name
the lookup was redundant. Callers now extract the slice themselves:
  $config['banks'][$account->getBankName()]

GatewayConfigNotFoundException is removed — it was only ever thrown during
the bank-name lookup that no longer exists.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- old ones were either renamed or removed
@nuryagdym
nuryagdym marked this pull request as ready for review July 9, 2026 12:27
@nuryagdym
nuryagdym merged commit 50ed2bf into master Jul 9, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant