Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Commit

Permalink
Fix StartDate in ProtxGatewy
Browse files Browse the repository at this point in the history
git-svn-id: https://activemerchant.googlecode.com/svn/trunk/active_merchant@653 6513ea26-6c20-0410-8a68-89cd7235086d
  • Loading branch information
codyfauser committed Mar 13, 2008
1 parent 2252fd4 commit fe08c89
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
= ActiveMerchant CHANGELOG

* Fix StartDate in ProtxGatewy [cody]
* Add support for refunds and continuous authority references to DataCashGateway [joel.chippindale]
* Fix gross in HiTrust notification. Don't use Money object in Verifi gateway [cody]
* Initial implementation of Payflow Name-Value API [Greg Furmanek]
Expand Down
13 changes: 6 additions & 7 deletions lib/active_merchant/billing/gateways/protx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def initialize(options = {})
end

def test?
@options[:test] || Base.gateway_mode == :test
@options[:test] || super
end

def purchase(money, credit_card, options = {})
Expand Down Expand Up @@ -171,11 +171,10 @@ def add_credit_card(post, credit_card)
add_pair(post, :CardHolder, credit_card.name, :required => true)
add_pair(post, :CardNumber, credit_card.number, :required => true)

add_pair(post, :ExpiryDate, format_expiry_date(credit_card), :required => true)
add_pair(post, :ExpiryDate, format_date(credit_card.month, credit_card.year), :required => true)

if requires_start_date_or_issue_number?(credit_card)
add_pair(post, :StartDate, format(credit_card.start_year, :four_digits))

add_pair(post, :StartDate, format_date(credit_card.start_month, credit_card.start_year))
add_pair(post, :IssueNumber, format_issue_number(credit_card))
end
add_pair(post, :CardType, map_card_type(credit_card))
Expand All @@ -201,9 +200,9 @@ def map_card_type(credit_card)
end

# MMYY format
def format_expiry_date(credit_card)
year = sprintf("%.4i", credit_card.year)
month = sprintf("%.2i", credit_card.month)
def format_date(month, year)
year = sprintf("%.4i", year)
month = sprintf("%.2i", month)

"#{month}#{year[-2..-1]}"
end
Expand Down

0 comments on commit fe08c89

Please sign in to comment.