Repository navigation
Send the request fields the official SimplePay SDK sends - #5
Merged
Merged
Conversation
- Add sdkVersion to every request that lacks it, as the SDK's Base class does, and send the currency with card and token queries and cancels - OneClick `do`: send cardSecret, type, threeDSReqAuthMethod, browser and methods; the transactionId parameter is deprecated and no longer sent - `dorecurring`: send the recurring token (it was missing, so the card could not be identified); a request without it throws early - Auto payment: send the browser data as `browser` with the official keys (plus ip), and the url, threeDSReqAuthMethod and language fields - Request to Pay: send language, deadline and additionalInfo on start, packageRef and transactions on batches, id lists on query, refundTotal and originalTotal on refund, and the currency on refund and reverse - Apple Pay: send domain, language and timeout on start and the token as applePayToken; qvik: send eamType, language and timeout - Mask card data, card secrets and tokens in the debug log Existing constructor arguments keep working; new fields are optional.
Update the card storage, recurring, Apple Pay, auto payment, qvik and Request to Pay examples, the Boost skill and AGENTS.md.
- Send the shipping cost as shippingCost, so SimplePay adds it to the amount to pay, and the item description as desc - Default the Request to Pay deadline to 2 hours 5 minutes (or `timeout` seconds), as the official sample does, instead of the 10 minute card payment timeout; stop sending the timeout RTP does not use - Refuse an Apple Pay start when no domain can be resolved instead of leaving the required field out - Expose the recurring tokens of a card registration start on PaymentResponse, so the recurring flow can get its token
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mi változott
A csomag eddig több végponton nem azokat a mezőket küldte, amelyeket a hivatalos SimplePay SDK és dokumentáció vár; ezek egy része valószínűleg nem is működhetett. Mostantól minden kérés a hivatalos minták mezőneveit követi:
start): a szállítási díjshippingCostnéven megy, eddigshippingPricevolt, így a SimplePay nem adta hozzá a fizetendő összeghez. A tétel leírásadescnéven megy, eddigdescriptionvolt.sdkVersionmegy (12 kérésből hiányzott, az AutoPayment pedig más értéket küldött). A kártya és a token lekérdezése és törlésecurrency-t is küld.do):cardSecret,type,threeDSReqAuthMethod,browserésmethods. A nem létezőtransactionIdnem kerül a kérésbe.dorecurring): bekerült atoken, amely eddig hiányzott, így a kártya nem volt azonosítható. Token nélkül a kérés már elküldés előttInvalidArgumentException-t dob. A kártyaregisztrálóstartválaszának tokenjei mostantól a$response->tokens-ben elérhetők, eddig a csomag eldobta őket.browserkulccsal és a hivatalos mezőnevekkel megy,ip-vel kiegészítve. Új mezők:url,threeDSReqAuthMethod,language.language,deadline,additionalInfo. A határidő alapértéke a hivatalos minta szerinti 2 óra 5 perc, megadotttimeoutesetén annyi másodperc; eddig a kártyás fizetés 10 perces timeoutja volt. A RTP-nél nem értelmezetttimeoutmező már nem megy;packageReféstransactions;transactionIds,orderRefsvagypackageRef;refundTotal,originalTotal,currency;currency.domain-t (alapból azapp.urlhostja),language-et éstimeout-ot küld, a do a tokentapplePayTokenkulccsal. Ha a domain nem állapítható meg, a kérés érthetőInvalidArgumentException-t dob, ahelyett hogy a kötelező mező csendben kimaradna.eamType(alapból 1, QR),language,timeout.SIMPLEPAY_LOG_CHANNELmellett a naplóba már nem kerül kártyaszám, lejárat, CVC,cardSecretés token.A változás visszafelé kompatibilis, ezért v2.1.0 lehet. A meglévő paraméterek maradnak; a
do- és a recurring-kéréstransactionId-je elavult,?intlett, és nem kerül a kérésbe. Az új mezők opcionálisak.Ellenőrzés
composer testzöld PHP 8.4-en, Laravel 13 alatt: Larastan 0 hiba, Pint, 100%-os típuslefedettség, 110 teszt.RequestPayloadTestvégpontonként a hivatalos mintákhoz rögzíti a mezőket; a javítás előtt mind elbukott. A változás nélkül ezek elbuknak.shippingCost,desc, az RTP határideje, az Apple Pay domain), ezeket elbukó tesztekkel kezdve javítottam.Megjegyzések a review-hoz
Base::prepare()minden hívásbasdkVersion-t tesz;do.php,dorecurring.php;auto.php;rtpstart.php,rtpdo.php,rtpquery.php,rtprefund.php.deadline-ja 2 óra 5 perc, vagy megadotttimeoutesetén annyi másodperc, mint a hivatalos mintában;deadline-ja 30 nap, mint a hivatalos mintában;packageRef-et a csomag generálja, ha nincs megadva;domainazapp.urlhostja.RecurringRequestés a domain nélküliApplePayStartRequestInvalidArgumentException-t dob. Ez viselkedésváltozás, de ezek a kérések eddig sem működhettek; a release notes-ba is bekerül.currencynélkül megy, a dokumentáció mintája szerint. A hivatalos SDK amerchantAccountalapján visszaírja.originalTotal-ja opcionális maradt, hogy a meglévő hívások ne törjenek; a hivatalos minta mindig küldi, ezért a példák is így mutatják.url-t, a doorderRef-et is küld; ez a korábbi viselkedés, a dokumentáció mintájában nem szerepel.