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

[ECP-9408] Fix handling Giftcard payments responses #2724

Merged
merged 35 commits into from
Sep 11, 2024
Merged

Conversation

SushmitaThakur
Copy link
Contributor

@SushmitaThakur SushmitaThakur commented Aug 26, 2024

Description
This PR fixes partial payment with one or more giftcards + a final non-giftcard PM responses for the shopper to land on the correct page.

  1. This fix also ensures that processGiftcards() now includes all giftcard responses, rather than just the last one. Previously, handleGiftcards() returned only the final giftcard response (whether successful or failed) when handling multiple giftcards. It also includes a unit test for checking the response type for multiple giftcard scenario.

  2. The CheckoutResponse validator and handler classes are modified to handle an array of responses.

  3. New Unit tests added for the following classes -

  • CheckoutResponseValidator
  • CheckoutPaymentCommentHistoryHandler
  • CheckoutPaymentsDetailsHandler
  • CheckoutPaymentCommentHistoryHandler

** Manually Tested scenarios**

  1. Payment with a single gift card with correct details - should succeed
  2. Payment with a single gift card with incorrect details - should fail
  3. Payment with two gift cards, one with correct details, one with incorrect details - should fail
  4. Payment with one gift card with correct details and credit card with correct details - should succeed
  5. Payment with one gift card with incorrect details and credit card with correct details - should fail
  6. Payment with two gift cards, one with correct details, one with incorrect details and one credit card with correct details - should fail

… in case of partial payments, also fix the processGiftcard response to include all the giftcard processings
…date the existing one for when there is no gift cars and the array is empty
Gateway/Http/Client/TransactionPayment.php Outdated Show resolved Hide resolved
Gateway/Http/Client/TransactionPayment.php Outdated Show resolved Hide resolved
Gateway/Http/Client/TransactionPayment.php Show resolved Hide resolved
Gateway/Http/Client/TransactionPayment.php Show resolved Hide resolved
…ests accordingly, remove class type assert for multiple giftcard response test, add the foreach for verifying payments in CheckoutResponseValidator
Copy link

sonarcloud bot commented Sep 10, 2024

@SushmitaThakur SushmitaThakur changed the title [ECP-9408] Fix failing Giftcard payments response not checked before redirecting shopper [ECP-9408] Fix handling Giftcard payments responses Sep 11, 2024
@SushmitaThakur SushmitaThakur merged commit 5511ac0 into main Sep 11, 2024
16 checks passed
@SushmitaThakur SushmitaThakur deleted the ECP-9408 branch September 11, 2024 13:30
@github-actions github-actions bot mentioned this pull request Sep 11, 2024
@RokPopov RokPopov added the Fix Indicates a bug fix label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Indicates a bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants