dk_payment_gateway 1.0.3 → 1.0.5
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/lib/dk_payment_gateway/transaction_status.rb +24 -8
- data/lib/dk_payment_gateway/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7d44c45dd8c6e7fb9ca0e8d5766150a2c397e76d1f93c53b188056c51a8ede96
|
|
4
|
+
data.tar.gz: bc758c046d2febf99163e785110cdd13ca9362e5b8af3258148e33b4e9167a47
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8f36987ebbdd3c695eb30687ae5d6827c1f117afb5c5236b6e24777aac37d805fdf62c55d7d02723a3d644cc9eb146edb02cdeeabc066cc4ff76c3eb8da11b8f
|
|
7
|
+
data.tar.gz: 199d7cdb9192342e1d39606ab354090796f4f97e0bae0cfbedd04e15165cbe505f9ac7b425257c4533b04f940129c8895ae056762c5c090ea3ce7206346422ed
|
|
@@ -17,9 +17,9 @@ module DkPaymentGateway
|
|
|
17
17
|
#
|
|
18
18
|
# @return [Hash] Response containing transaction status details
|
|
19
19
|
def check_current_day_intra(params)
|
|
20
|
-
|
|
20
|
+
validate_current_day_intra_params!(params)
|
|
21
21
|
|
|
22
|
-
request_body =
|
|
22
|
+
request_body = build_current_day_intra_body(params)
|
|
23
23
|
signature_headers = generate_signature_headers(request_body)
|
|
24
24
|
|
|
25
25
|
response = client.post(
|
|
@@ -33,9 +33,9 @@ module DkPaymentGateway
|
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
def check_current_day_inter(params)
|
|
36
|
-
|
|
36
|
+
validate_current_day_inter_params!(params)
|
|
37
37
|
|
|
38
|
-
request_body =
|
|
38
|
+
request_body = build_current_day_inter_body(params)
|
|
39
39
|
signature_headers = generate_signature_headers(request_body)
|
|
40
40
|
|
|
41
41
|
response = client.post(
|
|
@@ -74,12 +74,12 @@ module DkPaymentGateway
|
|
|
74
74
|
end
|
|
75
75
|
|
|
76
76
|
# Alias for better readability
|
|
77
|
-
alias check_status
|
|
77
|
+
alias check_status check_current_day_intra
|
|
78
78
|
alias check_historical_status check_previous_days
|
|
79
79
|
|
|
80
80
|
private
|
|
81
81
|
|
|
82
|
-
def
|
|
82
|
+
def build_current_day_intra_body(params)
|
|
83
83
|
{
|
|
84
84
|
request_id: Utils.generate_request_id,
|
|
85
85
|
reference_no: params[:reference_no],
|
|
@@ -87,16 +87,24 @@ module DkPaymentGateway
|
|
|
87
87
|
}
|
|
88
88
|
end
|
|
89
89
|
|
|
90
|
+
def build_current_day_inter_body(params)
|
|
91
|
+
{
|
|
92
|
+
request_id: Utils.generate_request_id,
|
|
93
|
+
transaction_id: params[:transaction_id],
|
|
94
|
+
bene_account_number: params[:bene_account_number]
|
|
95
|
+
}
|
|
96
|
+
end
|
|
97
|
+
|
|
90
98
|
def build_previous_days_body(params)
|
|
91
99
|
{
|
|
92
100
|
request_id: Utils.generate_request_id,
|
|
93
101
|
transaction_id: params[:transaction_id],
|
|
94
|
-
|
|
102
|
+
transaction_date: params[:transaction_date],
|
|
95
103
|
bene_account_number: params[:bene_account_number]
|
|
96
104
|
}
|
|
97
105
|
end
|
|
98
106
|
|
|
99
|
-
def
|
|
107
|
+
def validate_current_day_intra_params!(params)
|
|
100
108
|
required = %i[reference_no bene_account_number]
|
|
101
109
|
|
|
102
110
|
missing = required.select { |key| params[key].nil? || params[key].to_s.empty? }
|
|
@@ -104,6 +112,14 @@ module DkPaymentGateway
|
|
|
104
112
|
raise InvalidParameterError, "Missing required parameters: #{missing.join(', ')}" unless missing.empty?
|
|
105
113
|
end
|
|
106
114
|
|
|
115
|
+
def validate_current_day_inter_params!(params)
|
|
116
|
+
required = %i[transaction_id bene_account_number]
|
|
117
|
+
|
|
118
|
+
missing = required.select { |key| params[key].nil? || params[key].to_s.empty? }
|
|
119
|
+
|
|
120
|
+
raise InvalidParameterError, "Missing required parameters: #{missing.join(', ')}" unless missing.empty?
|
|
121
|
+
end
|
|
122
|
+
|
|
107
123
|
def validate_previous_days_params!(params)
|
|
108
124
|
required = %i[transaction_id transaction_date bene_account_number]
|
|
109
125
|
|