Skip to content

Add the SimplePay Status API to the payment service - #10

Merged
hegedustibor merged 2 commits into
mainfrom
feat-status-api
Dec 3, 2026
Merged

hegedustibor merged 2 commits into
mainfrom
feat-status-api

Conversation

@hegedustibor

@hegedustibor hegedustibor commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Mi változott

Összevetettem a hivatalos SimplePay SDK-k és a fejlesztői portál legfrissebb kiadásait a csomaggal. Egyetlen új funkció hiányzott, a portálon 2026-07-28-án megjelent Status API. Ezt építettem be.

  • Új hívás: a SimplePay::payment()->status($currency, transactionId: …) vagy orderRef: … a POST /v2/status végpontot hívja. A válasz egy új StatusResponse DTO a következő mezőkkel: status (PaymentStatus), endState, transactionId, orderRef, merchant.
  • Mire jó: egy tranzakciónak csak az aktuális állapotát adja vissza, ezért könnyebb hívás, mint a query(). A portál ismételt lekérdezésre (pollingra) ajánlja; a query() marad arra, amikor összeg, dátum vagy fizetési mód is kell. Az endState true, ha az állapot már nem változik (FINISHED, CANCELLED, NOTAUTHORIZED, TIMEOUT, REVERSED).
  • Validálás: a transactionId és az orderRef közül pontosan az egyiket kell megadni. Ha egyiket sem vagy mindkettőt adják meg, a kérés elküldése előtt InvalidArgumentException keletkezik, mert a portál szerint a SimplePay ezt hibával utasítja el.
  • Dokumentáció: frissült a README, az angol és a magyar példa (query-refund-cancel.md, lekerdezes-es-sztorno.md), a Boost skill, az AGENTS.md és a CHANGELOG Unreleased része. A Google Pay leírásokban a rendelés teljesítésénél a query() mellett a status() is szerepel, ahogy a hivatalos Google Pay doksi is szerveroldali státuszlekérdezést említ.

A változás visszafelé kompatibilis, csak új metódust és DTO-t ad hozzá.

SimplePay published a Status API (/v2/status) on 2026-07-28 that returns only the current status of one transaction. PaymentService::status() calls it with exactly one of the transaction ID and the order reference and maps the answer to a StatusResponse.
Describe status() in the README, the English and Hungarian examples, the Boost skill and the changelog, and name it next to query() where the Google Pay flow says how to fulfil the order.
@hegedustibor
hegedustibor marked this pull request as ready for review December 3, 2026 12:24
@hegedustibor
hegedustibor merged commit 038a105 into main Dec 3, 2026
24 checks passed
@hegedustibor
hegedustibor deleted the feat-status-api branch December 3, 2026 12:36
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