an 0.0.1.rc3 → 0.0.1.rc4

Sign up to get free protection for your applications and to get access to all the features.
data/an.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "an"
3
- s.version = "0.0.1.rc3"
3
+ s.version = "0.0.1.rc4"
4
4
  s.summary = "A thin Authorize.NET client."
5
5
  s.description = "AN is a simplified client for integration with Authorize.NET."
6
6
  s.authors = ["Cyril David"]
@@ -12,7 +12,8 @@ Gem::Specification.new do |s|
12
12
  "README",
13
13
  "lib/**/*.rb",
14
14
  "*.gemspec",
15
- "test/*.*"
15
+ "test/*.*",
16
+ "templates/*.mote"
16
17
  ]
17
18
 
18
19
  s.add_dependency "mote"
@@ -0,0 +1,42 @@
1
+ <?xml version="1.0"?>
2
+ <createCustomerPaymentProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
3
+ <merchantAuthentication>
4
+ <name>{{ login }}</name>
5
+ <transactionKey>{{ transaction_key }}</transactionKey>
6
+ </merchantAuthentication>
7
+ <customerProfileId>{{ profile_id }}</customerProfileId>
8
+ <paymentProfile>
9
+ <billTo>
10
+ <firstName>{{ first_name }}</firstName>
11
+ <lastName>{{ last_name }}</lastName>
12
+
13
+ % [:company, :address, :city, :state, :zip, :country].each do |field|
14
+ % if params[field]
15
+ <{{ field }}>{{ params[field] }}</{{ field }}>
16
+ % end
17
+ % end
18
+
19
+ % if params[:phone]
20
+ <phoneNumber>{{ phone }}</phoneNumber>
21
+ % end
22
+
23
+ % if params[:fax]
24
+ <faxNumber>{{ fax }}</faxNumber>
25
+ % end
26
+ </billTo>
27
+
28
+ <payment>
29
+ <creditCard>
30
+ <cardNumber>{{ card_number }}</cardNumber>
31
+ <expirationDate>{{ expiration_date }}</expirationDate>
32
+
33
+ % if params[:card_code]
34
+ <cardCode>{{ params[:card_code] }}</cardCode>
35
+ % end
36
+
37
+ </creditCard>
38
+ </payment>
39
+ </paymentProfile>
40
+
41
+ <validationMode>{{ params[:validation_mode] || "liveMode" }}</validationMode>
42
+ </createCustomerPaymentProfileRequest>
@@ -0,0 +1,17 @@
1
+ <?xml version="1.0"?>
2
+ <createCustomerProfileRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
3
+ <merchantAuthentication>
4
+ <name>{{ login }}</name>
5
+ <transactionKey>{{ transaction_key }}</transactionKey>
6
+ </merchantAuthentication>
7
+ <refId>{{ reference_id }}</refId>
8
+ <profile>
9
+ <merchantCustomerId>{{ customer_id }}</merchantCustomerId>
10
+
11
+ % if params[:description]
12
+ <description>{{ params[:description] }}</description>
13
+ % end
14
+
15
+ <email>{{ email }}</email>
16
+ </profile>
17
+ </createCustomerProfileRequest>
@@ -0,0 +1,62 @@
1
+ <?xml version="1.0"?>
2
+ <createCustomerProfileTransactionRequest
3
+ xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
4
+
5
+ <merchantAuthentication>
6
+ <name>{{ login }}</name>
7
+ <transactionKey>{{ transaction_key }}</transactionKey>
8
+ </merchantAuthentication>
9
+ <transaction>
10
+ <profileTransAuthCapture>
11
+ <amount>{{ amount }}</amount>
12
+
13
+ % if tax = params[:tax]
14
+ <tax>
15
+ <amount>{{ tax[:amount] }</amount>
16
+ <name>{{ tax[:name] }}</name>
17
+ <description>{{ tax[:description] }}</description>
18
+ </tax>
19
+ % end
20
+
21
+ % if shipping = params[:shipping]
22
+ <shipping>
23
+ <amount>{{ shipping[:amount] }}</amount>
24
+ <name>{{ shipping[:name] }}</name>
25
+ <description>{{ shipping[:description] }}</description>
26
+ </shipping>
27
+ % end
28
+
29
+ % if line_items = params[:line_itmes]
30
+ % line_items.each do |item|
31
+ <lineItems>
32
+ <itemId>{{ item[:id] }}</itemId>
33
+ <name>{{ item[:name] }}</name>
34
+ <description>{{ item[:description] }}</description>
35
+ <quantity>{{ item[:quantity] }}</quantity>
36
+ <unitPrice>{{ item[:unit_price] }}</unitPrice>
37
+ <taxable>{{ item[:taxable] }}</taxable>
38
+ </lineItems>
39
+ % end
40
+ % end
41
+ <customerProfileId>{{ profile_id }}</customerProfileId>
42
+ <customerPaymentProfileId>{{ payment_profile_id }}</customerPaymentProfileId>
43
+
44
+ % if shipping_id = params[:shipping_address_id]
45
+ <customerShippingAddressId>{{ shipping_id }}</customerShippingAddressId>
46
+ % end
47
+
48
+ <order>
49
+ <invoiceNumber>{{ invoice_number }}</invoiceNumber>
50
+ <description>{{ description }}</description>
51
+ <purchaseOrderNumber>{{ purchase_order_number }}</purchaseOrderNumber>
52
+ </order>
53
+
54
+ <taxExempt>{{ params[:tax_exempt] || "true" }}</taxExempt>
55
+ <recurringBilling>{{ params[:recurring_billing] || "false" }}</recurringBilling>
56
+
57
+ % if card_code = params[:card_code]
58
+ <cardCode>{{ card_code }}</cardCode>
59
+ % end
60
+ </profileTransAuthCapture>
61
+ </transaction>
62
+ </createCustomerProfileTransactionRequest>
@@ -0,0 +1,46 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <createTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd">
3
+ <merchantAuthentication>
4
+ <name>{{ login }}</name>
5
+ <transactionKey>{{ transaction_key }}</transactionKey>
6
+ </merchantAuthentication>
7
+ <transactionRequest>
8
+ <transactionType>authCaptureTransaction</transactionType>
9
+ <amount>{{ amount }}</amount>
10
+ <payment>
11
+ <creditCard>
12
+ <cardNumber>{{ card_number }}</cardNumber>
13
+ <expirationDate>{{ expiration_date }}</expirationDate>
14
+
15
+ % if params[:card_code]
16
+ <cardCode>{{ card_code }}</cardCode>
17
+ % end
18
+ </creditCard>
19
+ </payment>
20
+ <order>
21
+ <invoiceNumber>{{ invoice_number }}</invoiceNumber>
22
+
23
+ % if params[:description]
24
+ <description>{{ params[:description] }}</description>
25
+ % end
26
+ </order>
27
+ % if params[:first_name] && params[:last_name]
28
+ <billTo>
29
+ <firstName>{{ params[:first_name] }}</firstName>
30
+ <lastName>{{ params[:last_name] }}</lastName>
31
+ <company>{{ params[:company] }}</company>
32
+ <address>{{ params[:address] }}</address>
33
+ <city>{{ params[:city] }}</city>
34
+ <state>{{ params[:state] }}</state>
35
+ <zip>{{ params[:zip] }}</zip>
36
+ <country>{{ params[:country] }}</country>
37
+ <phoneNumber>{{ params[:phone_number] }}</phoneNumber>
38
+ <faxNumber>{{ params[:fax_number] }}</faxNumber>
39
+ </billTo>
40
+ % end
41
+
42
+ % if params[:customer_ip]
43
+ <customerIP>{{ params[:customer_ip] }}</customerIP>
44
+ % end
45
+ </transactionRequest>
46
+ </createTransactionRequest>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: an
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.rc3
4
+ version: 0.0.1.rc4
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-02-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mote
16
- requirement: &2151853740 !ruby/object:Gem::Requirement
16
+ requirement: &2151853480 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2151853740
24
+ version_requirements: *2151853480
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: xml-simple
27
- requirement: &2151853160 !ruby/object:Gem::Requirement
27
+ requirement: &2151852900 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2151853160
35
+ version_requirements: *2151852900
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: cutest
38
- requirement: &2151852500 !ruby/object:Gem::Requirement
38
+ requirement: &2151852140 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *2151852500
46
+ version_requirements: *2151852140
47
47
  description: AN is a simplified client for integration with Authorize.NET.
48
48
  email:
49
49
  - me@cyrildavid.com
@@ -57,6 +57,10 @@ files:
57
57
  - an.gemspec
58
58
  - test/an.rb
59
59
  - test/helper.rb
60
+ - templates/createCustomerPaymentProfileRequest.mote
61
+ - templates/createCustomerProfileRequest.mote
62
+ - templates/createCustomerProfileTransactionRequest.mote
63
+ - templates/createTransactionRequest.mote
60
64
  homepage: http://github.com/cyx/an
61
65
  licenses: []
62
66
  post_install_message: