api_sabeq_ps_v1 0.1.5 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/api_sabeq_ps_v1/sabeq_helpers.rb +23 -0
- data/lib/api_sabeq_ps_v1/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d00d0fa04c17706120ae1686ce26f7bf44735d8497a6c4794c439d550e11c102
|
4
|
+
data.tar.gz: af6106993f890b0934c3307e5b833df91d1fdb56ab38530fef9b64a1336888a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f4a52313a6981ec81d45f427e13d8124bf82474db79d48cce40a05633df8fff1d316c7c963ab98b1cd1d5fed56280276926e4ab6e1017a944e2ea5186b055a5
|
7
|
+
data.tar.gz: e69345ad14d79a1195dda95183e266b2a0e5a2333c18b4586a8d16a1af7715cb97351d64e27ac3af55af551207aa528aeb9047a1813841f335000a3edc6b7a3a
|
@@ -65,6 +65,29 @@ module ApiSabeqPsV1
|
|
65
65
|
return json_response
|
66
66
|
end
|
67
67
|
|
68
|
+
def sabeq_api_v1_1_create_parcel(verification_token, name, phone1, phone2, content,
|
69
|
+
payment_amount, area_id, street_id, address, service_type,
|
70
|
+
delivery_notes, special_notes)
|
71
|
+
auth_link = SABEQ_URL + "/api/v1/parcels"
|
72
|
+
auth_json = { verification_token: verification_token,
|
73
|
+
name: name, phone1: phone1, phone2: phone2,
|
74
|
+
content: content, payment_amount: payment_amount,
|
75
|
+
area_id: area_id, street_id: street_id, address: address,
|
76
|
+
service_type: service_type,
|
77
|
+
delivery_notes: delivery_notes,
|
78
|
+
special_notes: special_notes }
|
79
|
+
json_response = make_post_request(auth_link, auth_json)
|
80
|
+
|
81
|
+
return json_response
|
82
|
+
end
|
83
|
+
|
84
|
+
def sabeq_api_v1_cancel_parcel(verification_token, parcel_number)
|
85
|
+
auth_link = SABEQ_URL + "/api/v1/parcels/#{parcel_number}/cancel_parcel"
|
86
|
+
auth_json = { verification_token: verification_token }
|
87
|
+
json_response = make_get_request(auth_link, auth_json)
|
88
|
+
return json_response
|
89
|
+
end
|
90
|
+
|
68
91
|
private
|
69
92
|
def make_post_request(url_link, json_content)
|
70
93
|
uri = URI.parse(url_link)
|
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.1.
|
4
|
+
version: 0.1.7
|
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: 2023-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Its a gem for sabeq.ps API helper functionalities
|
14
14
|
email:
|
@@ -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.3.7
|
44
44
|
signing_key:
|
45
45
|
specification_version: 4
|
46
46
|
summary: gem for sabeq.ps API helper functionalities
|