mundipagg 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +191 -191
- data/README.md +118 -118
- data/lib/mundipagg.rb +13 -13
- data/lib/mundipagg/BoletoTransaction.rb +30 -30
- data/lib/mundipagg/Buyer.rb +81 -81
- data/lib/mundipagg/BuyerAddress.rb +68 -68
- data/lib/mundipagg/CreateOrderRequest.rb +66 -66
- data/lib/mundipagg/CreditCardTransaction.rb +81 -81
- data/lib/mundipagg/ManageOrderRequest.rb +51 -51
- data/lib/mundipagg/QueryOrderRequest.rb +28 -27
- data/lib/mundipagg/Recurrency.rb +38 -38
- data/lib/mundipagg/ShoppingCart.rb +15 -15
- data/lib/mundipagg/ShoppingCartItem.rb +23 -23
- data/lib/mundipagg/gateway.rb +401 -401
- data/lib/mundipagg/post_notification.rb +30 -30
- data/lib/mundipagg/version.rb +9 -9
- data/mundipagg.gemspec +18 -18
- data/tests/features/boleto.feature +9 -9
- data/tests/features/credit_card.feature +43 -43
- data/tests/features/post_notification.feature +9 -9
- data/tests/features/step_definitions/boleto_steps.rb +50 -50
- data/tests/features/step_definitions/credit_card_steps.rb +167 -167
- data/tests/features/step_definitions/post_notification.rb +92 -92
- data/tests/features/support/env.rb +6 -6
- data/tests/test_configuration.rb +5 -5
- data/tests/test_helper.rb +68 -68
- metadata +14 -18
@@ -1,81 +1,81 @@
|
|
1
|
-
module Mundipagg
|
2
|
-
class CreditCardTransaction
|
3
|
-
|
4
|
-
# @return [Long] Transaction amount in cents
|
5
|
-
attr_accessor :amountInCents
|
6
|
-
|
7
|
-
# @return [String] Instant buy key
|
8
|
-
attr_accessor :instantBuyKey
|
9
|
-
|
10
|
-
# @return [String] Card brand. Use the static property <i>BrandEnum</i>.
|
11
|
-
# @see BrandEnum
|
12
|
-
attr_accessor :creditCardBrandEnum
|
13
|
-
|
14
|
-
# @return [String] Credit Card Number.
|
15
|
-
attr_accessor :creditCardNumber
|
16
|
-
|
17
|
-
# @return [String] Type of operation. Use the static property <i>OperationEnum</i>.
|
18
|
-
# @see OperationEnum
|
19
|
-
attr_accessor :creditCardOperationEnum
|
20
|
-
|
21
|
-
# @return [Integer] Credit card expiration month
|
22
|
-
attr_accessor :expirationMonth
|
23
|
-
|
24
|
-
# @return [Integer] Credit card expiration year
|
25
|
-
attr_accessor :expirationYear
|
26
|
-
|
27
|
-
# @return [Integer] Name in the credit card
|
28
|
-
attr_accessor :holderName
|
29
|
-
|
30
|
-
# @return [Integer] Transaction installments count.
|
31
|
-
attr_accessor :installmentCount
|
32
|
-
|
33
|
-
# @return [Integer] Card security code.
|
34
|
-
attr_accessor :securityCode
|
35
|
-
|
36
|
-
# @return [Integer] Code to select the payment method. Can be <i>Cielo<i>, <i>Redecard<i> and others.
|
37
|
-
attr_accessor :paymentMethodCode
|
38
|
-
|
39
|
-
# @return [String] Custom transaction identifier.
|
40
|
-
attr_accessor :transactionReference
|
41
|
-
|
42
|
-
# Fill this property when creating a recurrency transaction.
|
43
|
-
# @return [Recurrency] Transaction recurrency information.
|
44
|
-
attr_accessor :recurrency
|
45
|
-
|
46
|
-
# Allowed card brands
|
47
|
-
# @returns [Hash<Symbol, String>]
|
48
|
-
@@CARD_BRAND = {
|
49
|
-
:Visa => 'Visa',
|
50
|
-
:Mastercard => 'Mastercard',
|
51
|
-
:AmericanExpress => 'Amex',
|
52
|
-
:Hipercard => 'Hipercard',
|
53
|
-
:Diners => 'Diners',
|
54
|
-
:Elo => 'Elo',
|
55
|
-
:Aura => 'Aura',
|
56
|
-
:Discover => 'Discover'
|
57
|
-
}
|
58
|
-
|
59
|
-
# Types of operation.
|
60
|
-
# @returns [Hash<Symbol, String>]
|
61
|
-
@@OPERATION = {
|
62
|
-
:AuthOnly => 'AuthOnly',
|
63
|
-
:AuthAndCapture => 'AuthAndCapture',
|
64
|
-
:AuthAndCaptureWithDelay => 'AuthAndCaptureWithDelay'
|
65
|
-
}
|
66
|
-
|
67
|
-
# Allowed card brands
|
68
|
-
# @returns [Hash<Symbol, String>]
|
69
|
-
# @see @@CARD_BRAND
|
70
|
-
def self.BrandEnum
|
71
|
-
@@CARD_BRAND
|
72
|
-
end
|
73
|
-
|
74
|
-
# Allowed operations.
|
75
|
-
# @returns [Hash<Symbol, String>]
|
76
|
-
# @see @@OPERATION
|
77
|
-
def self.OperationEnum
|
78
|
-
@@OPERATION
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
1
|
+
module Mundipagg
|
2
|
+
class CreditCardTransaction
|
3
|
+
|
4
|
+
# @return [Long] Transaction amount in cents
|
5
|
+
attr_accessor :amountInCents
|
6
|
+
|
7
|
+
# @return [String] Instant buy key
|
8
|
+
attr_accessor :instantBuyKey
|
9
|
+
|
10
|
+
# @return [String] Card brand. Use the static property <i>BrandEnum</i>.
|
11
|
+
# @see BrandEnum
|
12
|
+
attr_accessor :creditCardBrandEnum
|
13
|
+
|
14
|
+
# @return [String] Credit Card Number.
|
15
|
+
attr_accessor :creditCardNumber
|
16
|
+
|
17
|
+
# @return [String] Type of operation. Use the static property <i>OperationEnum</i>.
|
18
|
+
# @see OperationEnum
|
19
|
+
attr_accessor :creditCardOperationEnum
|
20
|
+
|
21
|
+
# @return [Integer] Credit card expiration month
|
22
|
+
attr_accessor :expirationMonth
|
23
|
+
|
24
|
+
# @return [Integer] Credit card expiration year
|
25
|
+
attr_accessor :expirationYear
|
26
|
+
|
27
|
+
# @return [Integer] Name in the credit card
|
28
|
+
attr_accessor :holderName
|
29
|
+
|
30
|
+
# @return [Integer] Transaction installments count.
|
31
|
+
attr_accessor :installmentCount
|
32
|
+
|
33
|
+
# @return [Integer] Card security code.
|
34
|
+
attr_accessor :securityCode
|
35
|
+
|
36
|
+
# @return [Integer] Code to select the payment method. Can be <i>Cielo<i>, <i>Redecard<i> and others.
|
37
|
+
attr_accessor :paymentMethodCode
|
38
|
+
|
39
|
+
# @return [String] Custom transaction identifier.
|
40
|
+
attr_accessor :transactionReference
|
41
|
+
|
42
|
+
# Fill this property when creating a recurrency transaction.
|
43
|
+
# @return [Recurrency] Transaction recurrency information.
|
44
|
+
attr_accessor :recurrency
|
45
|
+
|
46
|
+
# Allowed card brands
|
47
|
+
# @returns [Hash<Symbol, String>]
|
48
|
+
@@CARD_BRAND = {
|
49
|
+
:Visa => 'Visa',
|
50
|
+
:Mastercard => 'Mastercard',
|
51
|
+
:AmericanExpress => 'Amex',
|
52
|
+
:Hipercard => 'Hipercard',
|
53
|
+
:Diners => 'Diners',
|
54
|
+
:Elo => 'Elo',
|
55
|
+
:Aura => 'Aura',
|
56
|
+
:Discover => 'Discover'
|
57
|
+
}
|
58
|
+
|
59
|
+
# Types of operation.
|
60
|
+
# @returns [Hash<Symbol, String>]
|
61
|
+
@@OPERATION = {
|
62
|
+
:AuthOnly => 'AuthOnly',
|
63
|
+
:AuthAndCapture => 'AuthAndCapture',
|
64
|
+
:AuthAndCaptureWithDelay => 'AuthAndCaptureWithDelay'
|
65
|
+
}
|
66
|
+
|
67
|
+
# Allowed card brands
|
68
|
+
# @returns [Hash<Symbol, String>]
|
69
|
+
# @see @@CARD_BRAND
|
70
|
+
def self.BrandEnum
|
71
|
+
@@CARD_BRAND
|
72
|
+
end
|
73
|
+
|
74
|
+
# Allowed operations.
|
75
|
+
# @returns [Hash<Symbol, String>]
|
76
|
+
# @see @@OPERATION
|
77
|
+
def self.OperationEnum
|
78
|
+
@@OPERATION
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
@@ -1,52 +1,52 @@
|
|
1
|
-
module Mundipagg
|
2
|
-
class ManageOrderRequest
|
3
|
-
|
4
|
-
# @return [Array] Credit card transaction collection
|
5
|
-
attr_accessor :transactionCollection
|
6
|
-
|
7
|
-
# @return [String] Operation enum
|
8
|
-
attr_accessor :manageOrderOperationEnum
|
9
|
-
|
10
|
-
# @return [Guid] MundiPagg merchant identification
|
11
|
-
attr_accessor :merchantKey
|
12
|
-
|
13
|
-
# @return [Guid] Unique order identification. Generated by MundiPagg.
|
14
|
-
attr_accessor :orderKey
|
15
|
-
|
16
|
-
# @return [String] Order identification.
|
17
|
-
attr_accessor :orderReference
|
18
|
-
|
19
|
-
# If not send, it will be generate automatically in the webservice and returned in response.
|
20
|
-
# Web service request identification, it is used for investigate problems with webservice requests.
|
21
|
-
# @return [Guid] Globally Unique Identifier.
|
22
|
-
# @param Optional
|
23
|
-
# @param Default: 00000000-0000-0000-0000-000000000000
|
24
|
-
attr_accessor :requestKey
|
25
|
-
|
26
|
-
# Initialize class and properties
|
27
|
-
def initialize
|
28
|
-
@transactionCollection = Array.new
|
29
|
-
@requestKey = '00000000-0000-0000-0000-000000000000'
|
30
|
-
end
|
31
|
-
|
32
|
-
# Operations allowed
|
33
|
-
@@Operation = {
|
34
|
-
:Capture => 'Capture',
|
35
|
-
:Void => 'Void'
|
36
|
-
}
|
37
|
-
|
38
|
-
# Hash collection with operations allowed
|
39
|
-
def self.OperationEnum
|
40
|
-
@@Operation
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
class ManageTransactionRequest
|
45
|
-
# @return [Long] Order amount in cents.
|
46
|
-
attr_accessor :amountInCents
|
47
|
-
# @return [Guid] Unique transacion identifier generated by MundiPagg.
|
48
|
-
attr_accessor :transactionKey
|
49
|
-
# @return [String] Custom transaction identifier.
|
50
|
-
attr_accessor :transactionReference
|
51
|
-
end
|
1
|
+
module Mundipagg
|
2
|
+
class ManageOrderRequest
|
3
|
+
|
4
|
+
# @return [Array] Credit card transaction collection
|
5
|
+
attr_accessor :transactionCollection
|
6
|
+
|
7
|
+
# @return [String] Operation enum
|
8
|
+
attr_accessor :manageOrderOperationEnum
|
9
|
+
|
10
|
+
# @return [Guid] MundiPagg merchant identification
|
11
|
+
attr_accessor :merchantKey
|
12
|
+
|
13
|
+
# @return [Guid] Unique order identification. Generated by MundiPagg.
|
14
|
+
attr_accessor :orderKey
|
15
|
+
|
16
|
+
# @return [String] Order identification.
|
17
|
+
attr_accessor :orderReference
|
18
|
+
|
19
|
+
# If not send, it will be generate automatically in the webservice and returned in response.
|
20
|
+
# Web service request identification, it is used for investigate problems with webservice requests.
|
21
|
+
# @return [Guid] Globally Unique Identifier.
|
22
|
+
# @param Optional
|
23
|
+
# @param Default: 00000000-0000-0000-0000-000000000000
|
24
|
+
attr_accessor :requestKey
|
25
|
+
|
26
|
+
# Initialize class and properties
|
27
|
+
def initialize
|
28
|
+
@transactionCollection = Array.new
|
29
|
+
@requestKey = '00000000-0000-0000-0000-000000000000'
|
30
|
+
end
|
31
|
+
|
32
|
+
# Operations allowed
|
33
|
+
@@Operation = {
|
34
|
+
:Capture => 'Capture',
|
35
|
+
:Void => 'Void'
|
36
|
+
}
|
37
|
+
|
38
|
+
# Hash collection with operations allowed
|
39
|
+
def self.OperationEnum
|
40
|
+
@@Operation
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
class ManageTransactionRequest
|
45
|
+
# @return [Long] Order amount in cents.
|
46
|
+
attr_accessor :amountInCents
|
47
|
+
# @return [Guid] Unique transacion identifier generated by MundiPagg.
|
48
|
+
attr_accessor :transactionKey
|
49
|
+
# @return [String] Custom transaction identifier.
|
50
|
+
attr_accessor :transactionReference
|
51
|
+
end
|
52
52
|
end
|
@@ -1,27 +1,28 @@
|
|
1
|
-
module Mundipagg
|
2
|
-
class QueryOrderRequest
|
3
|
-
|
4
|
-
# @return [Guid] MundiPagg merchant identification
|
5
|
-
attr_accessor :merchantKey
|
6
|
-
|
7
|
-
# @return [Guid] Unique order identification. Generated by MundiPagg.
|
8
|
-
attr_accessor :orderKey
|
9
|
-
|
10
|
-
# @return [String] Custom order identification.
|
11
|
-
attr_accessor :orderReference
|
12
|
-
|
13
|
-
# If not send, it will be generate automatically in the webservice and returned in response.
|
14
|
-
# Web service request identification, it is used for investigate problems with webservice requests.
|
15
|
-
# @return [Guid] Globally Unique Identifier.
|
16
|
-
# @param Optional
|
17
|
-
# @param Default: 00000000-0000-0000-0000-000000000000
|
18
|
-
attr_accessor :requestKey
|
19
|
-
|
20
|
-
# Initialize class and properties
|
21
|
-
def initialize()
|
22
|
-
@requestKey = '00000000-0000-0000-0000-000000000000'
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
end
|
1
|
+
module Mundipagg
|
2
|
+
class QueryOrderRequest
|
3
|
+
|
4
|
+
# @return [Guid] MundiPagg merchant identification
|
5
|
+
attr_accessor :merchantKey
|
6
|
+
|
7
|
+
# @return [Guid] Unique order identification. Generated by MundiPagg.
|
8
|
+
attr_accessor :orderKey
|
9
|
+
|
10
|
+
# @return [String] Custom order identification.
|
11
|
+
attr_accessor :orderReference
|
12
|
+
|
13
|
+
# If not send, it will be generate automatically in the webservice and returned in response.
|
14
|
+
# Web service request identification, it is used for investigate problems with webservice requests.
|
15
|
+
# @return [Guid] Globally Unique Identifier.
|
16
|
+
# @param Optional
|
17
|
+
# @param Default: 00000000-0000-0000-0000-000000000000
|
18
|
+
attr_accessor :requestKey
|
19
|
+
|
20
|
+
# Initialize class and properties
|
21
|
+
def initialize()
|
22
|
+
@requestKey = '00000000-0000-0000-0000-000000000000'
|
23
|
+
@orderKey = '00000000-0000-0000-0000-000000000000'
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
data/lib/mundipagg/Recurrency.rb
CHANGED
@@ -1,38 +1,38 @@
|
|
1
|
-
module Mundipagg
|
2
|
-
# Class that hold recurrency transaction information
|
3
|
-
class Recurrency
|
4
|
-
|
5
|
-
# @return [Date] Date the first recurrency will be charged.
|
6
|
-
attr_accessor :dateToStartBilling
|
7
|
-
|
8
|
-
# @return [String] Indicating the recurrency frequency.
|
9
|
-
# @see FrequencyEnum
|
10
|
-
attr_accessor :frequencyEnum
|
11
|
-
|
12
|
-
# @return [Integer] Recurrency interval.
|
13
|
-
attr_accessor :interval
|
14
|
-
|
15
|
-
# @return [Boolean] Indicates whether the One webservice will run an OneDollarAuth
|
16
|
-
# to validate the credit card.
|
17
|
-
attr_accessor :oneDollarAuth
|
18
|
-
|
19
|
-
# @return [Integer] Number of recurrencies.
|
20
|
-
attr_accessor :recurrences
|
21
|
-
|
22
|
-
# Allowed recurrency frequency
|
23
|
-
@@FREQUENCY = {
|
24
|
-
:Monthly => 'Monthly',
|
25
|
-
:Yearly => 'Yearly',
|
26
|
-
:Daily => 'Daily'
|
27
|
-
}
|
28
|
-
|
29
|
-
# Initialize class and properties
|
30
|
-
def initialize
|
31
|
-
end
|
32
|
-
|
33
|
-
# Allowed recurrency frequency
|
34
|
-
def self.FrequencyEnum
|
35
|
-
@@FREQUENCY
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
1
|
+
module Mundipagg
|
2
|
+
# Class that hold recurrency transaction information
|
3
|
+
class Recurrency
|
4
|
+
|
5
|
+
# @return [Date] Date the first recurrency will be charged.
|
6
|
+
attr_accessor :dateToStartBilling
|
7
|
+
|
8
|
+
# @return [String] Indicating the recurrency frequency.
|
9
|
+
# @see FrequencyEnum
|
10
|
+
attr_accessor :frequencyEnum
|
11
|
+
|
12
|
+
# @return [Integer] Recurrency interval.
|
13
|
+
attr_accessor :interval
|
14
|
+
|
15
|
+
# @return [Boolean] Indicates whether the One webservice will run an OneDollarAuth
|
16
|
+
# to validate the credit card.
|
17
|
+
attr_accessor :oneDollarAuth
|
18
|
+
|
19
|
+
# @return [Integer] Number of recurrencies.
|
20
|
+
attr_accessor :recurrences
|
21
|
+
|
22
|
+
# Allowed recurrency frequency
|
23
|
+
@@FREQUENCY = {
|
24
|
+
:Monthly => 'Monthly',
|
25
|
+
:Yearly => 'Yearly',
|
26
|
+
:Daily => 'Daily'
|
27
|
+
}
|
28
|
+
|
29
|
+
# Initialize class and properties
|
30
|
+
def initialize
|
31
|
+
end
|
32
|
+
|
33
|
+
# Allowed recurrency frequency
|
34
|
+
def self.FrequencyEnum
|
35
|
+
@@FREQUENCY
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
@@ -1,15 +1,15 @@
|
|
1
|
-
module Mundipagg
|
2
|
-
class ShoppingCart
|
3
|
-
|
4
|
-
# @return [Integer] Freight value in cents
|
5
|
-
attr_accessor :freightCostInCents
|
6
|
-
|
7
|
-
# @return [Array] Array of ShopCartItens
|
8
|
-
attr_accessor :shoppingCartItemCollection
|
9
|
-
|
10
|
-
def initialize
|
11
|
-
@shoppingCartItemCollection = Array.new
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
15
|
-
end
|
1
|
+
module Mundipagg
|
2
|
+
class ShoppingCart
|
3
|
+
|
4
|
+
# @return [Integer] Freight value in cents
|
5
|
+
attr_accessor :freightCostInCents
|
6
|
+
|
7
|
+
# @return [Array] Array of ShopCartItens
|
8
|
+
attr_accessor :shoppingCartItemCollection
|
9
|
+
|
10
|
+
def initialize
|
11
|
+
@shoppingCartItemCollection = Array.new
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
@@ -1,23 +1,23 @@
|
|
1
|
-
module Mundipagg
|
2
|
-
class ShoppingCartItem
|
3
|
-
|
4
|
-
# @return [string] Item identifier
|
5
|
-
attr_accessor :itemReference
|
6
|
-
|
7
|
-
# @return [string] Item description
|
8
|
-
attr_accessor :description
|
9
|
-
|
10
|
-
# @return [string] Item name
|
11
|
-
attr_accessor :name
|
12
|
-
|
13
|
-
# @return [Integer] Quantity of itens
|
14
|
-
attr_accessor :quantity
|
15
|
-
|
16
|
-
# @return [long] Total in cents of all itens
|
17
|
-
attr_accessor :totalCostInCents
|
18
|
-
|
19
|
-
# @return [long] Item cost in cents
|
20
|
-
attr_accessor :unitCostInCents
|
21
|
-
|
22
|
-
end
|
23
|
-
end
|
1
|
+
module Mundipagg
|
2
|
+
class ShoppingCartItem
|
3
|
+
|
4
|
+
# @return [string] Item identifier
|
5
|
+
attr_accessor :itemReference
|
6
|
+
|
7
|
+
# @return [string] Item description
|
8
|
+
attr_accessor :description
|
9
|
+
|
10
|
+
# @return [string] Item name
|
11
|
+
attr_accessor :name
|
12
|
+
|
13
|
+
# @return [Integer] Quantity of itens
|
14
|
+
attr_accessor :quantity
|
15
|
+
|
16
|
+
# @return [long] Total in cents of all itens
|
17
|
+
attr_accessor :totalCostInCents
|
18
|
+
|
19
|
+
# @return [long] Item cost in cents
|
20
|
+
attr_accessor :unitCostInCents
|
21
|
+
|
22
|
+
end
|
23
|
+
end
|