PayPal Integration Within MULE ESB
Want to get PayPal up and running with MULE ESB? Look no further. This quick tutorial guides you through the steps.
Join the DZone community and get the full member experience.
Join For FreePayPal Anypoint Connector helps integrate and PayPal within MULE. I have developed the sample program that connects to a PayPal account to do the -getbalance operation.
Used in this tutorial:
MULE ESB 3.8
Anypoint Studio 6.0
PayPal Connector (Mule 3.7.0 +)
Step 1: Install the paypal connector in the anypoint studio and restart the studio to reflect the chagnes.
Step 2: Use the HTTP listener to post the request to the PayPal API.
<http:listener config-ref="HTTP_Listener_Configuration" path="/getbalance" doc:name="HTTP"/>
Here's the listener config ref:
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8081" doc:name="HTTP Listener Configuration"/>
Step 3: Drag and drop the PayPal connector and configure the PayPal connection details.
Created a sandbox account in PayPal and gather the API details (username, password, signature, appID, etc.)
You'll need the following details to configure PayPal:
Username.
Password.
ServiceAddress.
Signature.
AppId.
Here's the PayPal config:
<paypal:config name="PayPal" username="" password="" serviceAddress="" signature="" appId="" doc:name="PayPal Connector: configuration (Signature)"/>
And the PayPal connector entry:
<paypal:get-balance config-ref="PayPal" doc:name="PayPal"/>
Flow pic and XML:
<http:listener-config name="HTTP_Listener_Configuration" host="localhost" port="8081" doc:name="HTTP Listener Configuration"/>
<paypal:config name="PayPal" username="" password="" serviceAddress="" signature="" appId="" doc:name="PayPal Connector: configuration (Signature)"/>
<flow name="httpexampleFlow1">
<http:listener config-ref="HTTP_Listener_Configuration" path="/getbalance" doc:name="HTTP"/>
<paypal:get-balance config-ref="PayPal" doc:name="PayPal"/>
</flow>
Run the Mule project in Anypoint Studio and access the URL for getbalance.
Opinions expressed by DZone contributors are their own.
Comments