New website launched! Yayyy!!

Surplus chemical raw materials take up space, lock up capital and cost a bomb to dispose properly.

Offstock.com – an integrated solution that utilizes the both the Internet and a trained sales and logistics team – to help you buy or sell surplus. Let’s save our mother earth!

offstock b2b ecommerce platform for chemical products

none

Guys, Rails 3.0 is now at the stage of beta release. Why not consider update your self with state-of-the-art technology? Below is the handbook that we think it will be very useful to you! Let’s check it out !!

Inside you’ll find:

  • Almost 120 pages of upgrade information
  • A step-by-step guide to upgrading your app to Rails 3
  • High-level discussion of what’s new in Rails 3
  • Practical tips on using Rails 3′s new features to improve your code
  • Real case studies of upgrading apps and plugins
  • Detailed checklists for upgrading
none

There are always needs to build E-commerce sites with Credit Card transactions securely and seamlessly. In Singapore market, eNETs is the most well-known company providing payment gateway services. Up to now, eNETS only provide API for .NET and Java platform. In this post, I will show you my solution to integrate eNETS and Ruby on Rails via Java.

Steps:

1. Build JAR file to submit payment info to eNETS, i named it enets.jar. This jar file will return output from eNETS to console in text format. I attached sample program built with NetBean, you can download it here: eNETS. After downloading, you just copy that folder to your NetBean projects folder as shown in below image.

NetBean projects folder

NetBean Projects Folder

2. Follow eNETS guideline, change setting for java security as well as generate merchant.priv.pgp.asc, merchant.pub.pgp.asc.

3. Change config: log4j.properties, NETSConfig.xml

4. Build enets.jar file from source files in NetBean. Right click on project root, Clean and Build.

5. Generate command to execute enets.jar, something like this:

“java -jar #{RAILS_ROOT}/vendor/extensions/payment_gateway/lib/enets/eNETS.jar #{mid} #{tid} #{paymentMode} #{amt} #{currency} #{merRef} #{submitMode} #{merCertId} #{pan} #{expiry} #{stan} #{paymentType} #{successURL} #{successURLParams} #{failureURL} #{failureURLParams} #{notify_url} #{notify_url_params} #{name} #{cvv} #{post_url} #{post_url_params} #{cancel_url} #{cancel_url_params} #{bill_first_name} #{bill_last_name} #{bill_initial} #{bill_addr1} #{bill_addr2} #{bill_coy_name} #{bill_city} #{bill_state} #{bill_zip_code} #{bill_country} #{bill_mobile_num} #{bill_phone_num} #{bill_fax_num} #{bill_email} #{ship_first_name} #{ship_last_name} #{ship_initial} #{ship_addr1} #{ship_addr2} #{ship_coy_name} #{ship_city} #{ship_state} #{ship_zip_code} #{ship_country} #{ship_mobile_num} #{ship_phone_num} #{ship_fax_num} #{ship_email} #{shopper_ip_addr} #{product_format} #{product_details} #{gw_url}”

6. Run enets.jar from ruby console with output = %x[#{command}]. %x[] command will store output to output variable for later processing. It is not the same as system() or exec() ruby command. Read more on Jay Fields’ blog:  Ruby Kernel system, exec and %x

7. Parse results returned from enets.jar and continue with your business logic in your ruby/rails application. For rails project, i recommend you to use Active-Merchant and modify Bogus payment gateway so that you will follow format of ActiveMerchant framework. You will be supprised because the effort required  is very little.

What are your solutions to integrate with eNETS from Rails project? I would like to know if you have better solutions. Thank you.

none
Some benefits compare to RDBMS (MySQL, Postgres, Oracle …) I come up
with after few months using MongoDB and Neo4J.* No model caching thanks to high performance
* No join thanks to embedded docs or graph DB
* Data-to-object matching is dead simple thanks to no-join and document-oriented
* No SQL injection attack
* No DB migration thanks to schemaless
* Scale horizontally
* Social computation made easy with graph DB
* No DB roll-up thanks to high volume and cap-collection

Q: How do I do data query & tabulation without SQL?
A: I do data query via MongoDB indexing & JSON query syntax and do
data tabulation via Map-Reduce.

none
You also program in Ruby, right? Three languages! Can you contrast the 3 languages Scala, Clojure and Ruby?
That’s a very interesting thing to think about, because Clojure and Ruby have sort of a similar feel in the sense that they are both more dynamically typed than statically typed. Clojure has an interesting relationship with Java, obviously, because it lets you use Java objects, but it doesn’t have type annotations all over the place, like you would have in Java or Scala. I think this general debate of static versus dynamic typing is kind of pointless in some sense, meaning that a lot of times it’s the application that really should dictate what’s best.If you are building something like a typical website that may need a lot of iterations very quickly and there is an informal model of the domain, then maybe it’s not so important to have the formalism of type theory. But, on the other hand, if you are building something that you wanted to behave in a mathematically precise way, then it’s great to have it. They type system of statically language that bakes in the almost provably correct behavior, at the fundamental building blocks. For example, if I’m building a financial application that manages money in some sense, I’d be more likely to want a statically typed language like Scala where I can very precisely specify the behavior of money.

Then, build my account objects and so forth on top of that, knowing that they will be robust at this very fundamental level. But, if I’m building a website, where users may be specifying withdrawals and transfers, I don’t necessarily care about that kind of type safety at that level. I would like to have the dynamism, the productivity that I get from a language like Ruby, so I’d be more likely to use Ruby on that part of the application. I could very easily see JRuby with Rails running the website and Scala or Clojure business to your code that’s handling preciseness of getting money transactions right.

JVM seem to be a place programming languages converge.

jRuby on Rails running web apps + Scala / Clojure / Java handling money transactions and other high reliability, high performance stuffs is very compelling.

none

Mike, Nguyen Dinh Hai,  has provided excellent support to Singapore Safety Driving Centre Ltd as our contract vendor programmer.

Some of the projects he had completed for us:

  1. Recovery of data when our database server failed in 2008
  2. Upgraded two of our servers in 2008 & 2009.
  3. Upgraded request changes in program functions according to our specifications
  4. Wrote a program and implemented wireless loading and updating of student’s progress
  5. Using the IPOD touch.
  6. Maintenance of SSDC website (www.ssdcl.com.sg)

He has shown great abilities and knowledge to get things done in the most challenging and
difficult period even at odd hours.

Joe Lim
Asst Manager
Singapore Safety Driving Centre Ltd
Dated: 27 May 2010

none

More Information