configure()
This method should be called only once for the page load. After calling this method, the SDK will provide configuration values as member variables.
If not provided, apiVersion is defaulted to 60.Usage
GatewayPaypal.configure(config, errorCallback, completeCallback, cancelCallback)
Example
function errorCallback(error) { };
function completeCallback(response) { };function cancelCallback(response) { };
GatewayPaypal.configure({ merchantId: "TESTMERCHANT", sessionId: "SESSION0002899787259G30902270H6", orderId: "1234567890", transactionId: "Trans12345", currency: "USD", paymentConfirmation: "CONFIRM_AT_PROVIDER", operation: "PAY", apiVersion: 60, buttonElement: "PayPalButton", style: { color: 'blue', shape: 'rect', label: 'paypal', tagline: 'true' } }, errorCallback, completeCallback, cancelCallback );
Arguments
Configuration values
merchantId String COMPULSORY
sessionId String COMPULSORY
orderId String COMPULSORY
transactionId String COMPULSORY
currency String COMPULSORY
paymentConfirmation String
Set this to CONFIRM_AT_PROVIDER if you want the payer to commit to the payment on the PayPal website.
Set this to CONFIRM_AT_MERCHANT if you want the payer to commit to the payment on your website.
operation String COMPULSORY
For a successful Authorization transaction, you must submit a CAPTURE request to move the funds from the payer's account to your account.
AUTHORIZE - The transaction created in the gateway is an AUTHORIZATION transaction.
PAY - The transaction created in the gateway is a PAYMENT transaction.
apiVersion Number
You must use version 60 or above.
If not provided, the value is defaulted to 60.
buttonElement String COMPULSORY
style Object Optional
color String OPTIONAL
Color options for the PayPal Smart Button. One of "gold" (Recommended by PayPal), "blue", "silver", "white", "black".
If not provided, the value is defaulted to "gold".
shape String COMPULSORY
Shape options for the PayPal Smart Button. One of "rect" (Default), "pill".
If not provided, the value is defaulted to "rect".
size Number COMPULSORY
Size of the PayPal Smart Button. If not provided, the value is defaulted to the size of its container element.
- To customize the button width, alter the width of the container
element.
- To customize the button height, set the height option to a value from 25
to 55.
label String COMPULSORY
Label options for the button. One of "paypal" (Default), "checkout", "buynow", "pay".
If not provided, the value is defaulted to "paypal".
tagline String COMPULSORY
Option to display tagline. One of "true" (Default), "false".
If not provided, the value is defaulted to "true".
message String OPTIONAL
response Object OPTIONAL
response Object OPTIONAL
response Object OPTIONAL
Return Value
None