Skip to content

[CC-2379] Fix fatal error when payment type is null in performCharge and performSca#233

Merged
Ryouzanpaku merged 4 commits into
mainfrom
CC-2379/fix-null-payment-type-special-params
Jun 17, 2026
Merged

[CC-2379] Fix fatal error when payment type is null in performCharge and performSca#233
Ryouzanpaku merged 4 commits into
mainfrom
CC-2379/fix-null-payment-type-special-params

Conversation

@Ryouzanpaku

Copy link
Copy Markdown
Contributor

Summary

  • Fixes a fatal TypeError (Call to a member function getTransactionParams() on null) in performCharge and performSca when the payment type resolves to null after $payment->getPaymentType()
  • Replaces the plain method call with PHP 8's nullsafe operator (?->) so a null payment type safely short-circuits to [], while preserving the existing ?? [] fallback for when getTransactionParams() itself returns null
  • Adds unit tests for both methods covering the null payment type case

Closes #207

…rmCharge and performSca.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Ryouzanpaku Ryouzanpaku requested a review from a team as a code owner June 16, 2026 12:25
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Comment thread src/Services/PaymentService.php

@sixer1182 sixer1182 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in general ok.
Please check the comment

Comment thread test/unit/Services/PaymentServiceTest.php Outdated
…er intent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Ryouzanpaku Ryouzanpaku enabled auto-merge (squash) June 17, 2026 08:14
@Ryouzanpaku Ryouzanpaku merged commit 1f32bb3 into main Jun 17, 2026
7 of 8 checks passed
@Ryouzanpaku Ryouzanpaku deleted the CC-2379/fix-null-payment-type-special-params branch June 17, 2026 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants