Skip to content

Instantly share code, notes, and snippets.

View dhonig's full-sized avatar

Daniel Honig dhonig

View GitHub Profile
@dhonig
dhonig / XML UPS output
Created February 20, 2012 02:09
XML Output that results in error
<?xml version="1.0"?>
<RatingServiceSelectionResponse>
<Response>
<ResponseStatusCode>1</ResponseStatusCode>
<ResponseStatusDescription>Success</ResponseStatusDescription>
</Response>
<RatedShipment>
<Service>
<Code>03</Code>
</Service>
@dhonig
dhonig / gist:1867270
Created February 20, 2012 02:14
Stacktrace
activesupport (3.1.3) lib/active_support/xml_mini/rexml.rb:36:in `parse'
org/jruby/RubyKernel.java:2078:in `send'
activesupport (3.1.3) lib/active_support/xml_mini.rb:79:in `parse'
activesupport (3.1.3) lib/active_support/core_ext/hash/conversions.rb:90:in `from_xml'
/home/daniel/.rvm/gems/jruby-1.6.6@burrito/bundler/gems/spree_active_shipping-e53dba0632dc/lib/spree/active_shipping/ups_override.rb:266:in `parse_rate_response'
/home/daniel/.rvm/gems/jruby-1.6.6@burrito/bundler/gems/spree_active_shipping-e53dba0632dc/lib/spree/active_shipping/ups_override.rb:198:in `find_rates'
/home/daniel/.rvm/gems/jruby-1.6.6@burrito/bundler/gems/spree_active_shipping-e53dba0632dc/app/models/spree/calculator/active_shipping/base.rb:69:in `retrieve_rates'
/home/daniel/.rvm/gems/jruby-1.6.6@burrito/bundler/gems/spree_active_shipping-e53dba0632dc/app/models/spree/calculator/active_shipping/base.rb:34:in `compute'
activesupport (3.1.3) lib/active_support/cache.rb:297:in `fetch'
activesupport (3.1.3) lib/active_support/cache.rb:5
@dhonig
dhonig / checkout controller
Created March 4, 2012 22:49
checkout controller
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
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?
<?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>
<repository>
<id>muleforge-releases</id>
<name>MuleForge Snapshot Repository</name>
<url>https://repository.mulesoft.org/releases/</url>
<layout>default</layout>
</repository>
<repository>
<id>mulesoft-snapshots</id>
<name>MuleSoft Snapshot Repository</name>
<url>https://repository.mulesoft.org/snapshots/</url>
<layout>default</layout>
</repository>
@dhonig
dhonig / test_ruby_sugar.rb
Created June 4, 2012 19:26
Example of ruby contact creation
## 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
@dhonig
dhonig / franklinmint-mule.xml
Created June 4, 2012 22:31
endpoint configuration example
<?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"
@dhonig
dhonig / sample_post.xml
Created June 5, 2012 16:48
Working soap post from VB.net
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">