killbill-litle 1.9.4 → 1.9.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +0 -3
- data/NEWS +3 -0
- data/VERSION +1 -1
- data/lib/litle/api.rb +11 -10
- data/lib/litle/models/litle_response.rb +1 -1
- data/litle.yml +16 -0
- data/pom.xml +1 -1
- metadata +2 -1
data/.gitignore
CHANGED
data/NEWS
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.9.
|
1
|
+
1.9.5
|
data/lib/litle/api.rb
CHANGED
@@ -57,14 +57,14 @@ module Killbill::Litle
|
|
57
57
|
def process_refund(kb_account_id, kb_payment_id, amount, currency, call_context = nil, options = {})
|
58
58
|
amount_in_cents = (amount * 100).to_i
|
59
59
|
|
60
|
-
litle_transaction = LitleTransaction.find_candidate_transaction_for_refund(kb_payment_id, amount_in_cents)
|
61
|
-
|
62
|
-
# Set a default report group
|
63
|
-
options[:merchant] ||= report_group_for_currency(currency)
|
64
|
-
|
65
60
|
# Check for currency conversion
|
66
61
|
actual_amount, actual_currency = convert_amount_currency_if_required(amount_in_cents, currency, kb_payment_id)
|
67
62
|
|
63
|
+
litle_transaction = LitleTransaction.find_candidate_transaction_for_refund(kb_payment_id, actual_amount)
|
64
|
+
|
65
|
+
# Set a default report group
|
66
|
+
options[:merchant] ||= report_group_for_currency(actual_currency)
|
67
|
+
|
68
68
|
# Go to Litle
|
69
69
|
gateway = Killbill::Litle.gateway_for_currency(actual_currency)
|
70
70
|
litle_response = gateway.credit actual_amount, litle_transaction.litle_txn_id, options
|
@@ -178,15 +178,15 @@ module Killbill::Litle
|
|
178
178
|
|
179
179
|
kb_payment = @kb_apis.payment_api.get_payment(kb_payment_id, false, @kb_apis.create_context)
|
180
180
|
|
181
|
-
currency_conversion = @kb_apis.currency_conversion_api.get_currency_conversion(
|
181
|
+
currency_conversion = @kb_apis.currency_conversion_api.get_currency_conversion(converted_currency, kb_payment.effective_date)
|
182
182
|
rates = currency_conversion.rates
|
183
183
|
found = rates.select do |r|
|
184
|
-
r.currency.to_s.upcase.to_sym ==
|
184
|
+
r.currency.to_s.upcase.to_sym == input_currency.to_s.upcase.to_sym
|
185
185
|
end
|
186
186
|
|
187
187
|
if found.nil? || found.empty?
|
188
188
|
@logger.warn "Failed to find converted currency #{converted_currency} for input currency #{input_currency}"
|
189
|
-
return [input_amount, input_currency]
|
189
|
+
return [input_amount, input_currency]
|
190
190
|
end
|
191
191
|
|
192
192
|
# conversion rounding ?
|
@@ -209,8 +209,9 @@ module Killbill::Litle
|
|
209
209
|
|
210
210
|
def account_currency(kb_account_id)
|
211
211
|
account = @kb_apis.account_user_api.get_account_by_id(kb_account_id, @kb_apis.create_context)
|
212
|
-
|
213
|
-
|
212
|
+
#Killbill::Litle.converted_currency(account.currency)
|
213
|
+
# Use original currency on the account when creating the payment method
|
214
|
+
account.currency
|
214
215
|
end
|
215
216
|
|
216
217
|
def report_group_for_currency(currency)
|
data/litle.yml
ADDED
data/pom.xml
CHANGED
@@ -25,7 +25,7 @@
|
|
25
25
|
<groupId>com.ning.killbill.ruby</groupId>
|
26
26
|
<artifactId>litle-plugin</artifactId>
|
27
27
|
<packaging>pom</packaging>
|
28
|
-
<version>1.9.
|
28
|
+
<version>1.9.5</version>
|
29
29
|
<name>litle-plugin</name>
|
30
30
|
<url>http://github.com/killbill/killbill-litle-plugin</url>
|
31
31
|
<description>Plugin for accessing Litle as a payment gateway</description>
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: killbill-litle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.9.
|
5
|
+
version: 1.9.5
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Kill Bill core team
|
@@ -234,6 +234,7 @@ files:
|
|
234
234
|
- lib/litle/models/litle_transaction.rb
|
235
235
|
- lib/litle/private_api.rb
|
236
236
|
- lib/litle/views/paypage.erb
|
237
|
+
- litle.yml
|
237
238
|
- pom.xml
|
238
239
|
- release.sh
|
239
240
|
- spec/litle/base_plugin_spec.rb
|