5.5.2 • Published 23 days ago

@capacitor-community/stripe v5.5.2

Weekly downloads
175
License
MIT
Repository
github
Last release
23 days ago

@capacitor-community/stripe

Stripe SDK bindings for Capacitor Applications

Install

npm install @capacitor-community/stripe
npx cap sync

API

setPublishableKey(...)

setPublishableKey(opts: SetPublishableKeyOptions) => Promise<void>
ParamType
optsSetPublishableKeyOptions

createCardToken(...)

createCardToken(card: CardTokenRequest) => Promise<CardTokenResponse>
ParamType
cardCardTokenRequest

Returns: Promise<CardTokenResponse>


createBankAccountToken(...)

createBankAccountToken(bankAccount: BankAccountTokenRequest) => Promise<BankAccountTokenResponse>
ParamType
bankAccountBankAccountTokenRequest

Returns: Promise<BankAccountTokenResponse>


isApplePayAvailable()

isApplePayAvailable() => Promise<AvailabilityResponse>

Returns: Promise<AvailabilityResponse>


payWithApplePay(...)

payWithApplePay(options: { applePayOptions: ApplePayOptions; }) => Promise<ApplePayResponse>
ParamType
options{ applePayOptions: ApplePayOptions; }

Returns: Promise<ApplePayResponse>


cancelApplePay()

cancelApplePay() => Promise<void>

finalizeApplePayTransaction(...)

finalizeApplePayTransaction(opts: FinalizeApplePayTransactionOptions) => Promise<void>
ParamType
optsFinalizeApplePayTransactionOptions

isGooglePayAvailable()

isGooglePayAvailable() => Promise<AvailabilityResponse>

Returns: Promise<AvailabilityResponse>


payWithGooglePay(...)

payWithGooglePay(opts: { googlePayOptions: GooglePayOptions; }) => Promise<GooglePayResponse>
ParamType
opts{ googlePayOptions: GooglePayOptions; }

Returns: Promise<GooglePayResponse>


customizePaymentAuthUI(...)

customizePaymentAuthUI(opts: any) => Promise<void>
ParamType
optsany

presentPaymentOptions()

presentPaymentOptions() => Promise<PresentPaymentOptionsResponse>

Returns: Promise<PresentPaymentOptionsResponse>


validateCardNumber(...)

validateCardNumber(opts: ValidateCardNumberOptions) => Promise<ValidityResponse>
ParamType
optsValidateCardNumberOptions

Returns: Promise<ValidityResponse>


validateExpiryDate(...)

validateExpiryDate(opts: ValidateExpiryDateOptions) => Promise<ValidityResponse>
ParamType
optsValidateExpiryDateOptions

Returns: Promise<ValidityResponse>


validateCVC(...)

validateCVC(opts: ValidateCVCOptions) => Promise<ValidityResponse>
ParamType
optsValidateCVCOptions

Returns: Promise<ValidityResponse>


identifyCardBrand(...)

identifyCardBrand(opts: IdentifyCardBrandOptions) => Promise<CardBrandResponse>
ParamType
optsIdentifyCardBrandOptions

Returns: Promise<CardBrandResponse>


confirmPaymentIntent(...)

confirmPaymentIntent(opts: ConfirmPaymentIntentOptions) => Promise<ConfirmPaymentIntentResponse>
ParamType
optsConfirmPaymentIntentOptions

Returns: Promise<ConfirmPaymentIntentResponse>


confirmSetupIntent(...)

confirmSetupIntent(opts: ConfirmSetupIntentOptions) => Promise<ConfirmSetupIntentResponse>
ParamType
optsConfirmSetupIntentOptions

Returns: Promise<ConfirmSetupIntentResponse>


initCustomerSession(...)

initCustomerSession(opts: InitCustomerSessionParams) => Promise<void>
ParamType
optsInitCustomerSessionParams

customerPaymentMethods()

customerPaymentMethods() => Promise<CustomerPaymentMethodsResponse>

Returns: Promise<CustomerPaymentMethodsResponse>


setCustomerDefaultSource(...)

setCustomerDefaultSource(opts: { sourceId: string; type?: string; }) => Promise<CustomerPaymentMethodsResponse>
ParamType
opts{ sourceId: string; type?: string; }

Returns: Promise<CustomerPaymentMethodsResponse>


addCustomerSource(...)

addCustomerSource(opts: { sourceId: string; type?: string; }) => Promise<CustomerPaymentMethodsResponse>
ParamType
opts{ sourceId: string; type?: string; }

Returns: Promise<CustomerPaymentMethodsResponse>


deleteCustomerSource(...)

deleteCustomerSource(opts: { sourceId: string; }) => Promise<CustomerPaymentMethodsResponse>
ParamType
opts{ sourceId: string; }

Returns: Promise<CustomerPaymentMethodsResponse>


createSourceToken(...)

createSourceToken(opts: CreateSourceTokenOptions) => Promise<TokenResponse>
ParamType
optsCreateSourceTokenOptions

Returns: Promise<TokenResponse>


createPiiToken(...)

createPiiToken(opts: CreatePiiTokenOptions) => Promise<TokenResponse>
ParamType
optsCreatePiiTokenOptions

Returns: Promise<TokenResponse>


createAccountToken(...)

createAccountToken(account: AccountParams) => Promise<TokenResponse>
ParamType
accountAccountParams

Returns: Promise<TokenResponse>


Interfaces

CardTokenResponse

PropType
cardCard

CardTokenRequest

PropTypeDescription
numberstring
exp_monthnumber
exp_yearnumber
cvcstring
namestring
address_line1string
address_line2string
address_citystring
address_statestring
address_countrystring
address_zipstring
currencystring
phonestringiOS only
emailstringiOS only

BankAccountTokenResponse

PropType
bank_accountBankAccount

BankAccountTokenRequest

PropType
countrystring
currencystring
account_holder_namestring
account_holder_typestring
routing_numberstring
account_numberstring

ApplePayResponse

PropType
tokenstring

ApplePayOptions

PropType
merchantIdstring
countrystring
currencystring
itemsApplePayItem[]
billingEmailAddressboolean
billingNameboolean
billingPhoneNumberboolean
billingPhoneticNameboolean
billingPostalAddressboolean
shippingEmailAddressboolean
shippingNameboolean
shippingPhoneNumberboolean
shippingPhoneticNameboolean
shippingPostalAddressboolean

ApplePayItem

PropType
labelstring
amountstring | number

GooglePayResponse

PropType
successboolean
token{ apiVersionMinor: number; apiVersion: number; paymentMethodData: { description: string; tokenizationData: { type: string; token: string; }; type: string; info: { cardNetwork: string; cardDetails: string; billingAddress?: { countryCode: string; postalCode: string; name: string; }; }; }; shippingAddress?: { address3: string; sortingCode: string; address2: string; countryCode: string; address1: string; postalCode: string; name: string; locality: string; administrativeArea: string; }; email?: string; }

GooglePayOptions

PropTypeDescription
merchantNamestringMerchant name encoded as UTF-8. Merchant name is rendered in the payment sheet. In TEST environment, or if a merchant isn't recognized, a “Pay Unverified Merchant” message is displayed in the payment sheet.
totalPricestringTotal monetary value of the transaction with an optional decimal precision of two decimal places.
totalPriceStatusGooglePayPriceStatusThe status of the total price used
totalPriceLabelstringCustom label for the total price within the display items.
checkoutOption'DEFAULT' | 'COMPLETE_IMMEDIATE_PURCHASE'Affects the submit button text displayed in the Google Pay payment sheet.
transactionIdstringA unique ID that identifies a transaction attempt. Merchants may use an existing ID or generate a specific one for Google Pay transaction attempts. This field is required when you send callbacks to the Google Transaction Events API.
currencyCodestringISO 4217 alphabetic currency code.
countryCodestringISO 3166-1 alpha-2 country code where the transaction is processed. This is required for merchants based in European Economic Area (EEA) countries.
allowedAuthMethodsGooglePayAuthMethod[]Fields supported to authenticate a card transaction.
allowedCardNetworks('AMEX' | 'DISCOVER' | 'INTERAC' | 'JCB' | 'MASTERCARD' | 'VISA')[]One or more card networks that you support, also supported by the Google Pay API.
allowPrepaidCardsbooleanSet to false if you don't support prepaid cards. Default: The prepaid card class is supported for the card networks specified.
emailRequiredbooleanSet to true to request an email address.
billingAddressRequiredbooleanSet to true if you require a billing address. A billing address should only be requested if it's required to process the transaction. Additional data requests can increase friction in the checkout process and lead to a lower conversion rate.
billingAddressParameters{ format?: GooglePayBillingAddressFormat; phoneNumberRequired?: boolean; }
shippingAddressRequiredbooleanSet to true to request a full shipping address.
shippingAddressParameters{ allowedCountryCodes?: string[]; phoneNumberRequired?: boolean; }

ConfirmPaymentIntentResponse

PropType
amountnumber
capture_methodstring
client_secretstring
confirmation_methodstring
creatednumber
currencystring
cadstring
livemodeboolean
objectstring
payment_methodPaymentMethod
payment_method_typesstring[]
statusstring

ConfirmPaymentIntentOptions

PropTypeDescription
setupFutureUsage'on_session' | 'off_session'Indicates that you intend to make future payments with this PaymentIntent's payment method. If present, the payment method used with this PaymentIntent can be attached to a Customer, even after the transaction completes. Use on_session if you intend to only reuse the payment method when your customer is present in your checkout flow. Use off_session if your customer may or may not be in your checkout flow. Stripe uses setup_future_usage to dynamically optimize your payment flow and comply with regional legislation and network rules. For example, if your customer is impacted by SCA, using off_session will ensure that they are authenticated while processing this PaymentIntent. You will then be able to collect off-session payments for this customer. If setup_future_usage is already set and you are performing a request using a publishable key, you may only update the value from on_session to off_session.
saveMethodbooleanWhether you intend to save the payment method to the customer's account after this payment
applePayOptionsApplePayOptionsIf provided, the payment intent will be confirmed using Apple Pay
googlePayOptionsGooglePayOptionsIf provided, the payment intent will be confirmed using Google Pay

ConfirmSetupIntentResponse

PropTypeDescription
creatednumberUnix timestamp representing creation time
idstringSetup intent ID
isLiveModebooleanWhether the setup intent was created in live mode
paymentMethodIdstringPayment method ID
statusstring
usagestring

ConfirmSetupIntentOptions

PropType
idstring

TokenResponse

PropType
idstring
typestring
createdDate

Date

Enables basic storage and retrieval of dates and times.

MethodSignatureDescription
toString() => stringReturns a string representation of a date. The format of the string depends on the locale.
toDateString() => stringReturns a date as a string value.
toTimeString() => stringReturns a time as a string value.
toLocaleString() => stringReturns a value as a string value appropriate to the host environment's current locale.
toLocaleDateString() => stringReturns a date as a string value appropriate to the host environment's current locale.
toLocaleTimeString() => stringReturns a time as a string value appropriate to the host environment's current locale.
valueOf() => numberReturns the stored time value in milliseconds since midnight, January 1, 1970 UTC.
getTime() => numberGets the time value in milliseconds.
getFullYear() => numberGets the year, using local time.
getUTCFullYear() => numberGets the year using Universal Coordinated Time (UTC).
getMonth() => numberGets the month, using local time.
getUTCMonth() => numberGets the month of a Date object using Universal Coordinated Time (UTC).
getDate() => numberGets the day-of-the-month, using local time.
getUTCDate() => numberGets the day-of-the-month, using Universal Coordinated Time (UTC).
getDay() => numberGets the day of the week, using local time.
getUTCDay() => numberGets the day of the week using Universal Coordinated Time (UTC).
getHours() => numberGets the hours in a date, using local time.
getUTCHours() => numberGets the hours value in a Date object using Universal Coordinated Time (UTC).
getMinutes() => numberGets the minutes of a Date object, using local time.
getUTCMinutes() => numberGets the minutes of a Date object using Universal Coordinated Time (UTC).
getSeconds() => numberGets the seconds of a Date object, using local time.
getUTCSeconds() => numberGets the seconds of a Date object using Universal Coordinated Time (UTC).
getMilliseconds() => numberGets the milliseconds of a Date, using local time.
getUTCMilliseconds() => numberGets the milliseconds of a Date object using Universal Coordinated Time (UTC).
getTimezoneOffset() => numberGets the difference in minutes between the time on the local computer and Universal Coordinated Time (UTC).
setTime(time: number) => numberSets the date and time value in the Date object.
setMilliseconds(ms: number) => numberSets the milliseconds value in the Date object using local time.
setUTCMilliseconds(ms: number) => numberSets the milliseconds value in the Date object using Universal Coordinated Time (UTC).
setSeconds(sec: number, ms?: number | undefined) => numberSets the seconds value in the Date object using local time.
setUTCSeconds(sec: number, ms?: number | undefined) => numberSets the seconds value in the Date object using Universal Coordinated Time (UTC).
setMinutes(min: number, sec?: number | undefined, ms?: number | undefined) => numberSets the minutes value in the Date object using local time.
setUTCMinutes(min: number, sec?: number | undefined, ms?: number | undefined) => numberSets the minutes value in the Date object using Universal Coordinated Time (UTC).
setHours(hours: number, min?: number | undefined, sec?: number | undefined, ms?: number | undefined) => numberSets the hour value in the Date object using local time.
setUTCHours(hours: number, min?: number | undefined, sec?: number | undefined, ms?: number | undefined) => numberSets the hours value in the Date object using Universal Coordinated Time (UTC).
setDate(date: number) => numberSets the numeric day-of-the-month value of the Date object using local time.
setUTCDate(date: number) => numberSets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).
setMonth(month: number, date?: number | undefined) => numberSets the month value in the Date object using local time.
setUTCMonth(month: number, date?: number | undefined) => numberSets the month value in the Date object using Universal Coordinated Time (UTC).
setFullYear(year: number, month?: number | undefined, date?: number | undefined) => numberSets the year of the Date object using local time.
setUTCFullYear(year: number, month?: number | undefined, date?: number | undefined) => numberSets the year value in the Date object using Universal Coordinated Time (UTC).
toUTCString() => stringReturns a date converted to a string using Universal Coordinated Time (UTC).
toISOString() => stringReturns a date as a string value in ISO format.
toJSON(key?: any) => stringUsed by the JSON.stringify method to enable the transformation of an object's data for JavaScript Object Notation (JSON) serialization.

ThreeDeeSecureParams

PropTypeDescription
amountnumberAmount
currencystringCurrency code
returnURLstringURL to redirect to after successfully verifying the card
cardstringCard source ID

GiroPayParams

PropType
amountnumber
namestring
returnURLstring
statementDescriptorstring

iDEALParams

PropType
amountnumber
namestring
returnURLstring
statementDescriptorstring
bankstring

SEPADebitParams

PropType
namestring
ibanstring
addressLine1string
citystring
postalCodestring
countrystring

SofortParams

PropType
amountnumber
returnURLstring
countrystring
statementDescriptorstring

AlipayParams

PropType
amountnumber
currencystring
returnURLstring

AlipayReusableParams

PropType
currencystring
returnURLstring

P24Params

PropType
amountnumber
currencystring
emailstring
namestring
returnURLstring

VisaCheckoutParams

PropType
callIdstring

AccountParams

PropType
tosShownAndAcceptedboolean
legalEntityCompanyLegalEntityParams | IndividualLegalEntityParams

CompanyLegalEntityParams

PropTypeDescription
type'company'
namestringThe company’s legal name. account.company.name
owners_providedbooleanWhether the company’s owners have been provided. Set this Boolean to true after creating all the company’s owners with the Persons API for accounts with a relationship.owner requirement. account.company.owners_provided
directors_providedbooleanWhether the company’s directors have been provided. Set this Boolean to true after creating all the company’s directors with the Persons API for accounts with a relationship.director requirement. This value is not automatically set to true after creating directors, so it needs to be updated to indicate all directors have been provided. account.company.directors_provided
executives_providedbooleanWhether the company’s executives have been provided. Set this Boolean to true after creating all the company’s executives with the Persons API for accounts with a relationship.executive requirement. account.company.executives_provided
tax_idstringThe business ID number of the company, as appropriate for the company’s country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) account.company.tax_id
tax_id_registrarstringThe jurisdiction in which the tax_id is registered (Germany-based companies only). account.company.tax_id_registrar
vat_idstringThe VAT number of the company. account.company.vat_id
phonestringThe company’s phone number (used for verification).

IndividualLegalEntityParams

PropTypeDescription
type'individual'
first_namestringThe individual’s first name.
last_namestringThe individual’s last name.
emailstringThe individual’s email.
gender'male' | 'female'The individual’s gender (International regulations require either “male” or “female”).
id_numberstringThe government-issued ID number of the individual, as appropriate for the representative’s country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a PII token.
phonestringThe individual’s phone number.
ssn_last4stringThe last four digits of the individual’s Social Security Number (U.S. only).

Type Aliases

SetPublishableKeyOptions

{ key: string; }

AvailabilityResponse

{ available: boolean }

FinalizeApplePayTransactionOptions

{ success: boolean; }

PresentPaymentOptionsResponse

{ useGooglePay?: boolean; useApplePay?: boolean; paymentMethod?: PaymentMethod; }

ValidityResponse

{ valid: boolean }

ValidateCardNumberOptions

{ number: string; }

ValidateExpiryDateOptions

{ exp_month: number; exp_year: number; }

ValidateCVCOptions

{ cvc: string; }

CardBrandResponse

{ brand: CardBrand }

IdentifyCardBrandOptions

{ number: string; }

InitCustomerSessionParams

{ id: string; object: 'ephemeral_key'; associated_objects: { type: 'customer'; id: string; }[]; created: number; expires: number; livemode: boolean; secret: string; apiVersion?: string; } & StripeAccountIdOpt

StripeAccountIdOpt

{ /** Optional Used on Android only */ stripeAccountId?: string; }

CustomerPaymentMethodsResponse

{ paymentMethods: PaymentMethod[]; }

CreateSourceTokenOptions

{ type: SourceType; params: SourceParams; }

SourceParams

ThreeDeeSecureParams | GiroPayParams | iDEALParams | SEPADebitParams | SofortParams | AlipayParams | AlipayReusableParams | P24Params | VisaCheckoutParams

CreatePiiTokenOptions

{ pii: string; } & StripeAccountIdOpt & IdempotencyKeyOpt

IdempotencyKeyOpt

{ /** Optional Used on Android only */ idempotencyKey?: string; }

Enums

GooglePayPriceStatus

MembersValueDescription
NOT_CURRENTLY_KNOWN'NOT_CURRENTLY_KNOWN'Used for a capability check. Do not use this property if the transaction is processed in an EEA country.
ESTIMATED'ESTIMATED'Total price may adjust based on the details of the response, such as sales tax collected based on a billing address.
FINAL'FINAL'Total price doesn't change from the amount presented to the shopper.

GooglePayAuthMethod

MembersValueDescription
PAN_ONLY'PAN_ONLY'This authentication method is associated with payment cards stored on file with the user's Google Account. Returned payment data includes personal account number (PAN) with the expiration month and the expiration year.
CRYPTOGRAM_3DS'CRYPTOGRAM_3DS'This authentication method is associated with cards stored as Android device tokens. Returned payment data includes a 3-D Secure (3DS) cryptogram generated on the device.

GooglePayBillingAddressFormat

MembersValueDescription
MIN'MIN'Name, country code, and postal code (default).
FULL'FULL'Name, street address, locality, region, country code, and postal code.

CardBrand

MembersValue
AMERICAN_EXPRESS'American Express'
DISCOVER'Discover'
JCB'JCB'
DINERS_CLUB'Diners Club'
VISA'Visa'
MASTERCARD'MasterCard'
UNIONPAY'UnionPay'
UNKNOWN'Unknown'

SourceType

MembersValue
ThreeDeeSecure'3ds'
GiroPay'giropay'
iDEAL'ideal'
SEPADebit'sepadebit'
Sofort'sofort'
AliPay'alipay'
AliPayReusable'alipayreusable'
P24'p24'
VisaCheckout'visacheckout'
6.0.1

23 days ago

6.0.0

24 days ago

5.5.2

1 month ago

5.5.1

1 month ago

5.5.1-beta.0

2 months ago

5.5.0

2 months ago

6.0.0-2

2 months ago

5.4.6

2 months ago

5.4.5

2 months ago

5.4.4

2 months ago

5.4.3

2 months ago

5.4.3-1

3 months ago

5.4.3-0

3 months ago

6.0.0-1

3 months ago

6.0.0-0

3 months ago

5.3.0

7 months ago

5.1.0

9 months ago

5.4.2

6 months ago

5.4.1

6 months ago

5.4.0

6 months ago

5.0.4

9 months ago

5.0.3

9 months ago

5.2.0

9 months ago

5.0.2

9 months ago

5.0.1

1 year ago

4.2.2

1 year ago

4.2.1

1 year ago

4.2.0

1 year ago

4.1.2-0

1 year ago

4.1.2-1

1 year ago

4.1.2

1 year ago

4.1.1

1 year ago

4.1.0

2 years ago

4.1.0-0

2 years ago

4.0.0

2 years ago

3.9.1-0

2 years ago

3.9.1

2 years ago

3.9.0

2 years ago

3.8.0

2 years ago

4.0.0-0

2 years ago

3.8.2

2 years ago

3.8.0-0

2 years ago

3.8.1

2 years ago

3.8.0-1

2 years ago

4.0.0-3

2 years ago

3.8.2-0

2 years ago

4.0.0-1

2 years ago

4.0.0-2

2 years ago

3.7.2

2 years ago

3.7.1

2 years ago

3.7.0

2 years ago

3.6.0

2 years ago

3.6.0-0

2 years ago

3.5.3

2 years ago

3.5.2

2 years ago

3.5.1

2 years ago

3.4.2

2 years ago

3.5.0

2 years ago

3.4.1

2 years ago

3.4.0

3 years ago

3.2.0-1

3 years ago

3.2.0-0

3 years ago

3.2.0-3

3 years ago

3.2.0-2

3 years ago

3.3.0

3 years ago

3.2.0

3 years ago

3.2.0-5

3 years ago

3.2.0-4

3 years ago

3.2.0-6

3 years ago

3.1.3

3 years ago

3.1.2

3 years ago

3.1.1

3 years ago

3.1.4

3 years ago

3.1.0

3 years ago

3.0.3

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0-3

3 years ago

3.0.0-2

3 years ago

3.0.0

3 years ago

3.0.0-1

3 years ago

3.0.0-0

3 years ago

1.1.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago