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 defaultValues to StripePaymentElementOptions interface #332

Conversation

starsirius
Copy link
Contributor

Summary & motivation

We ran into typescript error when using the defaultValues option in Payment Element. This adds it to StripePaymentElementOptions interface.

Testing & documentation

I wrote unit tests.

@CLAassistant
Copy link

CLAassistant commented Jun 15, 2022

CLA assistant check
All committers have signed the CLA.

@@ -266,6 +266,21 @@ const afterpayClearpayMessageElement = elements.create(
);

const paymentElement: StripePaymentElement = elements.create('payment', {
defaultValues: {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure how exhaustive I should be for the tests. Please let me know if anything can be added!

@starsirius starsirius changed the title Add defaultValues to StripePaymentElementOptions Add defaultValues to StripePaymentElementOptions interface Jun 15, 2022
Copy link
Contributor

@jackieosborn-stripe jackieosborn-stripe left a comment

Choose a reason for hiding this comment

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

Hi, thanks for contributing! I left one comment about the casing of postal code, and it looks like prettier should be run to lint. Other than that, it looks all good 😄

address?:
{
country?: string;
postalCode?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be postal_code instead of postalCode (doc)!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jackieosborn-stripe Thank you for the quick review and nice catch!

And just to surface it, it seems inconsistent, for example with the postalCode in the fields option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated it in 2ad16db.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for bringing it up - we're aware of the inconsistencies 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Awesome! Thank you! Looking forward to getting this released! 🎉

city: 'South San Francisco',
state: 'CA',
country: 'US',
postalCode: '94080'
Copy link
Contributor

Choose a reason for hiding this comment

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

And then same here :)

Copy link
Contributor

@jackieosborn-stripe jackieosborn-stripe left a comment

Choose a reason for hiding this comment

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

🎉

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.

None yet

3 participants