Merge pull request #31511 from slangeder/master

[stripe-v3] Added support for iban elements
This commit is contained in:
Nathan Shively-Sanders
2018-12-18 14:12:52 -08:00
committed by GitHub
2 changed files with 12 additions and 1 deletions
+7 -1
View File
@@ -6,6 +6,7 @@
// Adam Cmiel <https://github.com/adamcmiel>
// Justin Leider <https://github.com/jleider>
// Kamil Gałuszka <https://github.com/galuszkak>
// Stefan Langeder <https://github.com/slangeder>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare var Stripe: stripe.StripeStatic;
@@ -313,6 +314,8 @@ declare namespace stripe {
complete: boolean;
empty: boolean;
value?: { postalCode: string | number };
country?: string;
bankName?: string;
error?: Error;
}
@@ -321,7 +324,7 @@ declare namespace stripe {
locale?: string;
}
type elementsType = 'card' | 'cardNumber' | 'cardExpiry' | 'cardCvc' | 'postalCode' | 'paymentRequestButton';
type elementsType = 'card' | 'cardNumber' | 'cardExpiry' | 'cardCvc' | 'postalCode' | 'paymentRequestButton' | 'iban';
interface Elements {
create(type: elementsType, options?: ElementsOptions): Element;
}
@@ -339,6 +342,7 @@ declare namespace stripe {
hideIcon?: boolean;
iconStyle?: 'solid' | 'default';
placeholder?: string;
placeholderCountry?: string;
style?: {
base?: Style;
complete?: Style;
@@ -348,6 +352,8 @@ declare namespace stripe {
};
value?: string | { [objectKey: string]: string; };
paymentRequest?: paymentRequest.StripePaymentRequest;
supportedCountries?: string[];
disabled?: boolean;
}
interface Style extends StyleOptions {
+5
View File
@@ -211,5 +211,10 @@ describe("Stripe v2 & v3", () => {
(error: stripe.Error) => {
console.error(error);
});
elements.create('iban', {
supportedCountries: ['SEPA'],
placeholderCountry: 'AT'
});
});
});