File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,9 @@ class Orbility::ParkingRestAPI < PlaceOS::Driver
118118
119119 def add_subscription (subscription : Subscription ) : Int64 ?
120120 response = post(" /subscriberinterface/api/Subscription/Add" , headers: subscriber_auth, body: subscription.to_json)
121- basic_check(response).id
121+ resp = basic_check(response)
122+ return resp.id if resp.success?
123+ nil
122124 end
123125
124126 def update_subscription (subscription : Subscription ) : Bool
@@ -136,9 +138,11 @@ class Orbility::ParkingRestAPI < PlaceOS::Driver
136138 basic_check(response).success?
137139 end
138140
139- def add_card (card : CardUpdate ) : Int64 ?
141+ def add_card (card : CardUpdate ) : Int64
140142 response = post(" /subscriberinterface/api/Card/Add" , headers: subscriber_auth, body: card.to_json)
141- basic_check(response).id
143+ resp = basic_check(response)
144+ raise " add card failed with: #{ resp.to_pretty_json } \n adding: #{ card.to_json } " unless resp.success?
145+ resp.id
142146 end
143147
144148 def update_card (card : CardUpdate ) : Bool
You can’t perform that action at this time.
0 commit comments