[PR #112] [MERGED] Response mapper ve Crypt classlarin olusturulmasi #213

Closed
opened 2026-03-03 15:43:58 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/mewebstudio/pos/pull/112
Author: @nuryagdym
Created: 1/7/2023
Status: Merged
Merged: 1/8/2023
Merged by: @nuryagdym

Base: masterHead: response-mappers


📝 Commits (10+)

  • fd3073c created crypt classes
  • a441346 PosFactory added getGatewayCrypt method
  • c595e22 created response mapper classes
  • 40d4d92 refactored code to use new response mapper and crypt classes
  • 9dd5f09 created tests for response mappers
  • cca3502 examples - added more buttons
  • 8622d56 phpstan - changes
  • 3f988eb updated README.MD with new code examples
  • fe59dcd CHANGELOG.md added v0.11.0 changes
  • 2502a11 added phpstan to github action flow

📊 Changes

86 files changed (+12156 additions, -5884 deletions)

View changed files

📝 .docker/php-xdebug.ini (+1 -1)
📝 .github/workflows/ci-php.yml (+3 -0)
📝 README.md (+20 -19)
📝 docs/CHANGELOG.md (+20 -0)
📝 examples/template/_payment_response.php (+22 -32)
📝 examples/template/_simple_response_dump.php (+9 -0)
📝 examples/ykb/regular/cancel.php (+1 -1)
📝 examples/ykb/regular/post-auth.php (+1 -1)
phpstan-baseline.neon (+2281 -0)
📝 phpstan.neon (+3 -1)
📝 src/Client/HttpClient.php (+11 -1)
src/Crypt/AbstractCrypt.php (+24 -0)
src/Crypt/CryptInterface.php (+42 -0)
src/Crypt/EstPosCrypt.php (+71 -0)
src/Crypt/EstV3PosCrypt.php (+62 -0)
src/Crypt/GarantiPosCrypt.php (+117 -0)
src/Crypt/InterPosCrypt.php (+71 -0)
src/Crypt/KuveytPosCrypt.php (+60 -0)
src/Crypt/PayForPosCrypt.php (+73 -0)
src/Crypt/PosNetCrypt.php (+98 -0)

...and 66 more files

📄 Description

  • Response formatı object yerine artık array olarak değiştirildi, $pos->getResponse(); kod artık array döner.
    • Ödeme response içeriği basitleştirildi, aşağıda listelenen alanlar response'dan kaldırıldı
      • id - bu alanın değeri hep auth_code ile aynıydi, yerine auth_code'u kullanmaya devam edebilirsiniz,
      • host_ref_num - bu alanın değeri hep ref_ret_num ile aynıydı, ref_ret_num'u kullanmaya devam edebilirsiniz,
      • code
      • response
      • xid
      • campaign_url
      • hash
      • hash_data
      • rand
    • amount alanı çoğu gateway responselarında normalize edildi ("1.000,1" => 1000.1), ve artık float deger döner.
  • 3D ödemede hash değeri (check3DHash()) dogurlanamazsa artık Mews\Pos\Exceptions\HashMismatchException exception fırlatır.
  • Bankadan gelen response'ları normalize eden kodlar yeni oluşturulan sınıflara tasındı.
    orn: Mews\Pos\DataMapper\ResponseDataMapper\EstPosResponseDataMapper
  • Hash oluşturma ve dogrulama kodlar yeni olusturulan Crypt sınıflara taşındı. örn: Mews\Pos\Crypt\EstPosCrypt
  • Mews\Pos\Gateways\PosNetCrypt sınıf tamamen kaldırıldı.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/mewebstudio/pos/pull/112 **Author:** [@nuryagdym](https://github.com/nuryagdym) **Created:** 1/7/2023 **Status:** ✅ Merged **Merged:** 1/8/2023 **Merged by:** [@nuryagdym](https://github.com/nuryagdym) **Base:** `master` ← **Head:** `response-mappers` --- ### 📝 Commits (10+) - [`fd3073c`](https://github.com/mewebstudio/pos/commit/fd3073c82ac155ced262467219fff781bb8780e6) created crypt classes - [`a441346`](https://github.com/mewebstudio/pos/commit/a4413463b7afd6a89a3b71482897606e2f3ce0c5) PosFactory added getGatewayCrypt method - [`c595e22`](https://github.com/mewebstudio/pos/commit/c595e22ca9ed2e6726d88c58f4ce88faef241471) created response mapper classes - [`40d4d92`](https://github.com/mewebstudio/pos/commit/40d4d9285f6df3d9c6314807368b330bf4fb0d5e) refactored code to use new response mapper and crypt classes - [`9dd5f09`](https://github.com/mewebstudio/pos/commit/9dd5f09bc8492c9ad7884458c210f433be98fe65) created tests for response mappers - [`cca3502`](https://github.com/mewebstudio/pos/commit/cca3502e27e342f14fc1cce4303dfffc2093abb0) examples - added more buttons - [`8622d56`](https://github.com/mewebstudio/pos/commit/8622d56de76a23cd522d1098e92acf5bd08d89ad) phpstan - changes - [`3f988eb`](https://github.com/mewebstudio/pos/commit/3f988ebb851aa97aa0d7f2fbba5ce90032159962) updated README.MD with new code examples - [`fe59dcd`](https://github.com/mewebstudio/pos/commit/fe59dcde527e9b0994315feb84d637684f874e93) CHANGELOG.md added v0.11.0 changes - [`2502a11`](https://github.com/mewebstudio/pos/commit/2502a11579342cd8212a97568ad12d0e26e9b75d) added phpstan to github action flow ### 📊 Changes **86 files changed** (+12156 additions, -5884 deletions) <details> <summary>View changed files</summary> 📝 `.docker/php-xdebug.ini` (+1 -1) 📝 `.github/workflows/ci-php.yml` (+3 -0) 📝 `README.md` (+20 -19) 📝 `docs/CHANGELOG.md` (+20 -0) 📝 `examples/template/_payment_response.php` (+22 -32) 📝 `examples/template/_simple_response_dump.php` (+9 -0) 📝 `examples/ykb/regular/cancel.php` (+1 -1) 📝 `examples/ykb/regular/post-auth.php` (+1 -1) ➕ `phpstan-baseline.neon` (+2281 -0) 📝 `phpstan.neon` (+3 -1) 📝 `src/Client/HttpClient.php` (+11 -1) ➕ `src/Crypt/AbstractCrypt.php` (+24 -0) ➕ `src/Crypt/CryptInterface.php` (+42 -0) ➕ `src/Crypt/EstPosCrypt.php` (+71 -0) ➕ `src/Crypt/EstV3PosCrypt.php` (+62 -0) ➕ `src/Crypt/GarantiPosCrypt.php` (+117 -0) ➕ `src/Crypt/InterPosCrypt.php` (+71 -0) ➕ `src/Crypt/KuveytPosCrypt.php` (+60 -0) ➕ `src/Crypt/PayForPosCrypt.php` (+73 -0) ➕ `src/Crypt/PosNetCrypt.php` (+98 -0) _...and 66 more files_ </details> ### 📄 Description - Response formatı **object** yerine artık **array** olarak değiştirildi, `$pos->getResponse();` kod artık array döner. - Ödeme response içeriği basitleştirildi, aşağıda listelenen alanlar response'dan **kaldırıldı** - `id` - bu alanın değeri hep `auth_code` ile aynıydi, yerine `auth_code`'u kullanmaya devam edebilirsiniz, - `host_ref_num` - bu alanın değeri hep `ref_ret_num` ile aynıydı, `ref_ret_num`'u kullanmaya devam edebilirsiniz, - `code` - `response` - `xid` - `campaign_url` - `hash` - `hash_data` - `rand` - `amount` alanı çoğu gateway responselarında normalize edildi ("1.000,1" => 1000.1), ve artık **float** deger döner. - 3D ödemede hash değeri (`check3DHash()`) dogurlanamazsa artık `Mews\Pos\Exceptions\HashMismatchException` exception fırlatır. - Bankadan gelen response'ları normalize eden kodlar yeni oluşturulan sınıflara tasındı. orn: `Mews\Pos\DataMapper\ResponseDataMapper\EstPosResponseDataMapper` - Hash oluşturma ve dogrulama kodlar yeni olusturulan Crypt sınıflara taşındı. örn: `Mews\Pos\Crypt\EstPosCrypt` - `Mews\Pos\Gateways\PosNetCrypt` sınıf tamamen kaldırıldı. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 15:43:58 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/pos#213
No description provided.