Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: allow multiple payment requests through customer portal #43689

Merged

Conversation

ruthra-kumar
Copy link
Member

@ruthra-kumar ruthra-kumar commented Oct 16, 2024

Issue

Customer is unable to pay for an Invoice through customer portal if he accidentally refreshes or navigates back on the Payment screen

Screenshots

Screenshot from 2024-10-16 13-21-33

Unsaved Image 1

# fetches existing payment request `grand_total` amount
existing_payment_request_amount = get_existing_payment_request_amount(ref_doc.doctype, ref_doc.name)
if existing_payment_request_amount:
grand_total -= existing_payment_request_amount
if not grand_total:
frappe.throw(_("Payment Request is already created"))

Solution

  1. Cancel old Payment Requests; Isolated to Customer Portal.
  2. Set status of Integration Requests of above cancelled PR's as 'Cancelled'
  3. Checkout page will disallow Cancelled tokens refactor: Disallow cancelled 'Integration Requests' on checkout page payments#115

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Oct 16, 2024
@ruthra-kumar
Copy link
Member Author

@vorasmit Would like your thoughts on this.

@vorasmit
Copy link
Collaborator

vorasmit commented Oct 22, 2024

Just saw this:

This issue will mainly arise for webshop or customer portal, integrated with payment gateway.
A setting for this may not be necessary.

Suggestion:

In my opinion,

  • introduce a status to payment request for invalidating the payment link if already generated (say Invalid). This may involve invalidating payment gateway order too, so that customers cannot pay using old links.
  • when this is created from portal, invalidate old requests and create a new one.
  • ensure payment entries cannot be created from invalidated payment requests.

@ruthra-kumar

This comment was marked as outdated.

@ruthra-kumar ruthra-kumar force-pushed the allow_multiple_payment_requests branch from 1b4f74b to 53e18a5 Compare November 4, 2024 12:27
@ruthra-kumar ruthra-kumar changed the title refactor: configurable option to allow multiple payment requests refactor: allow multiple payment requests throw customer portal Nov 4, 2024
@ruthra-kumar ruthra-kumar changed the title refactor: allow multiple payment requests throw customer portal refactor: allow multiple payment requests through customer portal Nov 5, 2024
@ruthra-kumar ruthra-kumar force-pushed the allow_multiple_payment_requests branch 2 times, most recently from 8936350 to c104b0f Compare November 7, 2024 09:07
@ruthra-kumar ruthra-kumar force-pushed the allow_multiple_payment_requests branch from c104b0f to 18c13a2 Compare November 7, 2024 09:25
@ruthra-kumar ruthra-kumar marked this pull request as ready for review November 7, 2024 09:43
@ruthra-kumar ruthra-kumar merged commit a10b38e into frappe:develop Nov 7, 2024
13 checks passed
ruthra-kumar added a commit that referenced this pull request Nov 11, 2024
…-43689

refactor: allow multiple payment requests through customer portal (backport #43689)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport version-15-hotfix needs-tests This PR needs automated unit-tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants