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 +4 -1
- data/CHANGELOG +6 -0
- data/lib/active_merchant/billing/integrations/bit_pay.rb +8 -1
- data/lib/active_merchant/billing/integrations/bit_pay/helper.rb +29 -2
- data/lib/active_merchant/billing/integrations/citrus/notification.rb +1 -1
- data/lib/active_merchant/version.rb +1 -1
- metadata +1 -1
- metadata.gz.sig +2 -3
data.tar.gz.sig
CHANGED
@@ -1 +1,4 @@
|
|
1
|
-
4
|
1
|
+
�#��4ú�,x5Ab�a�gWtٽ̷����Yǩ�G��YӦ)�}�1�"��L����1�C!��ԊZ:�1��W����V��r��bK7�D��kF��P�sQ�!�`j*ƻp�R�k�$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://
|
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
|
-
|
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
|
metadata
CHANGED
metadata.gz.sig
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
�wXL:��3n������EY��!�}����Nm.Ȉ.�Q�,_{Ϗ�4�o RẾO��u;s���3jΥ!&ӌG���
|
1
|
+
3�U��a3"]�yӔ/�!��5���`V���DҁCy�MN���|��;���`K�Jw������ �����2��<�<E����mI�F����PG*����㗵�C��z���;�=��%�/Cߖ�Ffoj��.���+���52�8vO̡�����I�D�k���hy�!�I-~���5G�,�X��"Yo�`]ISP:G�N#�x��:3�5��'�
|
2
|
+
�������O���rP�иI�c���79���w�`
|