This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
PayPal Connector
The PayPal connector allows you to access the API for PayPal, an international e-Commerce business allowing payments and money transfers to be made through the Internet. Online money transfers serve as electronic alternatives to paying with traditional paper methods, such as checks and money orders. The PayPal connector uses the PayPal REST API to perform operations through PayPal, such as making payments and looking up authorizations.
Additional information
For general information on using connectors and their operations in your ESB configurations, see Using a Connector. To download the connector, go to https://store.wso2.com/store/assets/esbconnector/details/paypal, and click Download Connector. Then you can add and enable the connector in your ESB instance.
Connecting to PayPal
<paypal.init> <apiUrl>https://api.sandbox.paypal.com</apiUrl> <accessToken>uT2s1nXTr1zFP6vwtGu30VE.BpdTPok59UAeM245mUI</accessToken> </paypal.init>
With each PayPal API call, you will need to set up your request headers, including an OAuth 2.0 access token. You get an access token by using the OAuth 2.0 client_credentials token grant type with your clientId:secret
as your Basic Auth credentials and all the other properties and attributes that are necessary to make the PayPal connector function. The connector includes a check to verify the value of the API URL, and if it is null, it gets set to
https://api.paypal.com
by default.
Properties
apiUrl
: Optional - URL of the PayPal API. This is an optional parameter with a default value ofhttps://api.paypal.com
accessToken
: Required - The access token allows you to make requests to the API on behalf of a user.
Entering secure data
For security purposes, you should store your accessToken in the WSO2 secure vault and reference it by alias instead of hard-coding the actual values in the configuration file. For more information, see Working with Passwords.
Re-using PayPal configurations
For best results, save the PayPal configuration as a local entry. You can then easily reference it with the configKey
attribute in your PayPal operations. For example, if you saved the above <paypal.init>
entry as a local entry named PayPalConfig, you could reference it from an operation like createPayment
as follows:
<paypal.createPayment configKey="PayPalConfig" />
Performing operations on PayPal
The following sections describe how to perform various operations with the connector. For general information on using connectors and their operations in your ESB configurations, see Using a Connector. To download the connector, go to https://store.wso2.com/store/assets/esbconnector/paypal, and click Download Connector. Then you can add and enable the connector in your ESB instance.