vaulted_billing-termcap 0.0.1 → 0.0.2

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.
@@ -23,6 +23,51 @@ VaultedBilling::Gateways::Ipcommerce.class_eval do
23
23
  response,
24
24
  :success => (transaction.code == 1))
25
25
  end
26
+
27
+ def capture_all(options = {})
28
+ data = {
29
+ :"__type" => "CaptureAll:http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest",
30
+ :ApplicationProfileId => @application_id,
31
+ :BatchIds => [],
32
+ :MerchantProfileId => options[:merchant_profile_id]
33
+ }
34
+
35
+ response = http(options[:workflow_id] || @service_id).put(data, { :on_success => :decode_with_termcap })
36
+ transaction = new_transaction_from_response(response)
37
+ respond_with(transaction,
38
+ response,
39
+ :success => (transaction.code == 1))
40
+ end
41
+
42
+ def return_unlinked(customer, credit_card, amount, options = {})
43
+ data = {
44
+ :"__type" => "ReturnTransaction:http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest",
45
+ :ApplicationProfileId => @application_id,
46
+ :MerchantProfileId => options[:merchant_profile_id],
47
+ :Transaction => {
48
+ :"__type" => "BankcardTransaction:http:\/\/schemas.ipcommerce.com\/CWS\/v2.0\/Transactions\/Bankcard",
49
+ :TransactionData => {
50
+ :Amount => "%.2f" % amount,
51
+ :CurrencyCode => 4,
52
+ :TransactionDateTime => Time.now.xmlschema,
53
+ :CustomerPresent => 0,
54
+ :EmployeeId => options[:employee_id],
55
+ :EntryMode => 1,
56
+ :GoodsType => 0,
57
+ :IndustryType => 2,
58
+ :OrderNumber => options[:order_id] || generate_order_number,
59
+ :SignatureCaptured => false
60
+ },
61
+ :TenderData => card_data(credit_card)
62
+ }
63
+ }
64
+
65
+ response = http(options[:workflow_id] || @service_id).post(data)
66
+ transaction = new_transaction_from_response(response)
67
+ respond_with(transaction,
68
+ response,
69
+ :success => (transaction.code == 1))
70
+ end
26
71
 
27
72
  private
28
73
 
@@ -1,5 +1,5 @@
1
1
  module VaultedBilling
2
2
  module Termcap
3
- Version = '0.0.1'
3
+ Version = '0.0.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: vaulted_billing-termcap
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.1
5
+ version: 0.0.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Adam Fortuna
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-08-19 00:00:00 -04:00
13
+ date: 2011-08-30 00:00:00 -04:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -21,7 +21,7 @@ dependencies:
21
21
  requirements:
22
22
  - - ~>
23
23
  - !ruby/object:Gem::Version
24
- version: "1.1"
24
+ version: 1.1.1
25
25
  type: :runtime
26
26
  version_requirements: *id001
27
27
  - !ruby/object:Gem::Dependency