Forum: Ruby on Rails SSL encrypted server-to-server connection?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3d197df430dbfd0d0b11f23b0a8d3ec9?d=identicon&s=25 Daniel Smedegaard Buus (Guest)
on 2007-06-13 12:49
(Received via mailing list)
Hey there :)

I'm about to integrate this Danish payment provider, DIBS, module into
a website.

To do so, I need to contact their server from our server, using our
registered SSL certificate to encrypt the communication between us.

Is this even possible? And if so, how?

Thanks for any help!

Daniel
3d197df430dbfd0d0b11f23b0a8d3ec9?d=identicon&s=25 Daniel Smedegaard Buus (Guest)
on 2007-06-13 15:01
(Received via mailing list)
Daniel Smedegaard Buus wrote:
> Thanks for any help!
>
> Daniel

Okay, that was pretty easy!

Here's an example of testing the auth.cgi thingie at DIBS (does not
require Rails):

require 'net/https'
site = Net::HTTP.new("payment.architrade.com", 443)
site.use_ssl = true
response = site.post2('/cgi-ssl/auth.cgi',
  "merchant=#{SystemSettings.dibs_account_info[:merchant_id]}&" + #
Our
merchant id as given by DIBS
  "textreply=true&" + # Telling auth.cgi that we don't want any HTML
description, just an easily parsed plain text response, please
  "amount=2000&" + # The amount to withdraw from the credit card in
ører  "currency=208&" + # The currency type, here DKK
  "cardno=5125861000000000&" + # Card number, duh!
  "cvc=684&" + # Check digits
  "expmon=06&" + # Expiration month as mm
  "expyear=24&" + # Expiration year as yy
#  "md5key=cfcd208495d565ef66e7dff9f98764da&" + # Our md5key (which we
don't
have ATM)
  "orderid=TEST00102012&" + # The order id, which will be /W\d+/
  "test=yes&" + # Is this just a test?
  "uniqueoid=yes" # Causes auth.cgi to reject orders with duplicate
ids using
reason=7
)
puts response.body # =>
status=ACCEPTED&transact=104125837&cardtype=MC(SE)
This topic is locked and can not be replied to.