Skip to content

Instantly share code, notes, and snippets.

View rkruze's full-sized avatar

Roko rkruze

View GitHub Profile
@rkruze
rkruze / salesforce_database_flow_3.xml
Created May 10, 2011 17:10
SalesForce to Database Main Flow (Part 3)
<spring:bean id="jdbcDataSource" class="org.enhydra.jdbc.standard.StandardDataSource" destroy-method="shutdown">
<spring:property name="driverName" value="com.mysql.jdbc.Driver"/>
<spring:property name="url" value="jdbc:mysql://localhost/salesforce?user=root"/>
</spring:bean>
<jdbc:connector name="jdbcConnector" dataSource-ref="jdbcDataSource">
<jdbc:query key="insertAccount"
value="INSERT INTO accounts (id, name, phone)
VALUES(#[map-payload:Id], #[map-payload:Name], #[map-payload:Phone])
ON DUPLICATE KEY UPDATE name = VALUES(name), phone = VALUES(phone)"/>
@rkruze
rkruze / salesforce_database_flow_2.xml
Created May 10, 2011 16:56
SalesForce to Database Main Flow (Part 2)
<flow name="main">
<poll frequency="300000">
<salesforce:get-updated type="Account" duration="10"/>
</poll>
<splitter evaluator="ognl" expression="ids"/>
...
</flow>
@rkruze
rkruze / salesforce_database_flow.xml
Created May 10, 2011 16:30
SalesForce to Database Main Flow (Part 1)
<flow name="main">
<poll frequency="300000">
<salesforce:get-updated type="Account" duration="10"/>
</poll>
...
</flow>
@rkruze
rkruze / salesforce_database.xml
Created May 10, 2011 07:35
Setting up the Database for SalesForce
<spring:bean id="jdbcDataSource" class="org.enhydra.jdbc.standard.StandardDataSource" destroy-method="shutdown">
<spring:property name="driverName" value="com.mysql.jdbc.Driver"/>
<spring:property name="url" value="jdbc:mysql://localhost/salesforce?user=root"/>
</spring:bean>
<jdbc:connector name="jdbcConnector" dataSource-ref="jdbcDataSource">
<jdbc:query key="insertAccount"
value="INSERT INTO accounts (id, name, phone)
VALUES(#[map-payload:Id], #[map-payload:Name], #[map-payload:Phone])
ON DUPLICATE KEY UPDATE name = VALUES(name), phone = VALUES(phone)"/>
<flow name="paymentFlow">
<ajax:inbound-endpoint channel="/payment"/>
<!-- The rest of the flow -->
</flow>
<ajax:connector name="paymentServer" serverUrl="https://0.0.0.0:8082/services/checkout"
resourceBase="${app.home}/docroot">
<!-- You can create this keystore using the keytool that comes with Java using a command like:
keytool -genkey -alias mule -keyalg RSA -keystore <path to keystore> -->
<ajax:key-store path="<key store location>"
storePassword="${ssl.password}" keyPassword="${ssl.password}"/>
</ajax:connector>
<authorize:config name="auth" merchantLogin="${auth.merchantLogin}"
merchantTransactionKey="${auth.merchantTransactionkey}"
@rkruze
rkruze / Mule Store Part 1.xml
Created April 19, 2011 22:54
Part 1 of the Mule Store Example
<flow name="paymentFlow">
<ajax:inbound-endpoint channel="/payment"/>
<enricher>
<authorize:authorization-and-capture amount="#[map-payload:amount]" cardNumber="#[map-payload:cardnumber]"
expDate="#[map-payload:cardexpire]"/>
<enrich target="#[variable:PaymentSuccess]" source="#[bean:responseCode]"/>
<enrich target="#[variable:ErrorCode]" source="#[bean:responseReasonText]"/>
</enricher>
@rkruze
rkruze / authorizenet-payment-example.xml
Created January 25, 2011 03:25
Example of payment made with Authorize.Net
<auth:config merchantLogin="<YOUR MERCHANT LOGIN>"
merchantTransactionKey="<YOUR MERCHANT TRANSACTION KEY>"
name="auth" testMode="true"/>
<flow name="payment">
<auth:authorization-and-capture cardNumber="370000000000002"
expDate="12/12" amount="400"/>
</flow>
@rkruze
rkruze / mule-payment-example.xml
Created January 25, 2011 00:29
Authorize.Net and SalesForce Example
<enricher>
<authorize:authorization-and-capture amount="#[map-payload:amount]" cardNumber="#[map-payload:cardnumber]"
expDate="#[map-payload:cardexpire]"/>
<enrich target="#[variable:PaymentSuccess]" source="#[bean:responseCode]"/>
<enrich target="#[variable:ErrorCode]" source="#[bean:responseReasonText]"/>
</enricher>
<async>
<choice>