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

Modernize your application architectures with microservices and APIs with best practices from this free virtual summit series. Brought to you in partnership with CA Technologies.

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.

The Integration Zone is proudly sponsored by CA Technologies. Learn from expert microservices and API presentations at the Modernizing Application Architectures Virtual Summit Series.

Topics:
mule ,paypal ,integration

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

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

{{ parent.tldr }}

{{ parent.urlSource.name }}