pixelpay_sdk 1.0.0.pre.beta.2 → 1.0.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +26 -1
- data/CONTRIBUTING.md +16 -0
- data/Gemfile.lock +1 -1
- data/README.md +3 -3
- data/lib/pixelpay_sdk/base/Helpers.rb +19 -13
- data/lib/pixelpay_sdk/base/RequestBehaviour.rb +3 -0
- data/lib/pixelpay_sdk/base/ServiceBehaviour.rb +9 -6
- data/lib/pixelpay_sdk/entities/TransactionResult.rb +14 -4
- data/lib/pixelpay_sdk/models/Order.rb +1 -1
- data/lib/pixelpay_sdk/models/Settings.rb +1 -0
- data/lib/pixelpay_sdk/request/CardTokenization.rb +4 -4
- data/lib/pixelpay_sdk/request/PaymentTransaction.rb +4 -4
- data/lib/pixelpay_sdk/request/SaleTransaction.rb +32 -0
- data/lib/pixelpay_sdk/request/VoidTransaction.rb +4 -1
- data/lib/pixelpay_sdk/services/Tokenization.rb +2 -2
- data/lib/pixelpay_sdk/services/Transaction.rb +9 -6
- data/lib/pixelpay_sdk/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d4b20a4b0077958eada69ed725caa66e324eb497a3973879e926b64cb95e32d
|
4
|
+
data.tar.gz: e6fb746c133ae0941f0d6cd45adf0c539fc7298cf777ce655c87478a9d49c4a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b35dfea4cb2529de9caba5e9606ec48fcdf0dceb5ae28663306f52dd7d3aadc4f438d747b8055dc679fac03fe51bfbd0a7a62e67628e384e700f84bbb318054b
|
7
|
+
data.tar.gz: a634ace97445adbb752999e160969fc050fe7e8ae2f710de39ef85b558e9a8bb60a650f8c621f49a5b1c02cae6e24bca7945097f9b1235acd65500c7a5fb01f1
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,31 @@ El formato se basa en [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
5
5
|
y este proyecto se adhiere a [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
Tipos de cambios: `Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, `Security`.
|
7
7
|
|
8
|
+
## [1.0.1] - 2023-09-21
|
9
|
+
### Removed
|
10
|
+
- Se elimina lógica de encriptación de datos de tarjeta.
|
11
|
+
|
12
|
+
## [1.0.0] - 2023-08-09
|
13
|
+
### Added
|
14
|
+
- Se agregó encriptación de datos de tarjeta.
|
15
|
+
- Se omiten los métodos de encriptación si la petición no lo requiere.
|
16
|
+
- Se arregló servicios de tokenización enviando fecha de expiración incorrecta si no se llenan los campos.
|
17
|
+
- Se agregó campos faltantes de programas en `TransactionResult`.
|
18
|
+
|
19
|
+
## [1.0.0-beta.3] - 2023-06-08
|
20
|
+
### Added
|
21
|
+
- Se agregan campos de cuotas y puntos.
|
22
|
+
- Se agrega firma de transacciones de anulación.
|
23
|
+
- Se agrega helper `object_to_hash`.
|
24
|
+
|
25
|
+
### Fixed
|
26
|
+
- Se corrige asignación de la propiedad `order_content` en la clase `PaymentTransaction`.
|
27
|
+
- Se corrige test `test_transaction_with_3ds`.
|
28
|
+
|
29
|
+
### Changed
|
30
|
+
- Se cambia estructura de helper `object_to_json`.
|
31
|
+
- Se cambia estructura de helper `verify_type`.
|
32
|
+
|
8
33
|
## [1.0.0-beta.2] - 2023-05-26
|
9
34
|
### Added
|
10
35
|
- Se agrega importación de `SaleTransaction` al archivo principal.
|
@@ -14,4 +39,4 @@ Tipos de cambios: `Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, `Securit
|
|
14
39
|
|
15
40
|
## [1.0.0-beta.1] - 2023-05-12
|
16
41
|
### Added
|
17
|
-
- Se publica primer version de pruebas
|
42
|
+
- Se publica primer version de pruebas.
|
data/CONTRIBUTING.md
CHANGED
@@ -9,3 +9,19 @@ rake test
|
|
9
9
|
```
|
10
10
|
- Agregar al `CHANGELOG.md` las descripciones del cambio.
|
11
11
|
- Crear un commit con los cambios, agregar una etiqueta con el número de versión y hacer push con los tags.
|
12
|
+
|
13
|
+
## Pruebas
|
14
|
+
Ejecutar todos los unit tests:
|
15
|
+
```bash
|
16
|
+
rake test
|
17
|
+
```
|
18
|
+
|
19
|
+
Ejecutar todos los unit tests de un archivo:
|
20
|
+
```bash
|
21
|
+
rake test TEST=test/requests/test_sale_transaction.rb
|
22
|
+
```
|
23
|
+
|
24
|
+
Ejecutar unit test en particular:
|
25
|
+
```bash
|
26
|
+
rake test TEST=test/models/test_billing.rb TESTOPTS="--name=test_empty_billing"
|
27
|
+
```
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -5,15 +5,15 @@
|
|
5
5
|
Para obtener la versión del SDK de PixelPay con Ruby puedes utilizar este comando para instalar directamente:
|
6
6
|
|
7
7
|
``` bash
|
8
|
-
gem install pixelpay_sdk-1.0.
|
8
|
+
gem install pixelpay_sdk-1.0.1
|
9
9
|
```
|
10
10
|
|
11
11
|
O puedes colocar en el archivo Gemfile la siguiente línea:
|
12
12
|
``` bash
|
13
|
-
gem 'pixelpay_sdk', '~> 1.0.
|
13
|
+
gem 'pixelpay_sdk', '~> 1.0.1'
|
14
14
|
```
|
15
15
|
|
16
16
|
Y luego ejecutar:
|
17
17
|
``` bash
|
18
18
|
bundle install
|
19
|
-
```
|
19
|
+
```
|
@@ -6,17 +6,17 @@ require "json"
|
|
6
6
|
module Helpers
|
7
7
|
# Serialize object to JSON string without empties.
|
8
8
|
# Args:
|
9
|
-
# value (
|
9
|
+
# value (object): object to serialize.
|
10
10
|
# Returns
|
11
11
|
# string: JSON string.
|
12
12
|
def self.object_to_json(value)
|
13
|
-
verify_type(
|
13
|
+
verify_type(Object, value.is_a?(Object))
|
14
14
|
|
15
15
|
hash = {}
|
16
16
|
value.instance_variables.each { |var| hash[var.to_s.delete("@")] = value.instance_variable_get(var) }
|
17
17
|
|
18
18
|
hash.each do |attr_name, attr_value|
|
19
|
-
if hash[attr_name].nil? || hash[attr_name].to_s.empty? ||
|
19
|
+
if hash[attr_name].nil? || hash[attr_name].to_s.empty? || (attr_value.is_a?(Array) && attr_value.empty?) || (attr_value.is_a?(Hash) && attr_value.empty?)
|
20
20
|
hash.delete(attr_name)
|
21
21
|
end
|
22
22
|
end
|
@@ -26,6 +26,18 @@ module Helpers
|
|
26
26
|
warn("An exception occurred: #{e.message}")
|
27
27
|
end
|
28
28
|
|
29
|
+
# Serialize object to hash.
|
30
|
+
# Args:
|
31
|
+
# value (object): object to serialize.
|
32
|
+
# Returns
|
33
|
+
# hash.
|
34
|
+
def self.object_to_hash(value)
|
35
|
+
hash = {}
|
36
|
+
value.instance_variables.each { |var| hash[var.to_s.delete("@")] = value.instance_variable_get(var) }
|
37
|
+
|
38
|
+
hash
|
39
|
+
end
|
40
|
+
|
29
41
|
# Hash of a given value using the specified algorithm.
|
30
42
|
# Args:
|
31
43
|
# algorithm (string): algorithm to use (e.g. "MD5", "SHA-1", "SHA-256").
|
@@ -40,6 +52,8 @@ module Helpers
|
|
40
52
|
Digest::SHA1.hexdigest(value.to_s)
|
41
53
|
when "SHA-256"
|
42
54
|
Digest::SHA256.hexdigest(value.to_s)
|
55
|
+
when "SHA-512"
|
56
|
+
Digest::SHA512.hexdigest(value.to_s)
|
43
57
|
else
|
44
58
|
""
|
45
59
|
end
|
@@ -74,19 +88,11 @@ module Helpers
|
|
74
88
|
|
75
89
|
# Verify type of data.
|
76
90
|
# Args:
|
77
|
-
# error_type: error type to raise.
|
78
91
|
# expected: data type expected.
|
79
92
|
# flag: condition.
|
80
93
|
# Returns:
|
81
94
|
# throw an error if the condition is met
|
82
|
-
def self.verify_type(
|
83
|
-
|
84
|
-
when "TypeError"
|
85
|
-
raise TypeError, "This function only accepts parameters of type #{expected}." unless flag
|
86
|
-
when "InvalidCredentialsException"
|
87
|
-
raise InvalidCredentialsException, "This function only accepts parameters of type #{expected}." unless flag
|
88
|
-
when "InvalidTransactionTypeException"
|
89
|
-
raise InvalidTransactionTypeException, "This function only accepts parameters of type #{expected}." unless flag
|
90
|
-
end
|
95
|
+
def self.verify_type(expected, flag)
|
96
|
+
raise TypeError, "This function only accepts parameters of type #{expected}." unless flag
|
91
97
|
end
|
92
98
|
end
|
@@ -12,10 +12,13 @@ class RequestBehaviour
|
|
12
12
|
def initialize
|
13
13
|
# Environment identifier (live|test|sandbox)
|
14
14
|
@env = nil
|
15
|
+
|
15
16
|
# Transaction response messages language
|
16
17
|
@lang = I18n.locale.to_s
|
18
|
+
|
17
19
|
# SDK identifier type
|
18
20
|
@from = "sdk-ruby"
|
21
|
+
|
19
22
|
# SDK version
|
20
23
|
@sdk_version = PixelpaySdk::VERSION
|
21
24
|
|
@@ -5,6 +5,7 @@ require "json"
|
|
5
5
|
require "uri"
|
6
6
|
|
7
7
|
require_relative "../base/Helpers"
|
8
|
+
require_relative "../base/RequestBehaviour"
|
8
9
|
require_relative "../exceptions/InvalidCredentialsException"
|
9
10
|
require_relative "../responses/ErrorResponse"
|
10
11
|
require_relative "../responses/FailureResponse"
|
@@ -24,8 +25,9 @@ class ServiceBehaviour
|
|
24
25
|
|
25
26
|
# Initialize service.
|
26
27
|
def initialize(settings)
|
27
|
-
Helpers.verify_type(
|
28
|
+
Helpers.verify_type(Settings, settings.instance_of?(Settings))
|
28
29
|
|
30
|
+
# Settings service model
|
29
31
|
@settings = settings
|
30
32
|
rescue StandardError => e
|
31
33
|
warn("An exception occurred: #{e.message}")
|
@@ -86,6 +88,7 @@ class ServiceBehaviour
|
|
86
88
|
response = FailureResponse.new
|
87
89
|
response.success = false
|
88
90
|
response.message = exception.to_s
|
91
|
+
response.set_status(520)
|
89
92
|
|
90
93
|
response
|
91
94
|
end
|
@@ -100,7 +103,7 @@ class ServiceBehaviour
|
|
100
103
|
# Returns:
|
101
104
|
# req: prepared request.
|
102
105
|
def build_request(uri, method, transaction)
|
103
|
-
Helpers.verify_type(
|
106
|
+
Helpers.verify_type(RequestBehaviour, transaction.is_a?(RequestBehaviour))
|
104
107
|
|
105
108
|
if settings.auth_key.nil? || settings.auth_hash.nil?
|
106
109
|
raise InvalidCredentialsException, "The merchant credentials are not definied (key/hash)."
|
@@ -127,7 +130,7 @@ class ServiceBehaviour
|
|
127
130
|
|
128
131
|
request["Accept"] = "application/json"
|
129
132
|
request["Content-Type"] = "application/json"
|
130
|
-
request["-Agent"] = "PixelPay HTTP/3 SDK Ruby"
|
133
|
+
request["User-Agent"] = "PixelPay HTTP/3 SDK Ruby"
|
131
134
|
request["x-auth-key"] = @settings.auth_key
|
132
135
|
request["x-auth-hash"] = @settings.auth_hash
|
133
136
|
|
@@ -179,7 +182,7 @@ class ServiceBehaviour
|
|
179
182
|
# Returns:
|
180
183
|
# response: parsed response.
|
181
184
|
def put(url, body)
|
182
|
-
Helpers.verify_type(
|
185
|
+
Helpers.verify_type(RequestBehaviour, body.is_a?(RequestBehaviour))
|
183
186
|
|
184
187
|
uri = get_route(url)
|
185
188
|
req = build_request(uri, "PUT", body)
|
@@ -200,7 +203,7 @@ class ServiceBehaviour
|
|
200
203
|
# Returns:
|
201
204
|
# response: parsed response.
|
202
205
|
def delete(url, body)
|
203
|
-
Helpers.verify_type(
|
206
|
+
Helpers.verify_type(RequestBehaviour, body.is_a?(RequestBehaviour))
|
204
207
|
|
205
208
|
uri = get_route(url)
|
206
209
|
req = build_request(uri, "DELETE", body)
|
@@ -221,7 +224,7 @@ class ServiceBehaviour
|
|
221
224
|
# Returns:
|
222
225
|
# response: parsed response.
|
223
226
|
def get(url, body)
|
224
|
-
Helpers.verify_type(
|
227
|
+
Helpers.verify_type(RequestBehaviour, body.is_a?(RequestBehaviour))
|
225
228
|
|
226
229
|
uri = get_route(url)
|
227
230
|
req = build_request(uri, "GET", body)
|
@@ -8,16 +8,20 @@ require_relative "../responses/TimeoutResponse"
|
|
8
8
|
|
9
9
|
# TransactionResult provides a specific structure for a response coming from a transaction.
|
10
10
|
class TransactionResult
|
11
|
-
attr_accessor :transaction_type, :
|
12
|
-
:transaction_terminal, :transaction_merchant, :response_cvn, :response_avs,
|
13
|
-
:transaction_id, :transaction_reference, :transaction_time, :transaction_date,
|
14
|
-
:response_incomplete, :response_code, :response_time, :response_reason,
|
11
|
+
attr_accessor :transaction_type, :transaction_redeemed_points, :transaction_approved_amount, :transaction_amount,
|
12
|
+
:transaction_auth, :transaction_terminal, :transaction_merchant, :response_cvn, :response_avs,
|
13
|
+
:response_cavv, :transaction_id, :transaction_reference, :transaction_time, :transaction_date,
|
14
|
+
:response_approved, :response_incomplete, :response_code, :response_time, :response_reason,
|
15
|
+
:installment_type, :installment_months, :payment_uuid, :payment_hash
|
15
16
|
|
16
17
|
# Initialize enitity.
|
17
18
|
def initialize
|
18
19
|
# Transaction response type
|
19
20
|
@transaction_type = nil
|
20
21
|
|
22
|
+
# Transaction redeemed points
|
23
|
+
@transaction_redeemed_points = nil
|
24
|
+
|
21
25
|
# Approved amount on capture/sale
|
22
26
|
@transaction_approved_amount = nil
|
23
27
|
|
@@ -69,6 +73,12 @@ class TransactionResult
|
|
69
73
|
# Proccesor response message
|
70
74
|
@response_reason = nil
|
71
75
|
|
76
|
+
# Transaction installment type
|
77
|
+
@installment_type = nil
|
78
|
+
|
79
|
+
# Transaction installment value
|
80
|
+
@installment_months = nil
|
81
|
+
|
72
82
|
# Payment unique identifier
|
73
83
|
@payment_uuid = nil
|
74
84
|
|
@@ -59,12 +59,12 @@ class CardTokenization < RequestBehaviour
|
|
59
59
|
# CardTokenization: self.
|
60
60
|
def set_card(card)
|
61
61
|
begin
|
62
|
-
Helpers.verify_type(
|
62
|
+
Helpers.verify_type(Card, card.instance_of?(Card))
|
63
63
|
|
64
64
|
@number = Helpers.trim_value(card.number)
|
65
65
|
@cvv2 = card.cvv2
|
66
|
-
@expire_month = format("%02d", card.expire_month)
|
67
|
-
@expire_year = card.expire_year.to_s
|
66
|
+
@expire_month = format("%02d", card.expire_month) if card.expire_month != 0
|
67
|
+
@expire_year = card.expire_year.to_s if card.expire_year != 0
|
68
68
|
@cardholder = Helpers.trim_value(card.cardholder)
|
69
69
|
rescue StandardError => e
|
70
70
|
warn("An exception occurred: #{e.message}")
|
@@ -80,7 +80,7 @@ class CardTokenization < RequestBehaviour
|
|
80
80
|
# CardTokenization: self.
|
81
81
|
def set_billing(billing)
|
82
82
|
begin
|
83
|
-
Helpers.verify_type(
|
83
|
+
Helpers.verify_type(Billing, billing.instance_of?(Billing))
|
84
84
|
|
85
85
|
@address = Helpers.trim_value(billing.address)
|
86
86
|
@country = billing.country
|
@@ -98,7 +98,7 @@ class PaymentTransaction < RequestBehaviour
|
|
98
98
|
# PaymentTransaction: self.
|
99
99
|
def set_card(card)
|
100
100
|
begin
|
101
|
-
Helpers.verify_type(
|
101
|
+
Helpers.verify_type(Card, card.instance_of?(Card))
|
102
102
|
|
103
103
|
@card_number = Helpers.clean_string(card.number)
|
104
104
|
@card_cvv = card.cvv2
|
@@ -129,7 +129,7 @@ class PaymentTransaction < RequestBehaviour
|
|
129
129
|
# PaymentTransaction: self.
|
130
130
|
def set_billing(billing)
|
131
131
|
begin
|
132
|
-
Helpers.verify_type(
|
132
|
+
Helpers.verify_type(Billing, billing.instance_of?(Billing))
|
133
133
|
|
134
134
|
@billing_address = Helpers.trim_value(billing.address)
|
135
135
|
@billing_country = billing.country
|
@@ -151,14 +151,14 @@ class PaymentTransaction < RequestBehaviour
|
|
151
151
|
# PaymentTransaction: self.
|
152
152
|
def set_order(order)
|
153
153
|
begin
|
154
|
-
Helpers.verify_type(
|
154
|
+
Helpers.verify_type(Order, order.instance_of?(Order))
|
155
155
|
|
156
156
|
@order_id = order.id
|
157
157
|
@order_currency = order.currency
|
158
158
|
@order_amount = Helpers.parse_amount(order.amount)
|
159
159
|
@order_tax_amount = Helpers.parse_amount(order.tax_amount)
|
160
160
|
@order_shipping_amount = Helpers.parse_amount(order.shipping_amount)
|
161
|
-
@order_content = order.content.
|
161
|
+
@order_content = order.content.map { |item| Helpers.object_to_hash(item) }
|
162
162
|
@order_extras = order.extras.empty? ? {} : order.extras
|
163
163
|
@order_note = Helpers.trim_value(order.note)
|
164
164
|
@order_callback = order.callback_url
|
@@ -1,7 +1,39 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative "../base/Helpers"
|
3
4
|
require_relative "./PaymentTransaction"
|
4
5
|
|
5
6
|
# SaleTransaction defines a sale transaction request.
|
6
7
|
class SaleTransaction < PaymentTransaction
|
8
|
+
attr_accessor :installment_type, :installment_months, :points_redeem_amount
|
9
|
+
|
10
|
+
# Initialize request.
|
11
|
+
def initialize
|
12
|
+
super()
|
13
|
+
|
14
|
+
# Transaction installment type
|
15
|
+
@installment_type = nil
|
16
|
+
|
17
|
+
# Transaction installment value
|
18
|
+
@installment_months = nil
|
19
|
+
|
20
|
+
# Transaction total points redeem amount
|
21
|
+
@points_redeem_amount = nil
|
22
|
+
end
|
23
|
+
|
24
|
+
# Set Installment service values to transaction.
|
25
|
+
# Args:
|
26
|
+
# months (int): installment months.
|
27
|
+
# installment_type (string): The installment type.
|
28
|
+
def set_installment(months, installment_type)
|
29
|
+
@installment_months = months.to_s
|
30
|
+
@installment_type = installment_type.to_s
|
31
|
+
end
|
32
|
+
|
33
|
+
# Set transaction points redeem amount.
|
34
|
+
# Args:
|
35
|
+
# amount (float): points redeem amount.
|
36
|
+
def with_points_redeem_amount(amount)
|
37
|
+
@points_redeem_amount = Helpers.parse_amount(amount.to_f)
|
38
|
+
end
|
7
39
|
end
|
@@ -4,7 +4,7 @@ require_relative "../base/RequestBehaviour"
|
|
4
4
|
|
5
5
|
# VoidTransaction defines a void transaction request.
|
6
6
|
class VoidTransaction < RequestBehaviour
|
7
|
-
attr_accessor :payment_uuid, :void_reason
|
7
|
+
attr_accessor :payment_uuid, :void_reason, :void_signature
|
8
8
|
|
9
9
|
# Initialize request.
|
10
10
|
def initialize
|
@@ -15,5 +15,8 @@ class VoidTransaction < RequestBehaviour
|
|
15
15
|
|
16
16
|
# Reason for void the order
|
17
17
|
@void_reason = nil
|
18
|
+
|
19
|
+
# Required signature for void authentication
|
20
|
+
@void_signature = nil
|
18
21
|
end
|
19
22
|
end
|
@@ -15,7 +15,7 @@ class Tokenization < ServiceBehaviour
|
|
15
15
|
# Returns:
|
16
16
|
# Response: processed response.
|
17
17
|
def vault_card(card)
|
18
|
-
Helpers.verify_type(
|
18
|
+
Helpers.verify_type(CardTokenization, card.instance_of?(CardTokenization))
|
19
19
|
|
20
20
|
post(BASE_CARD_PATH, card)
|
21
21
|
rescue StandardError => e
|
@@ -29,7 +29,7 @@ class Tokenization < ServiceBehaviour
|
|
29
29
|
# Returns:
|
30
30
|
# Response: processed response.
|
31
31
|
def update_card(token, card)
|
32
|
-
Helpers.verify_type(
|
32
|
+
Helpers.verify_type(CardTokenization, card.instance_of?(CardTokenization))
|
33
33
|
|
34
34
|
put("#{BASE_CARD_PATH}/#{token}", card)
|
35
35
|
rescue StandardError => e
|
@@ -3,6 +3,9 @@
|
|
3
3
|
require_relative "../base/Helpers"
|
4
4
|
require_relative "../base/ServiceBehaviour"
|
5
5
|
require_relative "../request/StatusTransaction"
|
6
|
+
require_relative "../request/AuthTransaction"
|
7
|
+
require_relative "../request/CaptureTransaction"
|
8
|
+
require_relative "../request/VoidTransaction"
|
6
9
|
require_relative "../exceptions/InvalidTransactionTypeException"
|
7
10
|
|
8
11
|
# Transaction provides a specific structure for a transaction to be performed.
|
@@ -11,7 +14,7 @@ class Transaction < ServiceBehaviour
|
|
11
14
|
# Args:
|
12
15
|
# transaction (PaymentTransaction) : input.
|
13
16
|
def eval_authentication_transaction(transaction)
|
14
|
-
Helpers.verify_type(
|
17
|
+
Helpers.verify_type(PaymentTransaction, transaction.is_a?(PaymentTransaction))
|
15
18
|
|
16
19
|
if transaction.authentication_request
|
17
20
|
raise InvalidTransactionTypeException, "This platform does not support 3DS transactions."
|
@@ -26,7 +29,7 @@ class Transaction < ServiceBehaviour
|
|
26
29
|
# Returns:
|
27
30
|
# Response: processed response.
|
28
31
|
def do_sale(transaction)
|
29
|
-
Helpers.verify_type(
|
32
|
+
Helpers.verify_type(SaleTransaction, transaction.instance_of?(SaleTransaction))
|
30
33
|
|
31
34
|
err = eval_authentication_transaction(transaction)
|
32
35
|
raise InvalidTransactionTypeException, err.message if err.instance_of?(InvalidTransactionTypeException)
|
@@ -42,7 +45,7 @@ class Transaction < ServiceBehaviour
|
|
42
45
|
# Returns:
|
43
46
|
# Response: processed response.
|
44
47
|
def do_auth(transaction)
|
45
|
-
Helpers.verify_type(
|
48
|
+
Helpers.verify_type(AuthTransaction, transaction.instance_of?(AuthTransaction))
|
46
49
|
|
47
50
|
err = eval_authentication_transaction(transaction)
|
48
51
|
raise InvalidTransactionTypeException, err.message if err.instance_of?(InvalidTransactionTypeException)
|
@@ -58,7 +61,7 @@ class Transaction < ServiceBehaviour
|
|
58
61
|
# Returns:
|
59
62
|
# Response: processed response.
|
60
63
|
def do_capture(transaction)
|
61
|
-
Helpers.verify_type(
|
64
|
+
Helpers.verify_type(CaptureTransaction, transaction.instance_of?(CaptureTransaction))
|
62
65
|
|
63
66
|
post("api/v2/transaction/capture", transaction)
|
64
67
|
rescue StandardError => e
|
@@ -71,7 +74,7 @@ class Transaction < ServiceBehaviour
|
|
71
74
|
# Returns:
|
72
75
|
# Response: processed response.
|
73
76
|
def do_void(transaction)
|
74
|
-
Helpers.verify_type(
|
77
|
+
Helpers.verify_type(VoidTransaction, transaction.instance_of?(VoidTransaction))
|
75
78
|
|
76
79
|
post("api/v2/transaction/void", transaction)
|
77
80
|
rescue StandardError => e
|
@@ -84,7 +87,7 @@ class Transaction < ServiceBehaviour
|
|
84
87
|
# Returns:
|
85
88
|
# Response: processed response.
|
86
89
|
def get_status(transaction)
|
87
|
-
Helpers.verify_type(
|
90
|
+
Helpers.verify_type(StatusTransaction, transaction.instance_of?(StatusTransaction))
|
88
91
|
|
89
92
|
post("api/v2/transaction/status", transaction)
|
90
93
|
rescue StandardError => e
|
data/lib/pixelpay_sdk/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pixelpay_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sonia Villeda
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2023-
|
12
|
+
date: 2023-10-17 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description:
|
15
15
|
email:
|
@@ -86,9 +86,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
86
86
|
version: 2.6.0
|
87
87
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
88
88
|
requirements:
|
89
|
-
- - "
|
89
|
+
- - ">="
|
90
90
|
- !ruby/object:Gem::Version
|
91
|
-
version:
|
91
|
+
version: '0'
|
92
92
|
requirements: []
|
93
93
|
rubygems_version: 3.1.6
|
94
94
|
signing_key:
|