Skip to content

PHPAY-64: wip(subscription): subscription with asaas#66

Merged
mariolucasdev merged 2 commits into
developfrom
64-subscription-with-asaas
Apr 22, 2025
Merged

PHPAY-64: wip(subscription): subscription with asaas#66
mariolucasdev merged 2 commits into
developfrom
64-subscription-with-asaas

Conversation

@mariolucasdev
Copy link
Copy Markdown
Collaborator

This pull request introduces a new subscription feature to the PHPay library, along with several other improvements and adjustments. The changes include adding functionality for managing subscriptions via the Asaas gateway, updating documentation, and modifying configuration files to align with the new features.

Subscription Feature Implementation:

  • Added a new Subscription resource class in src/Gateways/Asaas/Resources/Subscription/Subscription.php to handle subscription-related operations, including customer assignment and subscription creation.
  • Introduced a SubscriptionInterface in src/Gateways/Asaas/Resources/Subscription/Interface/SubscriptionInterface.php to define the contract for subscription operations.
  • Added a StoreSubscriptionAsaasRequest class in src/Gateways/Asaas/Resources/Subscription/Requests/StoreSubscriptionAsaasRequest.php for validating subscription data before making API calls.
  • Updated AsaasGateway and AsaasGatewayInterface to include a subscription() method for accessing the subscription resource. [1] [2]

Documentation Updates:

  • Expanded the README.md file with examples and details about the new subscription feature. [1] [2] [3]

Configuration and Codebase Adjustments:

  • Adjusted the PHPStan analysis level in .husky/pre-commit from 9 to 7 for broader compatibility.
  • Modified .vscode/settings.json to update editor preferences, including line height and font family. [1] [2]
  • Removed the tests directory from the phpstan.neon paths to exclude it from static analysis.

Core Library Enhancements:

  • Updated the PHPay class to support the new subscription feature by adding a gateway() method for instantiation and a subscription() method for accessing the subscription resource. [1] [2]
  • Added a placeholder subscription() method to the EfiGateway class for consistency, though it is not yet implemented.

@mariolucasdev mariolucasdev self-assigned this Apr 22, 2025
@mariolucasdev mariolucasdev linked an issue Apr 22, 2025 that may be closed by this pull request
@mariolucasdev mariolucasdev requested a review from Copilot April 22, 2025 22:18
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a new subscription feature in the PHPay library by adding a Subscription resource along with interface, request validation, and corresponding gateway methods, and updates the documentation and configuration files to support the feature.

  • Added documentation examples for managing subscriptions via the Asaas gateway.
  • Updated roadmap and configuration files to reflect the new subscription feature.
  • Improved clarity in subscription-related documentation.
Files not reviewed (13)
  • .husky/pre-commit: Language not supported
  • .vscode/settings.json: Language not supported
  • examples/asaas/subscriptions.php: Language not supported
  • phpstan.neon: Language not supported
  • src/Contracts/GatewayInterface.php: Language not supported
  • src/Gateways/Asaas/AsaasGateway.php: Language not supported
  • src/Gateways/Asaas/Interface/AsaasGatewayInterface.php: Language not supported
  • src/Gateways/Asaas/Resources/Subscription/Interface/SubscriptionInterface.php: Language not supported
  • src/Gateways/Asaas/Resources/Subscription/Requests/StoreSubscriptionAsaasRequest.php: Language not supported
  • src/Gateways/Asaas/Resources/Subscription/Subscription.php: Language not supported
  • src/Gateways/Efi/EfiGateway.php: Language not supported
  • src/PHPay.php: Language not supported
  • tests/PHPayTest.php: Language not supported
Comments suppressed due to low confidence (1)

README.md:118

  • [nitpick] The variable name $phpay in this subscription example could be misleading. Consider renaming it to $subscription to accurately reflect that it holds a subscription resource.
/**
 * @var Subscription $phpay
 */

@mariolucasdev mariolucasdev merged commit 2acf691 into develop Apr 22, 2025
@mariolucasdev mariolucasdev deleted the 64-subscription-with-asaas branch April 22, 2025 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

subscription with asaas

3 participants