Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tranzila support invoices with :email option #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions active_merchant_tranzila.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Gem::Specification.new do |s|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Vitaly Kushner"]
s.date = %q{2010-08-11}
s.description = %q{TODO: longer description of your gem}
s.description = %q{longer description of your gem}
s.email = %q{[email protected]}
s.extra_rdoc_files = [
"LICENSE",
Expand All @@ -30,7 +30,7 @@ Gem::Specification.new do |s|
s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.6}
s.summary = %q{TODO: one-line summary of your gem}
s.summary = %q{one-line summary of your gem}
s.test_files = [
"test/helper.rb",
"test/remote/gateways/remote_tranzila_test.rb",
Expand Down
9 changes: 7 additions & 2 deletions lib/active_merchant/billing/gateways/tranzila.rb
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ def purchase_parameters(money, creditcard, options = {})
end

def default_parameters_hash(money, creditcard, options = {})
{
default_params = {
:sum => amount(money),
:ccno => creditcard.number,
:expyear => creditcard.year.to_s[-2, 2],
Expand All @@ -419,7 +419,6 @@ def default_parameters_hash(money, creditcard, options = {})
:cred_type => options[:cred_type],
:currency => @options[:currency],
:myid => options[:myid],

#transaction with monthly installments not supported yet
#:fpay => options[:myid],
#:spay => options[:spay],
Expand All @@ -428,6 +427,12 @@ def default_parameters_hash(money, creditcard, options = {})
#tranzila registered supplier (test3)
:supplier => @options[:supplier]
}

[:email, :company, :contact].each do |param|
default_params[param] = options[param].encode("windows-1255") if options.key?(param)
end

default_params
end

def to_query_s(hash)
Expand Down