pixelpay_sdk 1.0.0.pre.beta.3 → 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 +12 -1
- data/Gemfile.lock +1 -1
- data/README.md +2 -2
- data/lib/pixelpay_sdk/base/RequestBehaviour.rb +3 -0
- data/lib/pixelpay_sdk/base/ServiceBehaviour.rb +4 -1
- data/lib/pixelpay_sdk/entities/TransactionResult.rb +14 -4
- data/lib/pixelpay_sdk/models/Settings.rb +1 -0
- data/lib/pixelpay_sdk/request/CardTokenization.rb +2 -2
- data/lib/pixelpay_sdk/request/SaleTransaction.rb +7 -7
- data/lib/pixelpay_sdk/services/Transaction.rb +3 -0
- 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,17 @@ 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
|
+
|
8
19
|
## [1.0.0-beta.3] - 2023-06-08
|
9
20
|
### Added
|
10
21
|
- Se agregan campos de cuotas y puntos.
|
@@ -28,4 +39,4 @@ Tipos de cambios: `Added`, `Changed`, `Deprecated`, `Removed`, `Fixed`, `Securit
|
|
28
39
|
|
29
40
|
## [1.0.0-beta.1] - 2023-05-12
|
30
41
|
### Added
|
31
|
-
- Se publica primer version de pruebas
|
42
|
+
- Se publica primer version de pruebas.
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -5,12 +5,12 @@
|
|
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:
|
@@ -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"
|
@@ -26,6 +27,7 @@ class ServiceBehaviour
|
|
26
27
|
def initialize(settings)
|
27
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
|
@@ -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
|
|
@@ -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
|
|
@@ -63,8 +63,8 @@ class CardTokenization < RequestBehaviour
|
|
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}")
|
@@ -21,18 +21,18 @@ class SaleTransaction < PaymentTransaction
|
|
21
21
|
@points_redeem_amount = nil
|
22
22
|
end
|
23
23
|
|
24
|
-
# Set Installment service values to transaction
|
24
|
+
# Set Installment service values to transaction.
|
25
25
|
# Args:
|
26
|
-
# months (int): installment months
|
27
|
-
#
|
28
|
-
def set_installment(months,
|
26
|
+
# months (int): installment months.
|
27
|
+
# installment_type (string): The installment type.
|
28
|
+
def set_installment(months, installment_type)
|
29
29
|
@installment_months = months.to_s
|
30
|
-
@installment_type =
|
30
|
+
@installment_type = installment_type.to_s
|
31
31
|
end
|
32
32
|
|
33
|
-
# Set transaction points redeem amount
|
33
|
+
# Set transaction points redeem amount.
|
34
34
|
# Args:
|
35
|
-
# amount (float): points redeem amount
|
35
|
+
# amount (float): points redeem amount.
|
36
36
|
def with_points_redeem_amount(amount)
|
37
37
|
@points_redeem_amount = Helpers.parse_amount(amount.to_f)
|
38
38
|
end
|
@@ -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.
|
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:
|