Forum: Ruby on Rails Activemerchant and UK Maestro (formerly Switch) problem

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.
6bf9328eef0afadd9c9d05334f8dd42b?d=identicon&s=25 Hubert Łępicki (Guest)
on 2008-10-14 10:41
(Received via mailing list)
Hi,

I am having problem with users reporting malfunctioning of UK Maestro
cards functionality on website of a client. I am using most recent
Activemerchant library from github, which I managed to make work with
rails 1.2.

Reported error is:

Credit card invalid: start_month is invalid issue_number cannot be
empty.

In my code I made special case for UK Maestro:

       credit_card = ActiveMerchant::Billing::CreditCard.new(
           :type       => params[:payment][:card_type],
           :number     => params[:payment][:card_number],
           :month      => params[:payment][:card_valid_ex_month],
           :year       => params[:payment][:card_valid_ex_year],
           :first_name => @join_request.first_name,
           :last_name  => @join_request.last_name,
           :verification_value => params[:payment][:security_number]
       )

     start_month = params[:payment][:card_valid_from_month]
     start_year = params[:payment][:card_valid_from_year]
     issue_number = params[:payment][:issue_number]

     if params[:payment][:card_type] == "switch"
       credit_card.start_month = start_month if start_month and
start_month != ""
       credit_card.start_year = start_year if start_year and
start_year !=""
       credit_card.issue_number = issue_number if issue_number and
issue_number != ""
     end

     ... do rest of processing ...

I am using:
Rails 1.2 + patched activesupport to work with activemerchant
Activemerchant 1.3.2

Please for any suggestion on what I am doing wrong or piece of code
that is proven to work with old UK Maestro/Switch cards.

Thanks,
H.
This topic is locked and can not be replied to.