killbill-paypal-express 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/NEWS CHANGED
@@ -1,3 +1,6 @@
1
+ 1.5.1
2
+ Fix bug in get_payment_info and get_refund_info
3
+
1
4
  1.5.0
2
5
  Update to latest killbill 1.6.0 (new entitlement apis)
3
6
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.5.0
1
+ 1.5.1
@@ -44,14 +44,9 @@ module Killbill::PaypalExpress
44
44
  def get_payment_info(kb_account_id, kb_payment_id, tenant_context = nil, options = {})
45
45
  paypal_express_transaction = PaypalExpressTransaction.from_kb_payment_id(kb_payment_id)
46
46
 
47
- begin
48
- transaction_id = paypal_express_transaction.paypal_express_txn_id
49
- response = @gateway.transaction_details transaction_id
50
- PaypalExpressResponse.from_response(:transaction_details, kb_payment_id, response).to_payment_response
51
- rescue => e
52
- @logger.warn("Exception while retrieving Paypal Express transaction detail for payment #{kb_payment_id}, defaulting to cached response: #{e}")
53
- paypal_express_transaction.paypal_express_response.to_payment_response
54
- end
47
+ # We could also re-fetch it via: @gateway.transaction_details(transaction_id)
48
+ # but we would need to reconstruct the payment_info object
49
+ paypal_express_transaction.paypal_express_response.to_payment_response
55
50
  end
56
51
 
57
52
  def process_refund(kb_account_id, kb_payment_id, amount, currency, call_context = nil, options = {})
@@ -74,14 +69,9 @@ module Killbill::PaypalExpress
74
69
  def get_refund_info(kb_account_id, kb_payment_id, tenant_context = nil, options = {})
75
70
  paypal_express_transaction = PaypalExpressTransaction.refund_from_kb_payment_id(kb_payment_id)
76
71
 
77
- begin
78
- transaction_id = paypal_express_transaction.paypal_express_txn_id
79
- response = @gateway.transaction_details transaction_id
80
- PaypalExpressResponse.from_response(:transaction_details, kb_payment_id, response).to_refund_response
81
- rescue => e
82
- @logger.warn("Exception while retrieving Paypal Express transaction detail for payment #{kb_payment_id}, defaulting to cached response: #{e}")
83
- paypal_express_transaction.paypal_express_response.to_refund_response
84
- end
72
+ # We could also re-fetch it via: @gateway.transaction_details(transaction_id)
73
+ # but we would need to reconstruct the refund_info object
74
+ paypal_express_transaction.paypal_express_response.to_refund_response
85
75
  end
86
76
 
87
77
  def add_payment_method(kb_account_id, kb_payment_method_id, payment_method_props, set_default = false, call_context = nil, options = {})
data/pom.xml CHANGED
@@ -25,7 +25,7 @@
25
25
  <groupId>com.ning.killbill.ruby</groupId>
26
26
  <artifactId>paypal-express-plugin</artifactId>
27
27
  <packaging>pom</packaging>
28
- <version>1.5.0</version>
28
+ <version>1.5.1</version>
29
29
  <name>paypal-express-plugin</name>
30
30
  <url>http://github.com/killbill/killbill-paypal-express-plugin</url>
31
31
  <description>Plugin for accessing paypal as a payment gateway</description>
@@ -22,7 +22,7 @@ describe Killbill::PaypalExpress::PaymentPlugin do
22
22
  end
23
23
 
24
24
  it 'should be able to charge and refund' do
25
- amount = 100
25
+ amount = BigDecimal.new("100")
26
26
  currency = 'USD'
27
27
  kb_payment_id = SecureRandom.uuid
28
28
 
@@ -38,6 +38,7 @@ describe Killbill::PaypalExpress::PaymentPlugin do
38
38
 
39
39
  # Check we can retrieve the payment
40
40
  payment_response = @plugin.get_payment_info @pm.kb_account_id, kb_payment_id
41
+ payment_response.first_payment_reference_id.should_not be_nil
41
42
  payment_response.amount.should == amount
42
43
  payment_response.status.should == :PROCESSED
43
44
 
@@ -55,11 +56,11 @@ describe Killbill::PaypalExpress::PaymentPlugin do
55
56
 
56
57
  # Check we can retrieve the refund
57
58
  refund_response = @plugin.get_refund_info @pm.kb_account_id, kb_payment_id
58
- refund_response.amount.should == (-1 * amount)
59
+ refund_response.amount.should == amount
59
60
  refund_response.status.should == :PROCESSED
60
61
 
61
62
  # Try another payment to verify the BAID
62
- second_amount = 94.23
63
+ second_amount = BigDecimal.new("94.23")
63
64
  second_kb_payment_id = SecureRandom.uuid
64
65
  payment_response = @plugin.process_payment @pm.kb_account_id, second_kb_payment_id, @pm.kb_payment_method_id, second_amount, currency
65
66
  payment_response.amount.should == second_amount
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: killbill-paypal-express
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-08-21 00:00:00.000000000 Z
12
+ date: 2013-09-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: killbill