Repository navigation
feat: add PayU India gateway - #26
Merged
Merged
Conversation
PayU checkout is a browser form POST, so create_session makes no PayU call: order_url is our start_checkout page, which renders the signed form. PayU returns the shopper by a cross-site POST, so surl/furl go through return_from_payu, which drops the sid=Guest cookies and redirects to the stored URL. Status, refunds and refund status use postservice.php commands over raw HTTP. Payment webhooks are checked with the reverse hash; refund webhooks are unsigned, so the refund is read back from PayU. record_external_refund now refuses a refund with no amount instead of recording it as zero.
Backend test coverage: 83%Commit b7ce093. Test modules are excluded. Coverage by file
19 empty files skipped. |
…fuse zero refunds
…s raised outside the app
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.
Summary
Adds PayU India (payu.in) next to Razorpay. Callers keep using
create_payment,refundand webhooks unchanged.PayU Gateway SettingsSingle, plusservices/payu/{base,live,stub}.py(raw HTTP topostservice.php, no SDK).create_sessionmakes no PayU call:order_urlis our gueststart_checkoutpage, which renders the signed, escaped, auto-submitting form.return_from_payuignores the body, drops thesid=Guestcookies Frappe queued, and redirects to the stored success or failure URL. The shopper stays signed in.verify_payment(unmappedstatus). Refunds usecancel_refund_transactionand settle throughcheck_action_status.additionalChargeswhen present). Refund webhooks are unsigned, so the refund is read back from PayU and the body is ignored.record_external_refundrefuses a refund with no amount, instead of recording it as 0.Tests
webhook.handle.pre-commitis clean. The leak check found no PayU profile, settings or Integration Requests after the run.Manual PayU sandbox check (live client is not tested)
create_payment→order_url→ pay with a test card.redirect_toand still be signed in.check_action_statusreply shape and its amount field (amtoramount).request_id.firstnamewith punctuation is accepted.