CardSubmitComponentConfig
View the reference for the CardSubmitComponentConfig
file.
Reference
import CardSubmitComponentConfig from "@pxpio/web-components-sdk/components/cardSubmitComponents/CardSubmitComponent";
const cardSubmitConfig: CardSubmitComponentConfig = {
submitText: string,
disableUntilValidated: boolean,
hideSubmitButton: boolean,
container: string,
id: string,
class: string,
label: string,
styles: CardSubmitComponentStyles,
newCardComponent: NewCardComponent,
cardNumberComponent: CardNumberComponent,
cardExpiryDateComponent: CardExpiryDateComponent,
cardCvcComponent: CardCvcComponent,
cardHolderNameComponent: CardHolderNameComponent,
cardConsentComponent: CardConsentComponent,
cardOnFileComponent: CardOnFileComponent,
clickOnceStandaloneComponent: ClickOnceStandaloneComponent,
useCardOnFile: boolean,
avsRequest: boolean,
billingAddressComponents: {
countrySelectionComponent: CountrySelectionComponent,
postcodeComponent: PostcodeComponent,
addressComponent: AddressComponent,
billingAddressComponent: BillingAddressComponent
},
tabIndex: number,
submitAriaLabel: string,
onPreTokenization: () => boolean,
onPostTokenization: (result) => console.log(result),
onClick: (event: Event) => void,
onChange: (state: ComponentState) => void,
onValidation: (data: ValidationResult[]) => void,
onPreInitiateAuthentication: () => PreInitiateIntegratedAuthenticationData | null | undefined,
onPostInitiateAuthentication: (data: AuthenticationResult) => void,
onPreAuthentication: (data: PreInitiateSuccessAuthenticationResult) => Promise<InitiateIntegratedAuthenticationData>,
onPostAuthentication: (data: AuthenticationResult, challengeResult?: ChallengeResponse | null) => void,
onPreAuthorization: (data: PreAuthorizationData | null) => Promise<TransactionInitiationData | null>,
onPostAuthorization: (submitResult: BaseSubmitResult) => void,
onGetFingerprintResult: () => Promise<string>,
onSubmitError: (error) => console.error(error)
onCollectStart: (data: any) => void,
onCollectEnd: (data: any) => void
};
const cardSubmit = pxpCheckoutSdk.create("card-submit");
Properties
Property | Description |
---|---|
submitText string | The text to display on the submit button. |
disableUntilValidated boolean | Whether to disable the submit button until all fields are validated. |
hideSubmitButton boolean | Whether to hide the submit button. |
container string | The name of the HTML element to render the component into. |
id string | The unique identifier for the component. |
class string | The CSS class name for the component. |
label string | The label text for the component. |
styles CardSubmitComponentStyles | Custom styles for the component. |
newCardComponent NewCardComponent | Component for a new card. See reference. |
cardNumberComponent CardNumberComponent | Component for the card number. See reference. |
cardExpiryDateComponent CardExpiryDate | Component for the card expiry date. See reference. |
cardCvcComponent CardCvcComponentt | Component for the CVC. See reference. |
cardHolderNameComponent CardHolderNameComponent | Component for the cardholder name. See reference. |
cardConsentComponent CardConsentComponent | Configuration details for the card consent component. |
cardOnFileComponent CardOnFileComponent | Configuration details for the card-on-file component for saved payment methods. |
clickOnceStandaloneComponent ClickOnceStandaloneComponent | Configuration for the click-once standalone component. |
useCardOnFile boolean | Whether to select the card-on-file method to initiate the transaction. If true , uses COF data. Iffalse , uses new card data. Defaults to false . |
avsRequest boolean | Whether to enable AVS checks. |
billingAddressComponents object | Configuration details for the billing address components. Allows you to integrate the pre-built billing address component with the card submit component. If you pass billingAddressComponents and avsRequest is set to true , that will send billing address data to the transaction.If you pass both the pre-built billingAddressComponent and the three standalone components, that will use pre-built billingAddressComponent 's data. |
billingAddressComponents.countrySelectionComponent CountrySelectionComponent | Component for country selection. |
billingAddressComponents.postcodeComponent PostcodeComponent | Component for postcode input. |
billingAddressComponents.addressComponent AddressComponent | Component for address input. |
billingAddressComponents.billingAddressComponent BillingAddressComponent | Configuration details for the billing address component. See reference. |
tabIndex number | The tab index of the component. |
submitAriaLabel string | The aria label for the submit button. |
Callbacks
Callback | Description |
---|---|
| Callback function executed before tokenisation. Allows you to decide whether or not to proceed with the tokenisation. |
| Callback function executed after tokenisation completes with the tokenisation result. |
| Callback function triggered when the submit button is clicked. |
| Callback function triggered when the component state changes. |
| Callback function triggered when validation occurs with validation results. |
| Callback function for pre-initiating an authentication. Return |
| Callback function executed after an authentication was pre-initiated.
Returns the result of the pre-initiated authentication: |
| Callback function for pre-authentication. Returns |
| Callback function executed post-authentication. Returns the result of the initiated authentication: |
| Callback function for pre-authorisation. Returns the result of the authentication. If you want to proceed with authorisation, returns |
| Callback function executed post-authorisation. Returns the authorisation result. |
| Callback function to retrieve fingerprint data for authentication. |
| Callback function triggered when an error occurs during submission. |
| Callback function triggered when the data collection begins. |
| Callback function triggered when the data collection ends. |
HTML container setup
<div id="card-submit-container"></div>
Example
import CardSubmitComponentConfig from "@pxpio/web-components-sdk/components/cardSubmitComponents/CardSubmitComponent";
const cardSubmitConfig: CardSubmitComponentConfig = {
submitText: "Pay Now",
disableUntilValidated: true,
avsRequest: true,
cardNumberComponent: cardNumber,
cardExpiryDateComponent: cardExpiry,
cardCvcComponent: cardCvc,
cardHolderNameComponent: cardHolderName,
onPostTokenization: (data: CardTokenizationResult) => void,
onSubmitError: (baseSdkException: BaseSdkException) => void,
};
const cardSubmit = pxpCheckoutSdk.create("card-submit");
Updated 15 days ago