TYPESCRIPT
async provide(props: ComponentWithRedirectManagerProps): Promise<BanksComponent | any>
Parameters
Hide Parameters
Hide Parameters
ComponentWithRedirectManagerProps
required
Object that provides the payment menthod type and callback functions for
handling steps, errors and validation.
Hide Properties
Hide Properties
string
required
A unique string identifier for the payment method. Supported payment methods for current client session are returned in
onAvailablePaymentMethodLoad callback.Called whenever the component emits a new step. This usually happens when calling start or submit or whenever the component collects data.
Show Parameters
Show Parameters
A type representing the loading of the bank list.
Show Properties
Show Properties
banksLoading
The name of this component step.
A type representing the list of retrieved banks.
Show Properties
Show Properties
(error: PrimerError) => void
Called to indicate that a PrimerError occurred during the componentβs operation.
Show Parameters
Show Parameters
The specific
PrimerError that occurred during the componentβs operation.Called to indicate that the component data was considered invalid during validation.
xx
Show Parameters
Show Parameters
Interface that indicates that the data has been considered invalid after validation.
Show Properties
Show Properties
Called to indicate that the component data was successfully validated.
Show Parameters
Show Parameters
Interface that indicates that the data has been successfully validated.
Called to indicate that the component data is in the process of being validated.
Show Parameters
Show Parameters
Interface that indicates that data is currently in the process of being validated.
Called to indicated an error that occurred during component data validation.
Show Parameters
Show Parameters
Interface that represents an error that occurred during the validation process.
Show Properties
Show Properties
The data for which an error ocurred during validation.
PrimerError
The
PrimerError that ocurred during the validation attempt.Supported payment method types
Hide Supported payment method types
Hide Supported payment method types
| Type | paymentMethodType |
|---|---|
| BanksComponent | ADYEN_IDEAL |
Returns
An instance of a component, depending on thepaymentMethodType:
Hide Common API and available components
Hide Common API and available components
Hide Common API
Hide Common API
Hide Supported types
Hide Supported types
Show API
Show API
Update component with the selected bank id.To validate the collected data, you can refer to the appropriate
ComponentWithRedirectManagerProps
callback functions.
Update component with the given bank filter. Doing so will cause a call to onStep with the filtered bank list.To validate the collected data, you can refer to the appropriate
ComponentWithRedirectManagerProps
callback functions.
Example
TYPESCRIPT
// π Add this
const componentWithRedirectManagerProps: ComponentWithRedirectManagerProps = {
paymentMethodType: "ADYEN_IDEAL",
onStep: (data: BanksStep) => {
switch (data.stepName) {
case "banksLoading":
// Show loading indicator
break;
case "banksRetrieved":
// Render banks
break;
}
},
onError: (error: PrimerError) => {
// An error that occurred during the component's operation.
},
onInvalid: (data: PrimerInvalidComponentData<BanksValidatableData>) => {
// Data was considered invalid during validation.
switch (data.data.validatableDataName) {
case "bankListFilter":
// ...
break;
case "bankId":
// ...
break;
}
},
onValid: (data: PrimerValidComponentData<BanksValidatableData>) => {
// Data was successfully validated.
switch (data.data.validatableDataName) {
case "bankListFilter":
// ...
break;
case "bankId":
// ...
break;
}
},
onValidating: (data: PrimerValidatingComponentData<BanksValidatableData>) => {
// Data is in the process of being validated.
switch (data.data.validatableDataName) {
case "bankListFilter":
// ...
break;
case "bankId":
// ...
break;
}
},
onValidationError: (
data: PrimerComponentDataValidationError<BanksValidatableData>
) => {
// Error occurred during data validation.
switch (data.data.validatableDataName) {
case "bankListFilter":
// ...
break;
case "bankId":
// ...
break;
}
},
};
const componentWithRedirectManager = new ComponentWithRedirectManager();
const banksComponent: BanksComponent =
await componentWithRedirectManager.provide(componentWithRedirectManagerProps);