Skip to content

Commit

Permalink
Add string as valid deliveryEstimate value for ECE (#520)
Browse files Browse the repository at this point in the history
* Add string as valid deliveryEstimate value for ECE

* linting/style improvements

* Add deliveryEstimate test that accepts string
  • Loading branch information
tmcquinn-stripe authored Oct 25, 2023
1 parent 2274d67 commit db429aa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 6 additions & 0 deletions tests/types/src/valid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,12 @@ expressCheckoutElement.on(
},
},
},
{
id: 'fast-shipping',
amount: 300,
displayName: 'Pizza time, soon',
deliveryEstimate: 'A couple of weeks',
},
{
id: 'free-shipping',
amount: 0,
Expand Down
10 changes: 6 additions & 4 deletions types/stripe-js/elements/express-checkout.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,12 @@ export type ShippingRate = {
id: string;
amount: number;
displayName: string;
deliveryEstimate?: {
maximum?: DeliveryEstimate;
minimum?: DeliveryEstimate;
};
deliveryEstimate?:
| string
| {
maximum?: DeliveryEstimate;
minimum?: DeliveryEstimate;
};
};

export type LayoutOption = {
Expand Down

0 comments on commit db429aa

Please sign in to comment.