api_sabeq_ps_v1 0.1.9 → 0.2.0
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/api_sabeq_ps_v1/sabeq_helpers.rb +25 -0
- data/lib/api_sabeq_ps_v1/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: bd108392dedcf47eb243d3f7afb36ef399dcfb7f07bcdccc843404fe3e8b1db5
|
|
4
|
+
data.tar.gz: e027bf7f59c0d615d2fb6f5e03c53ee5f965bde9b21257f1a4df59e5d95c2640
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 349c2f8e1abc4e6216806724e43dd067b686883b062319b9fceb19dafc11de74a729b8d9173b2f12ddd751ae905fb762953907d74df7b08b1d27c6a9b7a2ab04
|
|
7
|
+
data.tar.gz: 72eacab17f87b64a6fc2b8c68b792a6fcb8dcdd4cb2bebb42cc1735dbf0f268e203ceb02ace8ea1214142de0728507ac63585a67befcc0fb33126bbfa1a515f3
|
|
@@ -98,6 +98,21 @@ module ApiSabeqPsV1
|
|
|
98
98
|
return json_response
|
|
99
99
|
end
|
|
100
100
|
|
|
101
|
+
def sabeq_api_v1_update_parcel(verification_token, collect_money, name, phone1, phone2, content, address, area_id)
|
|
102
|
+
auth_link = SABEQ_URL + "/api/v1/parcels/#{parcel_number}"
|
|
103
|
+
auth_json = { verification_token: verification_token,
|
|
104
|
+
payment_amount: collect_money,
|
|
105
|
+
customer_name: name,
|
|
106
|
+
phone1: phone1,
|
|
107
|
+
phone2: phone2,
|
|
108
|
+
content: content,
|
|
109
|
+
address: address,
|
|
110
|
+
area_id: area_id }
|
|
111
|
+
json_response = make_patch_request(auth_link, auth_json)
|
|
112
|
+
|
|
113
|
+
return json_response
|
|
114
|
+
end
|
|
115
|
+
|
|
101
116
|
def sabeq_api_v1_cancel_parcel(verification_token, parcel_number)
|
|
102
117
|
auth_link = SABEQ_URL + "/api/v1/parcels/#{parcel_number}/cancel_parcel"
|
|
103
118
|
auth_json = { verification_token: verification_token }
|
|
@@ -127,6 +142,16 @@ module ApiSabeqPsV1
|
|
|
127
142
|
return a_response.body
|
|
128
143
|
end
|
|
129
144
|
|
|
145
|
+
def make_patch_request(url_link, json_content)
|
|
146
|
+
uri = URI.parse(url_link)
|
|
147
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
|
148
|
+
#http.use_ssl = true
|
|
149
|
+
a_request = Net::HTTP::Patch.new(uri.request_uri, REQUEST_HEADER)
|
|
150
|
+
a_request.body = json_content.to_json
|
|
151
|
+
a_response = http.request(a_request)
|
|
152
|
+
return a_response.body
|
|
153
|
+
end
|
|
154
|
+
|
|
130
155
|
def get_error_or_returned_value(json_response)
|
|
131
156
|
# check if the response has errors
|
|
132
157
|
hashed_response = JSON.parse(json_response)
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: api_sabeq_ps_v1
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ShaimaKaraki
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-03-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Its a gem for sabeq.ps API helper functionalities
|
|
14
14
|
email:
|
|
@@ -21,7 +21,7 @@ files:
|
|
|
21
21
|
- lib/api_sabeq_ps_v1/railtie.rb
|
|
22
22
|
- lib/api_sabeq_ps_v1/sabeq_helpers.rb
|
|
23
23
|
- lib/api_sabeq_ps_v1/version.rb
|
|
24
|
-
homepage: https://github.com/ShaimaKaraki/
|
|
24
|
+
homepage: https://github.com/ShaimaKaraki/api_sabeq_ps_v1.git
|
|
25
25
|
licenses:
|
|
26
26
|
- MIT
|
|
27
27
|
metadata: {}
|
|
@@ -40,7 +40,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
40
40
|
- !ruby/object:Gem::Version
|
|
41
41
|
version: '0'
|
|
42
42
|
requirements: []
|
|
43
|
-
rubygems_version: 3.
|
|
43
|
+
rubygems_version: 3.5.16
|
|
44
44
|
signing_key:
|
|
45
45
|
specification_version: 4
|
|
46
46
|
summary: gem for sabeq.ps API helper functionalities
|