Skip to main content

Authorize Styles Props

You can customize the Authorize Module to integrate better with your website's design style. For this, you can use the optional parameters style and labels when calling the window.authorizePaymentConfig function.

Main Page

You can customize the following properties in your main page:

Labels

PropertyTypeDescriptionDefault Value
widgetHeaderTitlestringThe title displayed in the header of the widget container.Manage Payment Methods
paymentMethodOptionsarrayAn array of tab labels for selecting payment methods.["Pay with saved card", "Pay with saved card"]

Styles

Prop NameDescription
widgetContainerThe main container or wrapper for the entire widget.
widgetHeaderThe header section of the widget, which includes the title.
widgetHeaderTitleThe text for the widget's header title.
tabsContainerThe container that holds the tab options for different payment methods.
tabItemIndividual tab items, such as "Pay with saved card" and "Pay with new card".

Each property above must receive an object as the value. This value can contain style and cssClass keys:

KeyTypeDescription
styleobjectAn object containing valid CSS styles that will be applied to the HTML element.
cssClassstringA class name to be added to the HTML element, allowing for custom styling via CSS.

Example Usage

The following code block exemplifies the use of this parameters in your function:

window.authorizePaymentConfig = {
// Required configurations
...
labels : {
widgetHeaderTitle: 'Manage Payment Method',
paymetMethodOptions: ['Page 1', 'Page 2']
},
styles: {
widgetContainer: {
style: {
"background-color":"green",
"color": "blue"
},
cssClass: "text-danger bg-light"
},
widgetHeader: {
style: {
display: "none"
},
cssClass: ""
}
}
}

Existing Payment Methods Page

Use the following properties to configure styles and labels for your existing payment methods page:

Labels

Prop NameTypeDescriptionDefault Value
loadingTextstringThe label text displayed while the API fetch is in progress.Loading
cardExpirystringThe label text for the card expiry date field.Valid Thru
cvvInputPlaceHolderstringThe placeholder text for the CVV input field.CVV
payButtonstringThe label text for the pay button.Pay Now
editIconTitlestringThe tooltip text displayed when hovering over the edit button.Edit
deleteIconTitlestringThe tooltip text displayed when hovering over the delete button.Delete

Styles

Prop NameDescription
widgetContainerThe main wrapper or container for the entire page widget.
loadingTextThe text displayed while the loader is active.
listContainerThe container for the list of saved cards.
listItemIndividual item representing a saved card in the list.
listSelectionRadioThe radio button for selecting a saved card from the list.
cardHolderNameThe name of the cardholder displayed on the card.
cardNumberThe number of the saved card.
cardExpiryThe expiry date of the saved card.
cvvInputThe text input field for entering the card's CVV code.
payButtonThe button labeled "Pay Now" to submit the payment.
editIconWrapperThe container for the edit icon.
editIconThe icon used for editing the card details.
deleteIconWrapperThe container for the delete icon.
deleteIconThe icon used for deleting a saved card.

Add New Card Page

Use the following properties to configure styles and labels, and also events for the add new card page:

Labels

Prop NameTypeDescriptionDefault Value
mandatoryFieldsCaptionstringThe label displayed at the top of the form, indicating mandatory fields.* Marks Fields are mandatory
cardInformationHeaderLabelstringThe label for the "Card Information" section of the form.Card Information
cardHolderNamestringThe label for the cardholder name input field.Card Holder Name
cardNumberstringThe label for the card number input field.Card Number
cardExpirationstringThe label for the card expiration date input field.Card Expiration
cvvstringThe label for the CVV input field.CVV
billingInformationHeaderLabelstringThe label for the "Billing Information" section of the form.Billing Information
countrystringThe label for the country selection input field.Country
statestringThe label for the state selection input field.State
address1stringThe label for the first address input field.Address 1
address2stringThe label for the second address input field.Address 2
citystringThe label for the city input field.City
zipCodestringThe label for the zip code input field.Zip Code
updateButtonstringThe label for the update button.Update
payButtonstringThe label for the pay button.Pay
validationMessagesobjectAllows you to override the default validation error messages, with a structure discussed in section 4(b).N/A

Styles

Prop NameDescription
mandatoryFieldsCaptionThe label at the top of the form indicating mandatory fields.
sectionHeaderThe header label for form sections like "Card Information" and "Billing Information".
labelThe labels for form inputs or dropdowns (e.g., Card Holder Name, CVV, etc.).
inputText input fields in the form (e.g., Card Holder Name, CVV, etc.).
dropdownDropdown fields in the form (e.g., Country, Card expiry dropdown, etc.).
validationMessagesThe text for validation error messages displayed during form submission.
payButtonThe label for the "Pay Now" button.
updateButtonThe label for the "Update" button.

Events

The add new card page allows you to add a callback event on completion to return the new added credit card information to you.

Available Callback EventsDescription
onCompleteTriggered when the process is complete, returning updated credit card information.

Full Code Example

The code block below presents a complete example with all available parameters for the window.authorizePaymentConfig function:

Example
window.authorizePaymentConfig =  {
authToken: 'byuY5QTlEM0UtM0QzQi00RjdELTlGREUtNDE2OUYxQUJFREQ1OjFiM2I1NzhiLWMwYTctNGI5OC1hNjEyLWU4YTA4ZWJjZTY0Ng==',
customerReference: "123545745454",
merchantId: "ACVX458KJGJLAS7878DSADS",
amount: 40,
merchantOrderId: "ISH-999",
currencyCode: "USD",

//Root or Main Page Styles and Labels
labels : {
widgetHeaderTitle: 'Manage Payment Method',
paymentMethodOptions: ['Pay with saved card', 'Pay with new card']
},
styles: {
widgetContainer: {
style: {
"background-color": "#f9f9f9",
"padding": "20px"
},
cssClass: "widget-container-class"
},
widgetHeaderTitle: {
cssClass: "header-title-class",
style: {
"font-size": "150%",
"font-style": "italic",
color: "teal",
},
},
tabsContainer: {
style: {
"border-bottom": "1px solid #ccc"
},
cssClass: "tabs-container-class"
},
tabItem: {
style: {
"padding": "10px",
"cursor": "pointer"
},
cssClass: "tab-item-class"
}
},

// Existing Payment Methods Page Config
existingPaymentMethodsPage: {
labels: {
loadingText: 'Loading...',
cardExpiry: 'Valid Thru',
cvvInputPlaceHolder: 'CVV',
payButton: 'Pay Now',
editIconTitle: 'Edit',
deleteIconTitle: 'Delete'
},
styles: {
listContainer: {
style: {
"margin-top": "20px"
},
cssClass: "list-container-class"
},
listItem: {
style: {
"padding": "15px",
"border-bottom": "1px solid #ddd"
},
cssClass: "list-item-class"
},
cvvInput: {
style: {
"width": "100px"
},
cssClass: "cvv-input-class"
},
payButton: {
style: {
"background-color": "#28a745",
"color": "#fff",
"border": "none",
"padding": "10px 20px",
"cursor": "pointer",
"border-radius": "4px"
},
cssClass: "pay-button-class"
}
}
},

//Add New Card Page Config
addNewCardPage: {
uiConfig: {
showCardImage: false,
showBillingInfo: true
},
labels: {
cardInformationHeaderLabel: 'Card Information',
billingInformationHeaderLabel: 'Billing Information',
cardHolderName: 'Card Holder Name',
cardNumber: 'Card Number',
cardExpiration: 'Card Expiration',
cvv: 'CVV',
country: 'Country',
state: 'State',
address1: 'Address 1',
address2: 'Address 2',
city: 'City',
zipCode: 'Zip Code',
updateButton: 'Update',
payButton: 'Pay Now'
},
styles: {
input: {
style: {
'border': "2px dashed cyan",
'padding': "10px",
'border-radius': "4px"
},
cssClass: "input-class"
},
sectionHeader: {
cssClass: "section-header-class",
style: {
color: 'purple',
'font-weight': 'bold'
}
},
validationFailedMessage: {
style: {
'color': 'red',
'font-size': '14px'
},
cssClass: "validation-message-class"
}
},
validationMessages: {
cardHolderName: "Card Holder Name is required",
cardNumber: "Invalid Card Number",
cardExpiration: "Card Expiration Date is required",
cvv: "CVV is required",
country: "Country is required",
address1: "Address 1 is required",
city: "City is required",
zipCode: "Invalid Zip Code"
},
events: {
onComplete: function(cardDetails) {
console.log("Card details submitted: ", cardDetails);
}
}
}
}