Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

PayPal Integration Within MULE ESB

DZone's Guide to

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.

· Integration Zone
Free Resource

The Integration Zone is brought to you in partnership with Cloud Elements. What's below the surface of an API integration? Download The Definitive Guide to API Integrations to start building an API strategy.

PayPal 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:

Image title


<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.

Your API is not enough. Learn why (and how) leading SaaS providers are turning their products into platforms with API integration in the ebook, Build Platforms, Not Products from Cloud Elements.

Topics:
mule ,paypal ,integration

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}