This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Mule Sugar CRM Connector | |
* | |
* Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com | |
* | |
* The software in this package is published under the terms of the CPAL v1.0 | |
* license, a copy of which has been included with this distribution in the | |
* LICENSE.txt file. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*/ | |
public String login() { | |
UserAuth userAuth = new UserAuth(); | |
userAuth.setUserName(username); | |
userAuth.setPassword(password); | |
try { | |
EntryValue loginRes = wsClient.login(userAuth, Class.class.getName(), new NameValueList()); | |
return loginRes.getId(); | |
} catch (Exception e) { | |
throw new RuntimeException(e.getMessage()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST /sugarcrm/soap.php | |
HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.5456) | |
VsDebuggerCausalityData: uIDPo2z1cKrlF5pJgK/hqZ7Gtv8AAAAAVPDNsbnt0Umeut+DYp/UoFUOSsvuQ/hKsPvZ9JOBHKsACQAA | |
Content-Type: text/xml; charset=utf-8 SOAPAction: "http://209.61.142.162/sugarcrm/soap.php/set_entry" | |
Host: tfmmanit01:2020 Content-Length: 3990 Expect: 100-continue | |
<?xml version="1.0" encoding="utf-8"?> | |
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" | |
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://www.sugarcrm.com/sugarcrm" | |
xmlns:types="http://www.sugarcrm.com/sugarcrm/encodedTypes" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:file="http://www.mulesoft.org/schema/mule/file" | |
xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:https="http://www.mulesoft.org/schema/mule/https" | |
xmlns:jdbc="http://www.mulesoft.org/schema/mule/jdbc" xmlns:jms="http://www.mulesoft.org/schema/mule/jms" | |
xmlns:vm="http://www.mulesoft.org/schema/mule/vm" xmlns:client="http://www.mulesoft.org/schema/mule/client" | |
xmlns:cxf="http://www.mulesoft.org/schema/mule/cxf" | |
xmlns:management="http://www.mulesoft.org/schema/mule/management" | |
xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting" | |
xmlns:sxc="http://www.mulesoft.org/schema/mule/sxc" xmlns:xm="http://www.mulesoft.org/schema/mule/xml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Delete an Account | |
a = SugarCRM::Account.find_by_name("gganebnyi6@nebulent.com") | |
c = SugarCRM::Contact.new | |
c.first_name='John' | |
c.last_name = 'Doe' | |
c.description='Contact entered from Ruby Code' | |
c.team_name ="John Doe" | |
c.team_count="2" | |
a.contacts << c | |
a.save # or a.contacts.save |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<repository> | |
<id>mulesoft-snapshots</id> | |
<name>MuleSoft Snapshot Repository</name> | |
<url>https://repository.mulesoft.org/snapshots/</url> | |
<layout>default</layout> | |
</repository> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<repository> | |
<id>muleforge-releases</id> | |
<name>MuleForge Snapshot Repository</name> | |
<url>https://repository.mulesoft.org/releases/</url> | |
<layout>default</layout> | |
</repository> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<UDOAResponse> | |
<Success>0</Success> | |
<UDOARequest version="2.00"> | |
<UDIParameter> | |
<Parameter key="HTTPBizID">TestHTTPBizID0123456789</Parameter> | |
<Parameter key="UDIAuthToken"/> | |
<Parameter key="Keycode">JTESTKEY</Parameter> | |
<Parameter key="VerifyFlag">False</Parameter> | |
<Parameter key="QueueFlag">False</Parameter> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Spree::Order.class_eval do | |
# order state machine (see http://github.com/pluginaweek/state_machine/tree/master for details) | |
Spree::Order.state_machines[:state] = StateMachine::Machine.new(Spree::Order, :initial => 'cart') do | |
event :next do | |
transition :from => 'cart', :to => 'checkout_method' | |
transition :from => 'checkout_method', :to => 'shipping_address' | |
transition :from => 'shipping_address', :to => 'delivery' | |
transition :from => 'delivery', :to => 'payment', :if => :payment_required? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
include ActiveMerchant::Shipping | |
Spree::CheckoutController.class_eval do | |
#we do not have accounts in phase one | |
#instead the checkout_method screen and state has been added and we will simply force the user to enter an e_mail | |
# address. therefore we will not take advantage of the :check_registration filter. | |
skip_before_filter :check_registration | |
def load_order | |
@order = current_order |