-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add tests for ApplePayCertificateApi #26
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
Conversation
- Add 14 unit tests covering all API operations - Test create, list, get, activate, update, delete endpoints - Test parameter validation for required fields - Test error handling for 401 and 404 responses - Use mock HTTP client pattern consistent with PaymentsApiTest Previously the test file only had placeholder stubs marked incomplete.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughAdds Apple Pay certificates: new OpenAPI-generated API client and models, PHPUnit tests for API and models, MoneiClient wiring for the new API, numerous OpenAPI doc-version header updates, dev-dependency bumps, and a commitlint rule addition. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
test/Api/ApplePayCertificateApiTest.php (2)
71-73: Remove empty lifecycle methods.The
setUpBeforeClass()andtearDownAfterClass()methods are empty and serve no purpose. Consider removing them to reduce clutter.- /** - * Setup before running any test cases - * - * @return void - */ - public static function setUpBeforeClass(): void - { - } -- /** - * Clean up after running all test cases - * - * @return void - */ - public static function tearDownAfterClass(): void - { - } -Also applies to: 110-112
50-50: Consider adding typed property declarations.While DocBlocks document the types, PHP 7.4+ typed properties provide runtime type safety. This is a minor quality improvement.
- protected $api; + protected ApplePayCertificateApi $api;- protected $mockHandler; + protected MockHandler $mockHandler;- protected $container = []; + protected array $container = [];Also applies to: 57-57, 64-64
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
test/Api/ApplePayCertificateApiTest.php(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.php
📄 CodeRabbit inference engine (CLAUDE.md)
Adhere to PSR-12 code style across the PHP codebase (use cs-check/cs-fix)
Files:
test/Api/ApplePayCertificateApiTest.php
test/**/*.php
📄 CodeRabbit inference engine (CLAUDE.md)
test/**/*.php: Place unit tests in the test/ directory for all API classes and models and run them with PHPUnit
Use mocked HTTP responses in tests to ensure isolated, deterministic testing
Files:
test/Api/ApplePayCertificateApiTest.php
**/*
⚙️ CodeRabbit configuration file
**/*: Generate manual testing checkboxes for the PR. The checkboxes should cover:
- Visual verification that the UI renders correctly
- Functional testing of user interactions
- Edge cases and error states
- Cross-browser/device testing if applicable
- Integration with related features
Files:
test/Api/ApplePayCertificateApiTest.php
🪛 GitHub Actions: PHP Tests & Guzzle Compatibility
test/Api/ApplePayCertificateApiTest.php
[error] 91-91: PHPUnit failed: Class 'Monei\Api\ApplePayCertificateApi' not found. Test at ApplePayCertificateApiTest.php:91. Command: 'composer test'.
🔇 Additional comments (2)
test/Api/ApplePayCertificateApiTest.php (2)
121-531: Comprehensive test coverage and well-structured test suite.The test suite thoroughly covers CRUD operations, parameter validation, and error handling scenarios. The use of Guzzle's MockHandler provides isolated, deterministic testing as required by the coding guidelines. The test methods are well-named, properly documented, and include appropriate assertions for both request formation and response parsing.
279-279: ApplePayCertificateApi does not exist in the codebase. The test file instantiatesnew ApplePayCertificateApi()(line 91), but this class is not present inlib/Api/. The test cannot run as written. Either implement the missingApplePayCertificateApiclass or remove this test file if it is premature.Likely an incorrect or invalid review comment.
…anager to [email protected] - Updated the OpenAPI document version across multiple model and API files. - Added ApplePayCertificateApi to the MoneiClient. - Upgraded package manager from [email protected] to [email protected]. - Updated yarn.lock to reflect new dependencies.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
- Add ApplePayCertificateApi for iOS app certificate management - Add ApplePayCertificate, ActivateApplePayCertificateRequest, UpdateApplePayCertificateRequest models - Add 14 unit tests covering all API operations - Test create, list, get, activate, update, delete endpoints - Test parameter validation for required fields - Test error handling for 401 and 404 responses
….com/MONEI/monei-php-sdk into feat/apple-pay-certificate-api-tests
…r Apple Pay certificate management
9143423 to
143108d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (107)
.openapi-generator/FILES(3 hunks)lib/Api/ApplePayCertificateApi.php(1 hunks)lib/Api/ApplePayDomainApi.php(1 hunks)lib/Api/BizumApi.php(1 hunks)lib/Api/PaymentMethodsApi.php(1 hunks)lib/Api/PaymentsApi.php(1 hunks)lib/Api/SubscriptionsApi.php(1 hunks)lib/ApiException.php(1 hunks)lib/Configuration.php(2 hunks)lib/FormDataProcessor.php(1 hunks)lib/HeaderSelector.php(1 hunks)lib/Model/ActivateApplePayCertificateRequest.php(1 hunks)lib/Model/ActivateSubscriptionRequest.php(1 hunks)lib/Model/Address.php(1 hunks)lib/Model/ApiException.php(1 hunks)lib/Model/ApplePayCertificate.php(1 hunks)lib/Model/BadRequestError.php(1 hunks)lib/Model/CancelPaymentRequest.php(1 hunks)lib/Model/CancelSubscriptionRequest.php(1 hunks)lib/Model/CapturePaymentRequest.php(1 hunks)lib/Model/ConfirmPaymentRequest.php(1 hunks)lib/Model/ConfirmPaymentRequestPaymentMethod.php(1 hunks)lib/Model/ConfirmPaymentRequestPaymentMethodCard.php(1 hunks)lib/Model/CreatePaymentRequest.php(1 hunks)lib/Model/CreateSubscriptionRequest.php(1 hunks)lib/Model/InlineObject.php(1 hunks)lib/Model/InlineObject1.php(1 hunks)lib/Model/InternalServerError.php(1 hunks)lib/Model/ModelInterface.php(1 hunks)lib/Model/NotFoundError.php(1 hunks)lib/Model/PauseSubscriptionRequest.php(1 hunks)lib/Model/Payment.php(1 hunks)lib/Model/PaymentBillingDetails.php(1 hunks)lib/Model/PaymentCancellationReason.php(1 hunks)lib/Model/PaymentCustomer.php(1 hunks)lib/Model/PaymentLastRefundReason.php(1 hunks)lib/Model/PaymentMessageChannel.php(1 hunks)lib/Model/PaymentMessageLanguage.php(1 hunks)lib/Model/PaymentMethods.php(1 hunks)lib/Model/PaymentMethodsMetadata.php(1 hunks)lib/Model/PaymentMethodsMetadataAlipay.php(1 hunks)lib/Model/PaymentMethodsMetadataApplePay.php(1 hunks)lib/Model/PaymentMethodsMetadataBancontact.php(1 hunks)lib/Model/PaymentMethodsMetadataBizum.php(1 hunks)lib/Model/PaymentMethodsMetadataBlik.php(1 hunks)lib/Model/PaymentMethodsMetadataCard.php(1 hunks)lib/Model/PaymentMethodsMetadataClickToPay.php(1 hunks)lib/Model/PaymentMethodsMetadataClickToPayDiscover.php(1 hunks)lib/Model/PaymentMethodsMetadataClickToPayMastercard.php(1 hunks)lib/Model/PaymentMethodsMetadataClickToPayVisa.php(1 hunks)lib/Model/PaymentMethodsMetadataEps.php(1 hunks)lib/Model/PaymentMethodsMetadataGiropay.php(1 hunks)lib/Model/PaymentMethodsMetadataGooglePay.php(1 hunks)lib/Model/PaymentMethodsMetadataIDeal.php(1 hunks)lib/Model/PaymentMethodsMetadataKlarna.php(1 hunks)lib/Model/PaymentMethodsMetadataMbway.php(1 hunks)lib/Model/PaymentMethodsMetadataSepa.php(1 hunks)lib/Model/PaymentMethodsMetadataSofort.php(1 hunks)lib/Model/PaymentMethodsMetadataTrustly.php(1 hunks)lib/Model/PaymentNextAction.php(1 hunks)lib/Model/PaymentPaymentMethod.php(1 hunks)lib/Model/PaymentPaymentMethodBizum.php(1 hunks)lib/Model/PaymentPaymentMethodBizumInput.php(1 hunks)lib/Model/PaymentPaymentMethodCard.php(1 hunks)lib/Model/PaymentPaymentMethodCardInput.php(1 hunks)lib/Model/PaymentPaymentMethodInput.php(1 hunks)lib/Model/PaymentPaymentMethodKlarna.php(1 hunks)lib/Model/PaymentPaymentMethodMbway.php(1 hunks)lib/Model/PaymentPaymentMethodPaypal.php(1 hunks)lib/Model/PaymentPaymentMethodSepa.php(1 hunks)lib/Model/PaymentPaymentMethodTrustly.php(1 hunks)lib/Model/PaymentRefundReason.php(1 hunks)lib/Model/PaymentSequence.php(1 hunks)lib/Model/PaymentSequenceRecurring.php(1 hunks)lib/Model/PaymentSessionDetails.php(1 hunks)lib/Model/PaymentShippingDetails.php(1 hunks)lib/Model/PaymentShop.php(1 hunks)lib/Model/PaymentStatus.php(1 hunks)lib/Model/PaymentTraceDetails.php(1 hunks)lib/Model/PaymentTransactionType.php(1 hunks)lib/Model/RecurringPaymentRequest.php(1 hunks)lib/Model/RefundPaymentRequest.php(1 hunks)lib/Model/RegisterApplePayDomainRequest.php(1 hunks)lib/Model/SendPaymentLinkRequest.php(1 hunks)lib/Model/SendPaymentReceiptRequest.php(1 hunks)lib/Model/SendPaymentRequestRequest.php(1 hunks)lib/Model/SendSubscriptionLinkRequest.php(1 hunks)lib/Model/SendSubscriptionStatusRequest.php(1 hunks)lib/Model/ServiceUnavailableError.php(1 hunks)lib/Model/Subscription.php(1 hunks)lib/Model/SubscriptionInterval.php(1 hunks)lib/Model/SubscriptionLastPayment.php(1 hunks)lib/Model/SubscriptionPaymentMethod.php(1 hunks)lib/Model/SubscriptionPaymentMethodCard.php(1 hunks)lib/Model/SubscriptionRetryScheduleInner.php(1 hunks)lib/Model/SubscriptionStatus.php(1 hunks)lib/Model/UnauthorizedError.php(1 hunks)lib/Model/UnprocessableEntityError.php(1 hunks)lib/Model/UpdateApplePayCertificateRequest.php(1 hunks)lib/Model/UpdateSubscriptionRequest.php(1 hunks)lib/Model/ValidateBizumPhoneRequest.php(1 hunks)lib/MoneiClient.php(3 hunks)lib/ObjectSerializer.php(1 hunks)package.json(1 hunks)test/Model/ActivateApplePayCertificateRequestTest.php(1 hunks)test/Model/ApplePayCertificateTest.php(1 hunks)test/Model/UpdateApplePayCertificateRequestTest.php(1 hunks)
✅ Files skipped from review due to trivial changes (68)
- lib/Model/PaymentMethodsMetadataBizum.php
- lib/Model/PaymentMethodsMetadataMbway.php
- lib/Model/PaymentCustomer.php
- lib/Model/PaymentPaymentMethodSepa.php
- lib/Model/PaymentMethodsMetadataTrustly.php
- lib/Api/PaymentsApi.php
- lib/Model/SendSubscriptionStatusRequest.php
- lib/Model/PaymentMethodsMetadataGiropay.php
- lib/Model/CancelPaymentRequest.php
- lib/Model/CancelSubscriptionRequest.php
- lib/Model/PaymentPaymentMethodBizum.php
- lib/Model/SendPaymentRequestRequest.php
- lib/Model/PaymentMethodsMetadataSepa.php
- lib/Model/SubscriptionStatus.php
- lib/Model/PaymentMethodsMetadataClickToPay.php
- lib/Model/UnauthorizedError.php
- lib/Api/SubscriptionsApi.php
- lib/Model/PaymentMethodsMetadataClickToPayMastercard.php
- lib/Model/PaymentMethodsMetadataSofort.php
- lib/Model/InlineObject1.php
- lib/Model/CreateSubscriptionRequest.php
- lib/Model/ModelInterface.php
- lib/Model/SubscriptionInterval.php
- lib/Model/PaymentPaymentMethodPaypal.php
- lib/Model/PaymentPaymentMethod.php
- lib/Model/PaymentPaymentMethodKlarna.php
- lib/Model/CapturePaymentRequest.php
- lib/Model/UnprocessableEntityError.php
- lib/Model/PauseSubscriptionRequest.php
- lib/Model/ApiException.php
- lib/Model/InlineObject.php
- lib/Model/PaymentMethodsMetadataEps.php
- lib/Model/PaymentShop.php
- lib/Model/Payment.php
- lib/Model/PaymentMethodsMetadataCard.php
- lib/Model/SubscriptionPaymentMethod.php
- lib/Model/BadRequestError.php
- lib/Model/PaymentPaymentMethodBizumInput.php
- lib/Model/PaymentTransactionType.php
- lib/Configuration.php
- lib/ObjectSerializer.php
- lib/Model/RefundPaymentRequest.php
- lib/Model/UpdateSubscriptionRequest.php
- lib/Model/PaymentBillingDetails.php
- lib/Model/Address.php
- lib/Model/PaymentMethodsMetadata.php
- lib/Model/PaymentMethodsMetadataClickToPayDiscover.php
- lib/Model/PaymentPaymentMethodCardInput.php
- lib/Model/PaymentLastRefundReason.php
- lib/Model/RecurringPaymentRequest.php
- lib/Model/PaymentPaymentMethodCard.php
- lib/ApiException.php
- lib/Model/PaymentMethods.php
- lib/HeaderSelector.php
- lib/Model/SubscriptionRetryScheduleInner.php
- lib/Model/PaymentSequenceRecurring.php
- lib/Model/PaymentNextAction.php
- lib/Model/PaymentMessageChannel.php
- lib/Model/ServiceUnavailableError.php
- lib/Model/InternalServerError.php
- lib/Model/ConfirmPaymentRequestPaymentMethod.php
- lib/Model/CreatePaymentRequest.php
- lib/Model/PaymentSessionDetails.php
- lib/Model/RegisterApplePayDomainRequest.php
- lib/Model/ConfirmPaymentRequest.php
- lib/Api/PaymentMethodsApi.php
- lib/Model/SubscriptionLastPayment.php
- lib/Model/PaymentCancellationReason.php
🧰 Additional context used
📓 Path-based instructions (5)
lib/{Api,Model}/**/*.php
📄 CodeRabbit inference engine (CLAUDE.md)
Do not edit auto-generated code under lib/Api and lib/Model; it is regenerated from the OpenAPI spec
Files:
lib/Model/PaymentMethodsMetadataClickToPayVisa.phplib/Model/PaymentTraceDetails.phplib/Model/SubscriptionPaymentMethodCard.phplib/Model/PaymentMethodsMetadataGooglePay.phplib/Api/BizumApi.phplib/Model/PaymentRefundReason.phplib/Model/SendPaymentReceiptRequest.phplib/Model/PaymentPaymentMethodInput.phplib/Model/PaymentMethodsMetadataIDeal.phplib/Model/PaymentMethodsMetadataApplePay.phplib/Model/NotFoundError.phplib/Model/SendSubscriptionLinkRequest.phplib/Model/PaymentMethodsMetadataKlarna.phplib/Model/Subscription.phplib/Model/SendPaymentLinkRequest.phplib/Model/PaymentMethodsMetadataBlik.phplib/Model/PaymentPaymentMethodTrustly.phplib/Model/PaymentMessageLanguage.phplib/Model/ValidateBizumPhoneRequest.phplib/Model/PaymentMethodsMetadataBancontact.phplib/Api/ApplePayDomainApi.phplib/Model/PaymentStatus.phplib/Model/PaymentMethodsMetadataAlipay.phplib/Model/ConfirmPaymentRequestPaymentMethodCard.phplib/Model/PaymentPaymentMethodMbway.phplib/Model/PaymentShippingDetails.phplib/Model/ActivateApplePayCertificateRequest.phplib/Model/ActivateSubscriptionRequest.phplib/Model/UpdateApplePayCertificateRequest.phplib/Model/PaymentSequence.phplib/Model/ApplePayCertificate.phplib/Api/ApplePayCertificateApi.php
**/*.php
📄 CodeRabbit inference engine (CLAUDE.md)
Adhere to PSR-12 code style across the PHP codebase (use cs-check/cs-fix)
Files:
lib/Model/PaymentMethodsMetadataClickToPayVisa.phplib/Model/PaymentTraceDetails.phplib/Model/SubscriptionPaymentMethodCard.phplib/Model/PaymentMethodsMetadataGooglePay.phplib/Api/BizumApi.phplib/Model/PaymentRefundReason.phplib/Model/SendPaymentReceiptRequest.phplib/MoneiClient.phplib/Model/PaymentPaymentMethodInput.phplib/Model/PaymentMethodsMetadataIDeal.phplib/Model/PaymentMethodsMetadataApplePay.phplib/Model/NotFoundError.phplib/Model/SendSubscriptionLinkRequest.phplib/Model/PaymentMethodsMetadataKlarna.phplib/Model/Subscription.phplib/Model/SendPaymentLinkRequest.phptest/Model/UpdateApplePayCertificateRequestTest.phplib/Model/PaymentMethodsMetadataBlik.phplib/Model/PaymentPaymentMethodTrustly.phplib/Model/PaymentMessageLanguage.phplib/Model/ValidateBizumPhoneRequest.phplib/Model/PaymentMethodsMetadataBancontact.phplib/FormDataProcessor.phplib/Api/ApplePayDomainApi.phplib/Model/PaymentStatus.phptest/Model/ActivateApplePayCertificateRequestTest.phplib/Model/PaymentMethodsMetadataAlipay.phplib/Model/ConfirmPaymentRequestPaymentMethodCard.phplib/Model/PaymentPaymentMethodMbway.phplib/Model/PaymentShippingDetails.phplib/Model/ActivateApplePayCertificateRequest.phplib/Model/ActivateSubscriptionRequest.phplib/Model/UpdateApplePayCertificateRequest.phplib/Model/PaymentSequence.phptest/Model/ApplePayCertificateTest.phplib/Model/ApplePayCertificate.phplib/Api/ApplePayCertificateApi.php
**/*
⚙️ CodeRabbit configuration file
**/*: Generate manual testing checkboxes for the PR. The checkboxes should cover:
- Visual verification that the UI renders correctly
- Functional testing of user interactions
- Edge cases and error states
- Cross-browser/device testing if applicable
- Integration with related features
Files:
lib/Model/PaymentMethodsMetadataClickToPayVisa.phplib/Model/PaymentTraceDetails.phplib/Model/SubscriptionPaymentMethodCard.phplib/Model/PaymentMethodsMetadataGooglePay.phplib/Api/BizumApi.phplib/Model/PaymentRefundReason.phplib/Model/SendPaymentReceiptRequest.phplib/MoneiClient.phplib/Model/PaymentPaymentMethodInput.phplib/Model/PaymentMethodsMetadataIDeal.phplib/Model/PaymentMethodsMetadataApplePay.phplib/Model/NotFoundError.phplib/Model/SendSubscriptionLinkRequest.phplib/Model/PaymentMethodsMetadataKlarna.phplib/Model/Subscription.phplib/Model/SendPaymentLinkRequest.phptest/Model/UpdateApplePayCertificateRequestTest.phplib/Model/PaymentMethodsMetadataBlik.phplib/Model/PaymentPaymentMethodTrustly.phplib/Model/PaymentMessageLanguage.phplib/Model/ValidateBizumPhoneRequest.phplib/Model/PaymentMethodsMetadataBancontact.phplib/FormDataProcessor.phplib/Api/ApplePayDomainApi.phplib/Model/PaymentStatus.phppackage.jsontest/Model/ActivateApplePayCertificateRequestTest.phplib/Model/PaymentMethodsMetadataAlipay.phplib/Model/ConfirmPaymentRequestPaymentMethodCard.phplib/Model/PaymentPaymentMethodMbway.phplib/Model/PaymentShippingDetails.phplib/Model/ActivateApplePayCertificateRequest.phplib/Model/ActivateSubscriptionRequest.phplib/Model/UpdateApplePayCertificateRequest.phplib/Model/PaymentSequence.phptest/Model/ApplePayCertificateTest.phplib/Model/ApplePayCertificate.phplib/Api/ApplePayCertificateApi.php
lib/MoneiClient.php
📄 CodeRabbit inference engine (CLAUDE.md)
lib/MoneiClient.php: Implement all custom SDK logic in MoneiClient.php (constructor, helpers, webhook verification, partner Account ID, custom User-Agent) rather than editing generated files
Ensure API-related errors surfaced by custom code throw ApiException with detailed response info
Files:
lib/MoneiClient.php
test/**/*.php
📄 CodeRabbit inference engine (CLAUDE.md)
test/**/*.php: Place unit tests in the test/ directory for all API classes and models and run them with PHPUnit
Use mocked HTTP responses in tests to ensure isolated, deterministic testing
Files:
test/Model/UpdateApplePayCertificateRequestTest.phptest/Model/ActivateApplePayCertificateRequestTest.phptest/Model/ApplePayCertificateTest.php
🧬 Code graph analysis (6)
test/Model/UpdateApplePayCertificateRequestTest.php (2)
test/Model/ActivateApplePayCertificateRequestTest.php (4)
setUpBeforeClass(48-50)setUp(55-57)tearDown(62-64)tearDownAfterClass(69-71)test/Model/ApplePayCertificateTest.php (5)
setUpBeforeClass(48-50)setUp(55-57)tearDown(62-64)tearDownAfterClass(69-71)testPropertyActive(121-125)
test/Model/ActivateApplePayCertificateRequestTest.php (2)
test/Model/ApplePayCertificateTest.php (5)
setUpBeforeClass(48-50)setUp(55-57)tearDown(62-64)tearDownAfterClass(69-71)testPropertyCert(112-116)test/Model/UpdateApplePayCertificateRequestTest.php (4)
setUpBeforeClass(48-50)setUp(55-57)tearDown(62-64)tearDownAfterClass(69-71)
lib/Model/ActivateApplePayCertificateRequest.php (2)
lib/ObjectSerializer.php (2)
ObjectSerializer(41-531)sanitizeForSerialization(63-108)lib/Model/ConfirmPaymentRequest.php (5)
openAPITypes(82-85)openAPIFormats(91-94)getters(185-188)listInvalidProperties(242-249)valid(256-259)
test/Model/ApplePayCertificateTest.php (2)
test/Model/ActivateApplePayCertificateRequestTest.php (5)
setUpBeforeClass(48-50)setUp(55-57)tearDown(62-64)tearDownAfterClass(69-71)testPropertyCert(85-89)test/Model/UpdateApplePayCertificateRequestTest.php (5)
setUpBeforeClass(48-50)setUp(55-57)tearDown(62-64)tearDownAfterClass(69-71)testPropertyActive(85-89)
lib/Model/ApplePayCertificate.php (5)
lib/ObjectSerializer.php (2)
ObjectSerializer(41-531)sanitizeForSerialization(63-108)lib/Model/ConfirmPaymentRequest.php (11)
openAPITypes(82-85)openAPIFormats(91-94)openAPINullables(100-103)getOpenAPINullablesSetToNull(109-112)setOpenAPINullablesSetToNull(118-121)isNullable(128-131)isNullableSetToNull(138-141)attributeMap(167-170)getters(185-188)valid(256-259)__toString(519-522)lib/Model/InlineObject.php (11)
openAPITypes(82-85)openAPIFormats(91-94)openAPINullables(100-103)getOpenAPINullablesSetToNull(109-112)setOpenAPINullablesSetToNull(118-121)isNullable(128-131)isNullableSetToNull(138-141)attributeMap(167-170)getters(185-188)valid(246-249)__toString(341-344)lib/Model/Subscription.php (2)
getId(308-311)setId(319-326)lib/Internal/guzzlehttp/psr7/src/Uri.php (1)
jsonSerialize(418-421)
lib/Api/ApplePayCertificateApi.php (9)
lib/Internal/guzzlehttp/guzzle/src/Exception/RequestException.php (1)
RequestException(14-112)lib/Internal/guzzlehttp/psr7/src/MultipartStream.php (1)
MultipartStream(13-132)lib/Internal/guzzlehttp/psr7/src/Request.php (1)
Request(15-126)lib/Internal/guzzlehttp/guzzle/src/RequestOptions.php (1)
RequestOptions(10-244)lib/ApiException.php (1)
ApiException(39-111)lib/Configuration.php (2)
Configuration(38-474)getApiKeyWithPrefix(404-417)lib/FormDataProcessor.php (1)
FormDataProcessor(44-194)lib/HeaderSelector.php (2)
HeaderSelector(37-228)selectHeaders(45-59)lib/ObjectSerializer.php (3)
ObjectSerializer(41-531)deserialize(352-471)sanitizeForSerialization(63-108)
🪛 PHPMD (2.15.0)
lib/Model/ActivateApplePayCertificateRequest.php
118-121: Avoid unused private methods such as 'setOpenAPINullablesSetToNull'. (undefined)
(UnusedPrivateMethod)
lib/Model/UpdateApplePayCertificateRequest.php
118-121: Avoid unused private methods such as 'setOpenAPINullablesSetToNull'. (undefined)
(UnusedPrivateMethod)
lib/Model/ApplePayCertificate.php
119-122: Avoid unused private methods such as 'setOpenAPINullablesSetToNull'. (undefined)
(UnusedPrivateMethod)
lib/Api/ApplePayCertificateApi.php
1326-1331: Avoid unused private methods such as 'responseWithinRangeCode'. (undefined)
(UnusedPrivateMethod)
🔇 Additional comments (36)
lib/Model/PaymentMethodsMetadataKlarna.php (1)
18-18: LGTM! Auto-generated version update.The OpenAPI document version has been updated from 1.7.3 to 1.8.0. This is an auto-generated change resulting from the OpenAPI specification update that introduces Apple Pay certificate API support.
lib/FormDataProcessor.php (1)
17-20: LGTM: metadata-only OpenAPI version bumpThe change here is limited to the OpenAPI document version in the header; no functional or behavioral code was modified. This is fine and consistent with the regenerated client.
lib/Model/PaymentPaymentMethodInput.php (1)
18-21: LGTM: header OpenAPI version updated to 1.8.0Only the OpenAPI document version metadata changed; the model definition and behavior remain untouched, which is appropriate for auto-generated code under
lib/Model.As per coding guidelines, lib/Model classes should not be manually edited beyond regeneration from the OpenAPI spec.
lib/Model/ConfirmPaymentRequestPaymentMethodCard.php (1)
18-21: LGTM: OpenAPI header version bump onlyThe diff is restricted to the docblock’s OpenAPI document version; all properties, accessors, and nullability behavior are unchanged.
lib/Model/PaymentTraceDetails.php (1)
18-21: LGTM: metadata-only updateOnly the documented OpenAPI version was updated; the tracing fields and accessors remain identical, so there is no behavioral impact.
lib/Model/PaymentStatus.php (1)
18-21: LGTM: enum remains unchangedOnly the header’s OpenAPI document version changed; the
PaymentStatusenum values and helper method are intact.lib/Model/PaymentMethodsMetadataBancontact.php (1)
18-21: LGTM: docblock version alignmentThe only modification is the OpenAPI document version in the header; the Bancontact metadata model itself is untouched.
lib/Model/PaymentMessageLanguage.php (1)
18-21: LGTM: header-only changeThe OpenAPI document version was bumped, with no changes to the
PaymentMessageLanguageenum values or API surface.lib/Model/PaymentMethodsMetadataApplePay.php (1)
18-21: LGTM: OpenAPI doc version bumpedOnly the header’s OpenAPI version string was updated; the Apple Pay metadata model (
merchant_id) and its serialization behavior are unchanged.lib/Model/PaymentMethodsMetadataIDeal.php (1)
14-21: OpenAPI document version bump is consistent and non-breakingHeader now points to spec version 1.8.0; no behavioral or structural changes in this auto-generated model.
lib/Model/PaymentMethodsMetadataClickToPayVisa.php (1)
14-21: Header metadata updated to OpenAPI 1.8.0Version bump in the docblock matches the generator output; model behavior remains unchanged.
lib/Model/PaymentRefundReason.php (1)
14-21: Enum model keeps same semantics with updated spec versionOnly the OpenAPI document version in the header moved to 1.8.0; refund reason enum is unchanged.
lib/Model/SendSubscriptionLinkRequest.php (1)
14-21: SendSubscriptionLinkRequest metadata aligned with OpenAPI 1.8.0Docblock version bump only; request schema and validation logic are untouched.
lib/Model/PaymentPaymentMethodTrustly.php (1)
14-21: Trustly payment method model: metadata-only updateOpenAPI document version updated to 1.8.0 with no runtime or serialization changes.
lib/Model/ValidateBizumPhoneRequest.php (1)
14-21: ValidateBizumPhoneRequest header now reflects OpenAPI 1.8.0Only the spec version in the docblock changed; request validation and structure are unaffected.
lib/Api/ApplePayDomainApi.php (1)
13-20: ApplePayDomainApi header version bump onlyDocblock now targets OpenAPI 1.8.0; request/response handling and error mapping logic remain the same.
lib/Model/Subscription.php (1)
14-21: Subscription model metadata updated to OpenAPI 1.8.0The change is limited to the header version reference; the Subscription schema and behavior are unchanged.
lib/Model/ActivateSubscriptionRequest.php (1)
18-18: Auto-generated code regeneration — LGTM.This OpenAPI version bump to 1.8.0 is expected as part of the SDK regeneration from the updated OpenAPI specification. As per coding guidelines, this file should not be manually edited.
lib/Model/NotFoundError.php (1)
18-18: Auto-generated code regeneration — LGTM.OpenAPI version bump to 1.8.0 from SDK regeneration. No functional changes.
lib/Model/PaymentMethodsMetadataBlik.php (1)
18-18: Auto-generated code regeneration — LGTM.OpenAPI version bump to 1.8.0 from SDK regeneration. No functional changes.
lib/Model/PaymentMethodsMetadataAlipay.php (1)
18-18: Auto-generated code regeneration — LGTM.OpenAPI version bump to 1.8.0 from SDK regeneration. No functional changes.
lib/Model/SendPaymentReceiptRequest.php (1)
18-18: Auto-generated code regeneration — LGTM.OpenAPI version bump to 1.8.0 from SDK regeneration. No functional changes.
package.json (1)
19-27: Dev dependency updates — verify commitlint v20 compatibility.These are routine dev dependency updates. The major version bump for
@commitlint/cliand@commitlint/config-conventional(19.x → 20.x) includes breaking changes: ESM migration, rule behavior changes (e.g.,body-max-line-lengthnow ignores URL lines), and config/loader refactoring. Before merging, verify that:
- Your commitlint configuration file format is compatible (ESM vs CommonJS alignment)
- Node version in CI/dev environments meets requirements (Node 20+)
- Any commitlint rule configurations work with updated behavior
- Plugins or extended configs are updated to v20-compatible versions
- CI passes with the new versions
lib/Model/PaymentPaymentMethodMbway.php (1)
18-18: Auto-generated file acknowledged — version header update only.This file is auto-generated from the OpenAPI spec. The version bump from 1.7.3 to 1.8.0 is consistent with the API specification update. No manual edits should be made to this file.
lib/Model/PaymentShippingDetails.php (1)
18-18: Auto-generated file acknowledged — version header update only.This file is auto-generated from the OpenAPI spec. The version bump from 1.7.3 to 1.8.0 is consistent with the API specification update.
lib/Model/PaymentMethodsMetadataGooglePay.php (1)
18-18: Auto-generated file acknowledged — version header update only.This file is auto-generated from the OpenAPI spec. The version bump from 1.7.3 to 1.8.0 is consistent with the API specification update.
lib/Model/SendPaymentLinkRequest.php (1)
18-18: Auto-generated file acknowledged — version header update only.This file is auto-generated from the OpenAPI spec. The version bump from 1.7.3 to 1.8.0 is consistent with the API specification update.
lib/Api/BizumApi.php (1)
17-17: Auto-generated file acknowledged — version header update only.This file is auto-generated from the OpenAPI spec. The version bump from 1.7.3 to 1.8.0 is consistent with the API specification update.
lib/MoneiClient.php (3)
16-16: LGTM!The import is correctly added and follows alphabetical ordering with other API imports.
55-56: LGTM!The property declaration follows the established pattern for other API clients in MoneiClient, with proper type documentation.
91-91: LGTM!The ApplePayCertificateApi initialization follows the established pattern and is correctly positioned with related Apple Pay APIs.
lib/Model/ActivateApplePayCertificateRequest.php (1)
118-121: Static analysis warning is a false positive in auto-generated code.The PHPMD warning about the unused private method
setOpenAPINullablesSetToNullcan be safely ignored. This method is part of the OpenAPI generator's standard model template and may be used via reflection or by the serialization infrastructure. As per coding guidelines, auto-generated code under lib/Model should not be manually edited.test/Model/UpdateApplePayCertificateRequestTest.php (1)
19-19: Remove this comment — the OpenAPI version is consistent.The test file
test/Model/UpdateApplePayCertificateRequestTest.phpreferences OpenAPI version 1.8.0 (not 1.7.4), and all the mentioned model files (lib/Model/PaymentSequence.php,lib/Model/SubscriptionPaymentMethodCard.php,lib/Model/ActivateApplePayCertificateRequest.php) also reference version 1.8.0. There is no version mismatch.Likely an incorrect or invalid review comment.
lib/Model/UpdateApplePayCertificateRequest.php (1)
1-357: Auto-generated model — no changes required.This file is auto-generated by OpenAPI Generator as indicated in the header comments. The structure follows established patterns used by other models in the codebase (e.g.,
InlineObject,ConfirmPaymentRequest).The static analysis warning about the unused
setOpenAPINullablesSetToNullmethod (lines 118-121) is expected — this is standard generator boilerplate for nullable property tracking that may be used in certain edge cases or future scenarios.As per coding guidelines, do not edit auto-generated code under
lib/Model; any fixes should be applied to the OpenAPI spec.lib/Model/ApplePayCertificate.php (1)
1-517: Auto-generated model — no changes required.This file is auto-generated by OpenAPI Generator. The model correctly defines the
ApplePayCertificateentity with appropriate properties for certificate management (id, account_id, csr, cert, active, expire_at, created_at).The static analysis warning about the unused
setOpenAPINullablesSetToNullmethod (lines 119-122) is expected generator boilerplate.The pattern where getters return nullable types (e.g.,
getCsr(): string|null) while setters throw on null is standard OpenAPI generator behavior — it distinguishes between "property not present in response" vs. "explicitly setting null."As per coding guidelines, do not edit auto-generated code under
lib/Model.lib/Api/ApplePayCertificateApi.php (1)
1-1332: Auto-generated API client — no changes required.This file is auto-generated by OpenAPI Generator and provides a complete API client for Apple Pay certificate management with proper:
- CRUD operations (create, get, callList, update, delete) plus activate
- Synchronous and asynchronous variants with HTTP info
- Error handling for standard HTTP status codes (400, 401, 404, 422, 500, 503)
- API key authentication via the Authorization header
- Request building with proper path parameter substitution and JSON serialization
The static analysis warning about the unused
responseWithinRangeCodemethod (lines 1326-1331) is expected — this is generator boilerplate for range-based status code handling that may be used by other generated APIs or future operations.As per coding guidelines, do not edit auto-generated code under
lib/Api; any fixes should be applied to the OpenAPI spec or generator templates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
test/Api/ApplePayCertificateApiTest.php (1)
279-279: Consider using model classes instead of stdClass for request objects.The tests use stdClass (
(object)['key' => 'value']) for request bodies, but actual model classes exist (ActivateApplePayCertificateRequest,UpdateApplePayCertificateRequest). Using the model classes would better test the full integration including model validation and serialization.Example for activate:
-$activateRequest = (object)['cert' => 'base64_signed_cert_from_apple']; +$activateRequest = new \Monei\Model\ActivateApplePayCertificateRequest(); +$activateRequest->setCert('base64_signed_cert_from_apple');Example for update:
-$updateRequest = (object)['active' => false]; +$updateRequest = new \Monei\Model\UpdateApplePayCertificateRequest(); +$updateRequest->setActive(false);Also applies to lines 427, 439, 454, 466 in validation tests.
Also applies to: 326-326
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
commitlint.config.js(1 hunks)test/Api/ApplePayCertificateApiTest.php(1 hunks)test/Model/ActivateApplePayCertificateRequestTest.php(1 hunks)test/Model/ApplePayCertificateTest.php(1 hunks)test/Model/UpdateApplePayCertificateRequestTest.php(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- test/Model/ApplePayCertificateTest.php
- test/Model/UpdateApplePayCertificateRequestTest.php
- test/Model/ActivateApplePayCertificateRequestTest.php
🧰 Additional context used
📓 Path-based instructions (3)
**/*
⚙️ CodeRabbit configuration file
**/*: Generate manual testing checkboxes for the PR. The checkboxes should cover:
- Visual verification that the UI renders correctly
- Functional testing of user interactions
- Edge cases and error states
- Cross-browser/device testing if applicable
- Integration with related features
Files:
commitlint.config.jstest/Api/ApplePayCertificateApiTest.php
**/*.php
📄 CodeRabbit inference engine (CLAUDE.md)
Adhere to PSR-12 code style across the PHP codebase (use cs-check/cs-fix)
Files:
test/Api/ApplePayCertificateApiTest.php
test/**/*.php
📄 CodeRabbit inference engine (CLAUDE.md)
test/**/*.php: Place unit tests in the test/ directory for all API classes and models and run them with PHPUnit
Use mocked HTTP responses in tests to ensure isolated, deterministic testing
Files:
test/Api/ApplePayCertificateApiTest.php
🧬 Code graph analysis (1)
test/Api/ApplePayCertificateApiTest.php (2)
lib/Model/ApplePayCertificate.php (4)
getId(274-277)getAccountId(298-301)getCsr(322-325)getActive(370-373)lib/Model/UpdateApplePayCertificateRequest.php (1)
getActive(258-261)
🔇 Additional comments (6)
commitlint.config.js (1)
5-6: Commit message length rules are explicitly disabled — confirm this matches intentThe new
body-max-line-lengthandheader-max-lengthentries are configured with severity0, so commitlint will not enforce any limits on body line length or header length. This is valid configuration; just make sure the goal is to fully disable these checks rather than relaxing them to a higher limit (in which case you’d want a non‑zero severity and a max length value).test/Api/ApplePayCertificateApiTest.php (5)
1-64: LGTM! Test structure follows established patterns.The test class is properly structured with appropriate imports and properties. The setup matches the existing PaymentsApiTest pattern with Guzzle mock handler for isolated testing.
80-103: LGTM! Proper test fixture setup and cleanup.The setUp and tearDown methods correctly initialize the mock HTTP infrastructure and clean up after each test, ensuring test isolation.
121-383: Excellent test coverage for API operations.The tests comprehensively verify all CRUD operations with proper assertions for HTTP methods, endpoints, request bodies, and response parsing. The defensive checks ensuring create/update don't hit the activate endpoint (lines 148-151, 337-340) are particularly good.
390-467: LGTM! Thorough parameter validation testing.The validation tests properly verify that required parameters (
idandrequestobjects) throwInvalidArgumentExceptionwhen missing. Good defensive coverage.
474-531: LGTM! Solid error handling coverage.The tests properly verify that 404 and 401 HTTP errors are surfaced as
ApiExceptionwith correct error codes and response body details. The try-catch pattern with fail() ensures exceptions are actually thrown.
Summary
Add comprehensive unit tests for the ApplePayCertificateApi class, replacing placeholder stubs.
Implementation
Test plan
composer testcomposer cs-checkSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.