New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@power-elements/stripe-elements

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@power-elements/stripe-elements

Web Component wrapper for stripe elements

  • 2.3.10
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
454
decreased by-20.49%
Maintainers
1
Weekly downloads
 
Created
Source

./stripe-elements.js:

class: StripeElements, stripe-elements

Superclass
NameModulePackage
StripeBase/src/StripeBase.js
Static Fields
NamePrivacyTypeDefaultDescriptionInherited From
isstring'stripe-elements'
elementTypestring'card'
Fields
NamePrivacyTypeDefaultDescriptionInherited From
hideIconbooleanfalseWhether to hide icons in the Stripe form.
hidePostalCodebooleanfalseWhether or not to hide the postal code field. Useful when you gather shipping info elsewhere.
iconStylestripe.elements.ElementsOptions['iconStyle']'default'Stripe icon style.
valuestripe.elements.ElementsOptions['value']{}Prefilled values for form.
brandstripe.brandTypenullThe card brand detected by Stripe
completebooleanfalseWhether the form is complete.
emptybooleantrueIf the form is empty.
invalidbooleanfalseWhether the form is invalid.
cardstripe.elements.ElementnullThe Stripe card object. **DEPRECATED**. Will be removed in a future version. use `element` instead
isEmptybooleantrueWhether the form is empty. **DEPRECATED**. Will be removed in a future version. use `empty` instead
isCompletebooleanfalseWhether the form is complete. **DEPRECATED**. Will be removed in a future version. use `complete` instead
Methods
NamePrivacyDescriptionParametersReturnInherited From
createPaymentMethodpublicSubmit payment information to generate a paymentMethodpaymentMethodData: stripe.PaymentMethodDataPromise<stripe.PaymentMethodResponse>
createSourcepublicSubmit payment information to generate a sourcesourceData: stripe.SourceOptionsPromise<stripe.SourceResponse>
createTokenpublicSubmit payment information to generate a tokentokenData: stripe.TokenOptionsPromise<stripe.TokenResponse>
isPotentiallyValidpublicChecks for potential validity. A potentially valid form is one that is not empty, not complete and has no error. A validated form also counts as potentially valid.boolean
resetpublicResets the Stripe card.void
submitpublicGenerates a payment representation of the type specified by `generate`.Promise<StripePaymentResponse>
validatepublicChecks if the Stripe form is valid.boolean
Events
NameTypeDescriptionInherited From
'change'Stripe Element change event
Attributes
NameFieldInherited From
hide-iconhideIcon
hide-postal-codehidePostalCode
icon-styleiconStyle
valuevalue
brandbrand
completecomplete
emptyempty
invalidinvalid
cardcard
is-emptyisEmpty
is-completeisComplete
CSS Properties
NameDefaultDescription
--stripe-elements-border-radius`4px`border radius of the element container
--stripe-elements-border`1px solid transparent`border property of the element container
--stripe-elements-box-shadow`0 1px 3px 0 #e6ebf1`box shadow for the element container
--stripe-elements-transition`box-shadow 150ms ease`transition property for the element container
--stripe-elements-base-color`color` property for the element in its base state
--stripe-elements-base-font-family`font-family` property for the element in its base state
--stripe-elements-base-font-size`font-size` property for the element in its base state
--stripe-elements-base-font-smoothing`font-smoothing` property for the element in its base state
--stripe-elements-base-font-variant`font-variant` property for the element in its base state
--stripe-elements-base-icon-color`icon-color` property for the element in its base state
--stripe-elements-base-line-height`line-height` property for the element in its base state
--stripe-elements-base-letter-spacing`letter-spacing` property for the element in its base state
--stripe-elements-base-text-decoration`text-decoration` property for the element in its base state
--stripe-elements-base-text-shadow`text-shadow` property for the element in its base state
--stripe-elements-base-text-transform`text-transform` property for the element in its base state
--stripe-elements-complete-color`color` property for the element in its complete state
--stripe-elements-complete-font-family`font-family` property for the element in its complete state
--stripe-elements-complete-font-size`font-size` property for the element in its complete state
--stripe-elements-complete-font-smoothing`font-smoothing` property for the element in its complete state
--stripe-elements-complete-font-variant`font-variant` property for the element in its complete state
--stripe-elements-complete-icon-color`icon-color` property for the element in its complete state
--stripe-elements-complete-line-height`line-height` property for the element in its complete state
--stripe-elements-complete-letter-spacing`letter-spacing` property for the element in its complete state
--stripe-elements-complete-text-decoration`text-decoration` property for the element in its complete state
--stripe-elements-complete-text-shadow`text-shadow` property for the element in its complete state
--stripe-elements-complete-text-transform`text-transform` property for the element in its complete state
--stripe-elements-empty-color`color` property for the element in its empty state
--stripe-elements-empty-font-family`font-family` property for the element in its empty state
--stripe-elements-empty-font-size`font-size` property for the element in its empty state
--stripe-elements-empty-font-smoothing`font-smoothing` property for the element in its empty state
--stripe-elements-empty-font-variant`font-variant` property for the element in its empty state
--stripe-elements-empty-icon-color`icon-color` property for the element in its empty state
--stripe-elements-empty-line-height`line-height` property for the element in its empty state
--stripe-elements-empty-letter-spacing`letter-spacing` property for the element in its empty state
--stripe-elements-empty-text-decoration`text-decoration` property for the element in its empty state
--stripe-elements-empty-text-shadow`text-shadow` property for the element in its empty state
--stripe-elements-empty-text-transform`text-transform` property for the element in its empty state
--stripe-elements-invalid-color`color` property for the element in its invalid state
--stripe-elements-invalid-font-family`font-family` property for the element in its invalid state
--stripe-elements-invalid-font-size`font-size` property for the element in its invalid state
--stripe-elements-invalid-font-smoothing`font-smoothing` property for the element in its invalid state
--stripe-elements-invalid-font-variant`font-variant` property for the element in its invalid state
--stripe-elements-invalid-icon-color`icon-color` property for the element in its invalid state
--stripe-elements-invalid-line-height`line-height` property for the element in its invalid state
--stripe-elements-invalid-letter-spacing`letter-spacing` property for the element in its invalid state
--stripe-elements-invalid-text-decoration`text-decoration` property for the element in its invalid state
--stripe-elements-invalid-text-shadow`text-shadow` property for the element in its invalid state
--stripe-elements-invalid-text-transform`text-transform` property for the element in its invalid state
Private API
Fields
NamePrivacyTypeDefaultDescriptionInherited From
slotNameprotectedSlotName
Methods
NamePrivacyDescriptionParametersReturnInherited From
getPaymentMethodDataprivateGenerates PaymentMethodData from the element.stripe.PaymentMethodData
getStripeElementsStylesprivateReturns a Stripe-friendly style object computed from CSS custom propertiesStripeStyleInit
initElementprotectedPromise<void>
onChangeprivateUpdates the element's state.event: stripe.elements.ElementChangeResponsePromise<void>

Exports

KindNameDeclarationModulePackage
jsStripeElementsStripeElements./stripe-elements.js
custom-element-definitionstripe-elementsStripeElements./stripe-elements.js

./stripe-payment-request.js:

class: StripePaymentRequest, stripe-payment-request

Superclass
NameModulePackage
StripeBase/src/StripeBase.js
Static Fields
NamePrivacyTypeDefaultDescriptionInherited From
isstring'stripe-payment-request'
Fields
NamePrivacyTypeDefaultDescriptionInherited From
amountnumberThe amount in the currency's subunit (e.g. cents, yen, etc.)
canMakePaymentCanMakePaymentTypenullWhether or not the device can make the payment request.
countryCountryCodeThe two-letter country code of your Stripe account
currencyStripePaymentRequestOptions['currency']Three character currency code
displayItemsDisplayItem[]An array of DisplayItem objects. These objects are shown as line items in the browser’s payment interface. Note that the sum of the line item amounts does not need to add up to the total amount above.
labelstringA name that the browser shows the customer in the payment interface.
paymentIntentPaymentIntentnullStripe PaymentIntent
paymentRequeststripe.paymentRequest.StripePaymentRequestnullStripe PaymentRequest
pendingbooleanfalseIf you might change the payment amount later (for example, after you have calcluated shipping costs), set this to true. Note that browsers treat this as a hint for how to display things, and not necessarily as something that will prevent submission.
requestPayerEmailbooleanSee the requestPayerName option.
requestPayerNamebooleanBy default, the browser‘s payment interface only asks the customer for actual payment information. A customer name can be collected by setting this option to true. This collected name will appears in the PaymentResponse object. We highly recommend you collect at least one of name, email, or phone as this also results in collection of billing address for Apple Pay. The billing address can be used to perform address verification and block fraudulent payments. For all other payment methods, the billing address is automatically collected when available.
requestPayerPhonebooleanSee the requestPayerName option.
requestShippingbooleanCollect shipping address by setting this option to true. The address appears in the PaymentResponse. You must also supply a valid [ShippingOptions] to the shippingOptions property. This can be up front at the time stripe.paymentRequest is called, or in response to a shippingaddresschange event using the updateWith callback.
shippingOptionsShippingOption[]An array of ShippingOption objects. The first shipping option listed appears in the browser payment interface as the default option.
buttonTypePaymentRequestButtonStyleOptions['type']'default'
buttonThemePaymentRequestButtonStyleOptions['theme']'dark'
Methods
NamePrivacyDescriptionParametersReturnInherited From
resetpublicvoid
Events
NameTypeDescriptionInherited From
'unsupported'When the element detects that the user agent cannot make a payment
'fail'When a payment request fails
'cancel'When a payment request is cancelled
'shippingaddresschange'When the user chooses a different shipping address
'shippingoptionchange'When the user chooses a different shipping option
Attributes
NameFieldInherited From
amountamount
can-make-paymentcanMakePayment
countrycountry
currencycurrency
displayItemsdisplayItems
labellabel
payment-intentpaymentIntent
payment-requestpaymentRequest
pendingpending
request-payer-emailrequestPayerEmail
request-payer-namerequestPayerName
request-payer-phonerequestPayerPhone
request-shippingrequestShipping
shippingOptionsshippingOptions
button-typebuttonType
button-themebuttonTheme
CSS Properties
NameDefaultDescription
--stripe-payment-request-element-min-width`300px`min-width property of the container element
--stripe-payment-request-element-padding`8px 12px`padding property of the container element
--stripe-payment-request-element-background`white`background property of the container element
Private API
Fields
NamePrivacyTypeDefaultDescriptionInherited From
slotNameprotectedSlotName
#displayItemsprivateDisplayItem[]
#shippingOptionsprivateShippingOption[]
Methods
NamePrivacyDescriptionParametersReturnInherited From
getStripePaymentRequestOptionsprivateCreates a StripePaymentRequestOptions object.StripePaymentRequestOptions
initElementprotectedInitializes the PaymentRequest Object.Promise<void>
initPaymentRequestprivateInitialized the `PaymentRequest` object.Promise<void>
initPaymentRequestButtonprivateCreates Stripe Payment Request Element.Promise<void>
initPaymentRequestListenersprivateAttaches listeners to the `PaymentRequest` object.Promise<void>
updatePaymentRequestprivateUpdates the PaymentRequests's values
onCancelprivateHandle a `cancel` eventvoid
completeprivateCompletes the PaymentRequest.paymentResponse: StripePaymentRequestResponse, confirmationError: stripe.ErrorPromise<StripePaymentRequestResponse | { error: stripe.Error | null }>
onPaymentResponseprivateHandle a paymentResponse from StripepaymentResponse: StripePaymentRequestResponsePromise<void>
confirmPaymentIntentprivateWhen a PaymentIntent client secret is set, confirm the paymentpaymentResponse: StripePaymentRequestResponsePromise<void>
confirmCardPaymentprivateStripe confirmCardPayment methoddata: stripe.ConfirmCardPaymentData, options: stripe.ConfirmCardPaymentOptionsPromise<PaymentIntentResponse>
onShippingaddresschangeprivateoriginalEvent: ShippingAddressChangeEventvoid
onShippingoptionchangeprivateoriginalEvent: ShippingOptionChangeEventvoid
parseDatasetsprivateParses an element's dataset number props from string to numberselector: 'stripe-shipping-option'ShippingOption[]
parseDatasetsprivateselector: 'stripe-display-item'DisplayItem[]
parseDatasetsprivateselector: 'stripe-display-item'|'stripe-shipping-option'(stripe.paymentRequest.DisplayItem|stripe.paymentRequest.ShippingOption)[]

Functions

NameDescriptionParametersReturn
isStripeDisplayItemel: Elementel is StripeDisplayItem
isStripeShippingOptionel: Elementel is StripeShippingOption

Exports

KindNameDeclarationModulePackage
jsisStripeDisplayItemisStripeDisplayItem./stripe-payment-request.js
jsisStripeShippingOptionisStripeShippingOption./stripe-payment-request.js
jsStripePaymentRequestStripePaymentRequest./stripe-payment-request.js
custom-element-definitionstripe-payment-requestStripePaymentRequest./stripe-payment-request.js

./index.js:

Exports

KindNameDeclarationModulePackage
jsStripeElementsStripeElements./stripe-elements.js
jsStripePaymentRequestStripePaymentRequest./stripe-payment-request.js

Keywords

FAQs

Package last updated on 03 Oct 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc