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

Add stripeCustomerId Parameter to Organization Methods #250

Merged
merged 3 commits into from
Dec 6, 2024

Conversation

Hannes-Kruger
Copy link
Contributor

@Hannes-Kruger Hannes-Kruger commented Dec 5, 2024

Description

This pull request introduces support for the stripeCustomerId parameter in the PHP SDK's updateOrganization method. This aligns the SDK with WorkOS's existing API functionality, enabling developers to specify a Stripe Customer ID when updating an organization.

Changes in this PR:

  1. updateOrganization Method:
    • Added a new optional parameter: $stripeCustomerId.
    • Includes the stripe_customer_id field in the request payload when provided.

These changes do not affect existing behavior and remain fully backward-compatible.

Code Diff

Relevant code snippets for the additions:

if (isset($stripeCustomerId)) {
    $params["stripe_customer_id"] = $stripeCustomerId;
}

Documentation

Does this require changes to the WorkOS Docs? E.g., the API Reference or code snippets need updates.

[ ] Yes
[X] No

This update reflects an existing API feature, so no changes to the WorkOS documentation are required.

Testing

No tests have been added for this change. The implementation follows the existing structure for handling optional parameters, and the changes have been manually verified to ensure they align with the expected behavior.

Backward Compatibility:

  • Verified that omitting the stripeCustomerId parameter does not affect the current behavior of the methods.

Additional Notes

This update ensures parity with WorkOS's API functionality, enabling seamless integration of Stripe Entitlements for organizations. Future updates could include test coverage for this parameter.

@Hannes-Kruger Hannes-Kruger requested a review from a team as a code owner December 5, 2024 03:44
Copy link
Contributor

@PaulAsjes PaulAsjes left a comment

Choose a reason for hiding this comment

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

Thanks for this!

While updateOrganization definitely needs the optional stripeCustomerId parameter, createOrganization doesn't accept a Stripe customer ID presently: https://workos.com/docs/reference/organization/create

I think we should consider adding the Stripe customer ID when creating an organization, but for this PR would you mind removing that part?

@Hannes-Kruger
Copy link
Contributor Author

Ah ok, I missed that! I'll make the change

@Hannes-Kruger
Copy link
Contributor Author

Done

Copy link
Contributor

@PaulAsjes PaulAsjes left a comment

Choose a reason for hiding this comment

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

Thanks so much!

@PaulAsjes PaulAsjes merged commit 7353eba into workos:main Dec 6, 2024
3 checks passed
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