lockstep_rails 0.3.64 → 0.3.65
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/lockstep/payment.rb +16 -1
- data/lib/lockstep_rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffc2c21371e280e4b0d300d21a889b1e9604ea20868527c470cdd21858fe8c05
|
4
|
+
data.tar.gz: 2d3f226fe569acb51bf9b9ceddd2eb22c7f7ebaa3ba7e5f8d15ef78043d6c28f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '018b416e5c30156f70cc03d864ff72d112439d4aa552e174e59f8e414b3fc36a6a0809c2ff4c447c2b7b382361d3d3bcb0cfc763c2080f3dec1e2ae28d5829ee'
|
7
|
+
data.tar.gz: 6b3cb5bf9430de1269912ebbac07387f25e46806b9cc62ab6a539783a305049f8dfd9ee2513dc0d71a4edf5d55a406fd4c811579c47173fb6d88eed65e3b3894
|
@@ -2,6 +2,21 @@ class Lockstep::Payment < Lockstep::ApiRecord
|
|
2
2
|
self.model_name_uri = "v1/Payments"
|
3
3
|
self.id_ref = "payment_id"
|
4
4
|
load_schema(Schema::Payment)
|
5
|
-
|
5
|
+
ERP_WRITE = "erp_write"
|
6
|
+
ERP_WRITE_PATH_PARAMS = "erp-write"
|
6
7
|
belongs_to :connection, class_name: "Lockstep::Connection", foreign_key: :company_id
|
8
|
+
|
9
|
+
# Overriding create to support erp-write in path params
|
10
|
+
def create
|
11
|
+
if attributes_for_saving.key?(ERP_WRITE)
|
12
|
+
attributes_for_saving.delete(ERP_WRITE)
|
13
|
+
attrs = attributes_for_saving.transform_keys { |key| key.camelize(:lower) }
|
14
|
+
resp = resource.post(ERP_WRITE_PATH_PARAMS, body: attrs)
|
15
|
+
result = post_result(resp)
|
16
|
+
else
|
17
|
+
attrs = attributes_for_saving.transform_keys { |key| key.camelize(:lower) }
|
18
|
+
resp = resource.post('', body: [attrs])
|
19
|
+
result = post_result(resp)
|
20
|
+
end
|
21
|
+
end
|
7
22
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lockstep_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.65
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vivek AG
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|