activemerchant 1.39.0 → 1.39.1

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
@@ -1 +1,4 @@
1
- 4��|Mped7����[���~��R��7a�/ ��G�@���I �����7H v[�6 ���S�����\w’+r6z��}����f� �[<���V u��g�
1
+ �#��4ú�,x5Ab�a�gWtٽ̷����Yǩ�G��YӦ)�}�1�"��L����1�C!��ԊZ:�1��W����V��r��bK7D��kF��PsQ�!�`j*ƻp�Rk�$6ۤ���?���������b���#�];��f|Y�����4L(���=��!s
2
+ �{_��[m�QL�
3
+ �7u}H�z@2�������d.ej�
4
+ �3��Yy<Z����K��nw�Klf�#
data/CHANGELOG CHANGED
@@ -1,5 +1,11 @@
1
1
  = ActiveMerchant CHANGELOG
2
2
 
3
+ == Version 1.39.1 (October 9th, 2013)
4
+
5
+ * Bitpay: Invoice Fix [orenmazor]
6
+
7
+ == Version 1.39.0 (October 9th, 2013)
8
+
3
9
  * Moneris: Add optional (off by default) verification_value support [duff]
4
10
  * Citrus: New Integration [viatechs, melari]
5
11
  * Payu Paisa: New Integration [melari]
@@ -7,11 +7,18 @@ module ActiveMerchant #:nodoc:
7
7
  module BitPay
8
8
 
9
9
  mattr_accessor :service_url
10
- self.service_url = 'https://www.bitpay.com/api/invoice'
10
+ self.service_url = 'https://bitpay.com/invoice'
11
+
12
+ mattr_accessor :invoicing_url
13
+ self.invoicing_url = 'https://bitpay.com/api/invoice'
11
14
 
12
15
  def self.notification(post)
13
16
  Notification.new(post)
14
17
  end
18
+
19
+ def self.helper(order, account, options = {})
20
+ Helper.new(order, account, options)
21
+ end
15
22
  end
16
23
  end
17
24
  end
@@ -5,17 +5,18 @@ module ActiveMerchant #:nodoc:
5
5
  class Helper < ActiveMerchant::Billing::Integrations::Helper
6
6
  def initialize(order_id, account, options)
7
7
  super
8
- add_field('account', account)
8
+ @account = account
9
9
  add_field('orderID', order_id)
10
10
  add_field('posData', options[:authcode])
11
11
  add_field('currency', options[:currency])
12
12
  add_field('fullNotifications', 'true')
13
13
  add_field('transactionSpeed', options[:transactionSpeed] || "high")
14
14
  add_field('address1', options[:address1])
15
+
16
+ generate_invoice_id
15
17
  end
16
18
 
17
19
  # Replace with the real mapping
18
- mapping :account, 'key'
19
20
  mapping :amount, 'price'
20
21
 
21
22
  mapping :order, 'orderID'
@@ -34,6 +35,32 @@ module ActiveMerchant #:nodoc:
34
35
 
35
36
  mapping :notify_url, 'notificationURL'
36
37
  mapping :return_url, 'returnURL'
38
+ mapping :id, 'id'
39
+
40
+ def generate_invoice_id
41
+ invoice_data = ssl_post(BitPay.invoicing_url)
42
+
43
+ add_field('id', JSON.parse(invoice_data.body)['id'])
44
+ end
45
+
46
+ def form_method
47
+ "GET"
48
+ end
49
+
50
+ private
51
+
52
+ def ssl_post(url, options = {})
53
+ uri = URI.parse(url)
54
+ http = Net::HTTP.new(uri.host, uri.port)
55
+ http.use_ssl = true
56
+
57
+ request = Net::HTTP::Post.new(uri.request_uri)
58
+ request.content_type = "application/json"
59
+ request.body = @fields.to_json
60
+ request.basic_auth @account, ''
61
+
62
+ http.request(request)
63
+ end
37
64
  end
38
65
  end
39
66
  end
@@ -20,7 +20,7 @@ module ActiveMerchant
20
20
  else
21
21
  case transaction_status.downcase
22
22
  when 'success' then 'Completed'
23
- when 'canceled' then 'Canceled'
23
+ when 'canceled' then 'Cancelled'
24
24
  end
25
25
  end
26
26
  else
@@ -1,3 +1,3 @@
1
1
  module ActiveMerchant
2
- VERSION = "1.39.0"
2
+ VERSION = "1.39.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activemerchant
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.39.0
4
+ version: 1.39.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
metadata.gz.sig CHANGED
@@ -1,2 +1,2 @@
1
- /uN�qy�?u-��A/�@;������.�+ ���P��7��o�`��5�T�N\�СN^�g�|,����Rl�%cN�/;J+�={l�c䘭+~[�<$��?��$��� L
2
- � h��m��b1B� = �YqC��˯l�+\|��4iV���@���̢�c�!
3
- �wXL:��3n������EY��!�}����Nm.Ȉ.�Q�,_{Ϗ�4�o RẾO��u;s�� �3jΥ!&ӌG���
1
+ 3U��a3"]�yӔ/�! ��5���`V��� DҁCy�MN���|��;���`K�Jw������ �����2��<�<E����mI� F����PG*����㗵�C��z���;�=��%�/Cߖ�Ffoj��.���+���528vO̡�����I�D�k���hy�!�I-~���5G�,�X��"Yo�`]ISP:G�N #�x��:35��'
2
+ �������O���rP�иI�c���79���w�`