Skip to content

Add merchant-side Google Pay and event-specific redirect URLs - #2

Closed
hegedustibor wants to merge 5 commits into
chore/laravel-13-package-skeletonfrom
chore/simplepay-google-pay
Closed

hegedustibor wants to merge 5 commits into
chore/laravel-13-package-skeletonfrom
chore/simplepay-google-pay

Conversation

@hegedustibor

Copy link
Copy Markdown
Contributor

Mi változott

  • Google Pay a saját fizetési oldalon. Ez a SimplePay 2026-os újdonsága: a Payment PHP SDK 2.1.5 (2026-06-27) és a Google Pay dokumentáció (2026-09-01) alapján készült.
    • SimplePay::payment()->doGooglePay(GooglePayDoRequest): a Google Pay tokent a /v2/dogooglepay végponton terheli. 3DS challenge-nél (3004) nem dob kivételt, hanem visszaadja a redirectUrl-t (requiresChallenge()).
    • SimplePay::payment()->googlePayConfig(Currency, total): a fizetési oldal Google Pay gombjához szükséges értékeket adja (sandboxban TEST, élesben PRODUCTION környezet).
    • Új config-kulcsok: SIMPLEPAY_GOOGLE_PAY_MERCHANT_ID és SIMPLEPAY_GOOGLE_PAY_MERCHANT_NAME.
    • Magyar és angol útmutató JavaScript-gombbal: examples/en/google-pay.md, examples/hu/google-pay.md.
  • Eseményenkénti visszairányítási címek (urls) a fizetés és az RTP indításakor (RedirectUrls); RTP-nél a pending címmel együtt.
  • Javított RTP-hibák:
    • Az RTP back-hívás PENDING eseménye eddig ValueError-t dobott. Ehhez jött létre a BackEvent::Pending.
    • Az RTP start-válaszban nincs timeout, ezért a PaymentResponse eddig TypeError-t dobott. A timeout mostantól lehet null.
  • Dokumentáció és anyagok:
    • README, példák és Boost skill, benne az orderRef újrahasználatának szabálya (a 2026.09.01-es dokumentáció pontosítása);
    • új SVG-logó a 2026.09.21-es logócsomagból;
    • az official-docs a 2026.09.01-es fejlesztői dokumentációra frissült, és bekerült a Google Pay-leírás (magyarul és angolul).

Ellenőrzés

  • A composer test zöld PHP 8.4-en, Laravel 13.37 alatt: Larastan 0 hiba, Pint, 100%-os típuslefedettség, 89 Pest-teszt.
  • A hivatalos SDK-val összevetve:
    • a SimplePayDoGooglePay végpontja és mezői egyeznek;
    • az RTP SDK 0.9 (2026-08-17) csak egy mintakód-elírást javított;
    • a logócsomagban csak az SVG új.
  • A független review (reviewer agent) komoly hibát nem talált. A jelzett kisebb pontokat javítottam:
    • validálás a példákban;
    • a skill BackUrlResponse-szignatúrája;
    • a hiányos 3004-es válasz kezelése.
  • Nem ellenőriztem:
    • valódi SimplePay sandbox-hívást, Google Pay TEST környezettel sem;
    • a JavaScript-mintát böngészőben;
    • a CI-mátrixot (az első futás mutatja meg).

Megjegyzések a review-hoz

  • A PR a Add Laravel 13 support and build on the laravel package skeleton #1 branchére épül. Annak összeolvasztása után a mainre kell rebase-elni.
  • A fogyasztókat érintő változások a release notes-ba is bekerülnek:
    • a PaymentResponse::$timeout típusa ?string lett;
    • új BackEvent::Pending eset: a default nélküli match ($back->event) kifejezéseket ki kell egészíteni (a PHPStan jelezni fogja).
  • A googlePayConfig() nem ellenőrzi, hogy be van-e állítva a Google Pay merchant ID. Ilyenkor null-t ad, és élesben csak a gomb hibázik a böngészőben.
  • Naplózás: ha a SIMPLEPAY_LOG_CHANNEL be van állítva, a Client a teljes kérést naplózza, így a googlePayToken-t is, és már eddig is az AutoPayment kártyaadatait. Ezt külön javításra javaslom.
  • A README és a Boost skill RTP-példáit, amelyekhez ez a PR hozzányúlt, a valódi API-hoz igazítottam: bekerült a kötelező customer paraméter, és javult az RtpDoRequest példája.

…vent

- Add RedirectUrls for the `urls` field of payment and Request to Pay
  starts; SimplePay ignores the common `url` when it is sent
- Add BackEvent::Pending, which Request to Pay back redirects carry while
  the bank transfer is under way; it used to fail with a ValueError
- Accept Request to Pay start responses, which have no `timeout`
- Share the signed fake response helper between test files
- Add PaymentService::doGooglePay() for the doGooglePay endpoint of the
  official SimplePay PHP SDK 2.1.5 (2026-06-27); a 3DS challenge (3004)
  returns the redirectUrl instead of throwing
- Add PaymentService::googlePayConfig() and the google_pay config keys,
  which give the checkout page the values of the Google Pay button
- Add the Google Pay checkout guide (examples/en|hu/google-pay.md) with
  the backend endpoint and the JavaScript button from the official sample
- Document `urls`, the Request to Pay pending event and the reuse of a
  failed order reference in the README, the examples and the Boost skill
- Add the SVG vertical logo of the SimplePay logo pack 2026-09-21
- Update the bundled developer documentation to 2026-09-01 and add the
  Google Pay documentation (HU and EN)
GooglePayResponse needs transactionId and orderRef; without them the caller keeps the original SimplePayApiException, which still carries the redirectUrl.
…se sample

The Boost skill showed a BackUrlResponse::toResponse() signature that does not match the contract.
@hegedustibor
hegedustibor deleted the branch chore/laravel-13-package-skeleton October 17, 2026 22:19
@hegedustibor
hegedustibor deleted the chore/simplepay-google-pay branch October 17, 2026 22:31
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