Configuring the Drop In UI
To create a drop-in UI:
window.addEventListener('load', function () {
payfurl.init('sandbox', '<public key>')
.addDropIn('<container id>', '<amount>', '<3-letter currency code>', 'options');
});
options
is an object that can contain the following properties:
paypalEnablePayIn4
: enable Paypal Pay in 4 (can betrue
orfalse
)paypalButtonStyle
: modify the PayPal buttons to change the color of the button (can begold
,blue
,silver
,white
,black
)cardProviderId
: use a specific card provider IdpaypalProviderId
: use a specific PayPal provider IdpayToProviderId
: use a specific payTo provider IdthreeDSEmail
: email address to use for 3DS authenticationpayToMaximumAmount
: maximum amount parameter for PayTo payment methodpayToDescription
: description parameter for PayTo payment methodredirectUrl
: use to redirect to merchant web siteupiOptions
: options for UPI payment methoddocumentId
: document id for UPI payment methodname
: a customer name for UPI payment methodemail
: a customer email for UPI payment methodsubscriptionFrequencyUnit
: a frequency unit for UPI payment method (can beONDEMAND
,DAILY
,WEEKLY
,MONTHLY
,YEARLY
)subscriptionFrequency
: a frequency for UPI payment method (a number)subscriptionStartAt
: a start date for a subscription (in formatyyyyMMdd
)subscriptionEndAt
: a end date for a subscription (in formatyyyyMMdd
)
googlePayOptions
: options for Google Pay payment methodproviderId
: use a specific Google Pay provider Idgateway
: the payment gateway to use for Google Pay (if you want to override the gateway used by the provider)googlePayGatewayMerchantId
: the Google Pay gateway merchant ID (if you want to override the googlePayGatewayMerchantId used by the provider)googlePayMerchantId
: the Google Pay merchant ID (if you want to override the googlePayMerchantId used by the provider)googlePayMerchantName
: the Google Pay merchant name (if you want to override the googlePayMerchantName used by the provider)
applePayOptions
: options for Apple Pay payment methodproviderId
: use a specific Apple Pay provider IdproviderType
: type of the Apple Pay provider for the given providerIdlineItemLabel
: label for the line item in Apple PaymerchantIdentifier
: merchant identifier for Apple PaydomainName
: domain name for Apple PaydisplayName
: display name for Apple PayclientParameters
: additional client parameters for Apple Pay (optional, can be used to pass custom data to the provider)
clickToPayEnabled
: enable Click to Pay (can betrue
orfalse
)clickToPayOptions
: options for Click to Pay payment methoddpaId
: the DPA ID for Click to Pay (if you want to use a specific DPA)dpaName
: the DPA name for Click to Pay (optional)useFpan
: use FPAN (real card numbers instead of network tokens) for Click to Pay (can betrue
orfalse
)cardBrands
: an array of card brands to use for Click to Pay (optional, can be used to limit the card brands available)dpaBillingPreference
: billing preference for Click to Pay (can beNONE
,FULL
, orPOSTAL_COUNTRY
)confirmPayment
: confirm payment after the card is added (can betrue
orfalse
)locale
: locale for Click to Pay (default isen_AU
)savedCardsOptions
: options for saved cardsalign
: alignment of the saved cards block (can beleft
orcenter
)
saveCard
: save card details (can betrue
orfalse
, default istrue
)tokenAuthenticationEnabled
: enable token authentication for Click to Pay (can betrue
orfalse
)networkTokenOptions
: options for network token creationacquirerMerchantId
: acquirer merchant ID for network tokenacquirerBIN
: acquirer BIN for network tokenmerchantCategoryCode
: merchant category code for network tokenauthenticationReasons
: an array of authentication reasons for network token (optional, can be used to pass custom data to the provider)
cardFormStyle
: style for the card form (can bedefault
,compact
)tokenAuthenticationEnabled
: enable token authentication (can betrue
orfalse
)createNetworkToken
: enable network token creation (can betrue
orfalse
)networkTokenOptions
: options for network token creationacquirerMerchantId
: acquirer merchant ID for network tokenacquirerBIN
: acquirer BIN for network tokenmerchantCategoryCode
: merchant category code for network tokenauthenticationReasons
: an array of authentication reasons for network token (optional, can be used to pass custom data to the provider)
vault
: force store card details in the vault (can betrue
orfalse
as default)verifyCard
: enable card verification (can betrue
orfalse
as default), which will check the card, expiry date and CCV are valid with the provider. Not all providers support this.allowedPaymentTypes
: an array of allowed payment types (can be['card', 'paypal', 'applepay', 'googlepay', 'upi', 'payto', 'payid', 'shift', 'pesapal', 'paybyaccount', 'payglocal', 'zip']
).metadata
: additional metadata to send with the payment request (optional)