Module: Cart
- Included in:
- TessituraRest
- Defined in:
- lib/tessitura_rest/web/cart.rb
Instance Method Summary collapse
- #add_contribution(session_key, amount, fund, membership_level, renew = nil, upgrade = nil, options = {}) ⇒ Object
- #add_gift_certificate(session_key, amount, name, notes, gift_certificate_type, options = {}) ⇒ Object
- #add_nfs_package_item(session_key, nfs_package_line_item_id, performance_id, performance_group_id, price_type, package_id, number_of_seats, zone_id, leave_single_seats, unseated, options = {}) ⇒ Object
- #add_on_account(session_key, amount, payment_method_id, options = {}) ⇒ Object
- #add_or_update_fee(session_key, action, fee_id, item_fee_id = nil, amount = nil, options = {}) ⇒ Object
- #add_order_comment(session_key, notes, solicitor = 'webapi', options = {}) ⇒ Object
- #add_package_item(session_key, price_type, package_id, number_of_seats, zone_id, leave_single_seats, parent_package_line_item_id, unseated, requested_seats = nil, options = {}) ⇒ Object
- #add_sub_package_item(session_key, price_type, sub_package_id, number_of_seats, zone_id, leave_single_seats, parent_super_line_item_id, super_line_item_id, unseated, requested_seats = nil, options = {}) ⇒ Object
- #apply_gift_certificate(session_key, gift_certificate_number, amount, options = {}) ⇒ Object
- #change_mode_of_sale(session_key, code, options = {}) ⇒ Object
- #checkout(session_key, name_on_card, credit_card_number, cvv_number, credit_card_type, expiration_month, expiration_year, is_order_authorized, order_authorization_code, order_amount, allow_under_payment, options = {}) ⇒ Object
- #empty_cart(session_key, options = {}) ⇒ Object
- #get_cart(session_key, options = {}) ⇒ Object
- #get_properties(session_key, options = {}) ⇒ Object
- #order_confirm_text(session_key, options = {}) ⇒ Object
- #print_ticket_elements(session_key, order_id, ticket_design, reprint, mode, new_ticket_no = false, options = {}) ⇒ Object
- #remove_contribution(session_key, line_item_id, options = {}) ⇒ Object
- #remove_gift_certificate(session_key, gift_certificate_number, options = {}) ⇒ Object
- #remove_nfs_package_item(session_key, line_item_id, options = {}) ⇒ Object
- #remove_on_account(session_key, payment_id, options = {}) ⇒ Object
- #remove_package_item(session_key, package_id, line_item_id, options = {}) ⇒ Object
- #remove_sub_package_item(session_key, super_package_id, super_package_line_item_id, options = {}) ⇒ Object
- #remove_tickets(session_key, performance_id, line_item_id, options = {}) ⇒ Object
- #reserve_tickets(session_key, number_of_seats, perf_id, price_type, zone_id, unseated, requested_seats = nil, special_requests = nil, options = {}) ⇒ Object
- #return_tickets(session_key, return_or_donate, id, options = {}) ⇒ Object
- #un_apply_gift_certificate(session_key, gift_certificate_number, options = {}) ⇒ Object
- #update_cart_properties_custom_data(session_key, index, value, options = {}) ⇒ Object
- #update_properties(session_key, category = 0, solicitor = 'webapi', channel = 0, options = {}) ⇒ Object
- #update_source(session_key, source_no, solicitor = 'webapi', options = {}) ⇒ Object
- #validate_cart(session_key, super_package = false, fixed = false, flex = false, plan = false, options = {}) ⇒ Object
- #web_cart_text(session_key, options = {}) ⇒ Object
Instance Method Details
#add_contribution(session_key, amount, fund, membership_level, renew = nil, upgrade = nil, options = {}) ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/tessitura_rest/web/cart.rb', line 67 def add_contribution(session_key, amount, fund, membership_level, renew=nil, upgrade=nil, ={}) parameters = { 'Amount': amount, 'FundId': fund, 'Upgrade': upgrade, 'Renew': renew, 'MembershipLevelId': membership_level } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters) self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Contributions"), ) end |
#add_gift_certificate(session_key, amount, name, notes, gift_certificate_type, options = {}) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/tessitura_rest/web/cart.rb', line 33 def add_gift_certificate(session_key, amount, name, notes, gift_certificate_type, ={}) parameters = { 'Amount': amount, 'PaymentMethodId': gift_certificate_type, 'Notes': notes, 'Name': name } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters) self.class.post(base_api_endpoint("Web/Cart/#{session_key}/GiftCertificates"), ) end |
#add_nfs_package_item(session_key, nfs_package_line_item_id, performance_id, performance_group_id, price_type, package_id, number_of_seats, zone_id, leave_single_seats, unseated, options = {}) ⇒ Object
191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 |
# File 'lib/tessitura_rest/web/cart.rb', line 191 def add_nfs_package_item(session_key, nfs_package_line_item_id, performance_id, performance_group_id, price_type, package_id, number_of_seats, zone_id, leave_single_seats, unseated, ={}) parameters = { "NFSPackageLineItemId": nfs_package_line_item_id, "PriceType": price_type, "PackageId": package_id, "PerformanceId": performance_id, "PerformanceGroupId": performance_group_id, "NumberOfSeats": number_of_seats, "ZoneId": zone_id, "LeaveSingleSeats": leave_single_seats, "Unseated": unseated } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters) self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Packages/Nfs"), ) end |
#add_on_account(session_key, amount, payment_method_id, options = {}) ⇒ Object
86 87 88 89 90 91 92 93 94 95 |
# File 'lib/tessitura_rest/web/cart.rb', line 86 def add_on_account(session_key, amount, payment_method_id, ={}) parameters = { 'Amount': amount, "PaymentMethodId": payment_method_id } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters) self.class.post(base_api_endpoint("Web/Cart/#{session_key}/OnAccount"), ) end |
#add_or_update_fee(session_key, action, fee_id, item_fee_id = nil, amount = nil, options = {}) ⇒ Object
256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'lib/tessitura_rest/web/cart.rb', line 256 def add_or_update_fee(session_key, action, fee_id, item_fee_id=nil, amount=nil, ={}) parameters = { "Action": action, "ItemFeeId": item_fee_id, "FeeId": fee_id, "Amount": amount } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters) self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Fees"), ) end |
#add_order_comment(session_key, notes, solicitor = 'webapi', options = {}) ⇒ Object
130 131 132 133 134 135 136 137 138 139 |
# File 'lib/tessitura_rest/web/cart.rb', line 130 def add_order_comment(session_key, notes, solicitor='webapi', ={}) .merge!(basic_auth: @auth, headers: @headers) parameters = { "Solicitor": solicitor, "Notes": notes } .merge!(:body => parameters) self.class.put(base_api_endpoint("Web/Cart/#{session_key}/Properties"), ) end |
#add_package_item(session_key, price_type, package_id, number_of_seats, zone_id, leave_single_seats, parent_package_line_item_id, unseated, requested_seats = nil, options = {}) ⇒ Object
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/tessitura_rest/web/cart.rb', line 168 def add_package_item(session_key, price_type, package_id, number_of_seats, zone_id, leave_single_seats, parent_package_line_item_id, unseated, requested_seats=nil, ={}) parameters = { "PriceType": price_type, "PackageId": package_id, "NumberOfSeats": number_of_seats, "ZoneId": zone_id, "RequestedSeats": requested_seats, "LeaveSingleSeats": leave_single_seats, "ParentPackageLineItemId": parent_package_line_item_id, "Unseated": unseated } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters) self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Packages/Fixed"), ) end |
#add_sub_package_item(session_key, price_type, sub_package_id, number_of_seats, zone_id, leave_single_seats, parent_super_line_item_id, super_line_item_id, unseated, requested_seats = nil, options = {}) ⇒ Object
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
# File 'lib/tessitura_rest/web/cart.rb', line 214 def add_sub_package_item(session_key, price_type, sub_package_id, number_of_seats, zone_id, leave_single_seats, parent_super_line_item_id, super_line_item_id, unseated, requested_seats=nil, ={}) parameters = { "ParentSuperPackageLineItemId": parent_super_line_item_id, "SuperPackageLineItemId": super_line_item_id, "PriceType": price_type, "SubPackageId": sub_package_id, "NumberOfSeats": number_of_seats, "ZoneId": zone_id, "RequestedSeats": requested_seats, "LeaveSingleSeats": leave_single_seats, "Unseated": unseated } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters) self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Packages/Super"), ) end |
#apply_gift_certificate(session_key, gift_certificate_number, amount, options = {}) ⇒ Object
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/tessitura_rest/web/cart.rb', line 51 def apply_gift_certificate(session_key, gift_certificate_number, amount, ={}) parameters = { 'Amount': amount, 'GiftCertificateNumber': gift_certificate_number } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters) self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Payments/GiftCertificate"), ) end |
#change_mode_of_sale(session_key, code, options = {}) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/tessitura_rest/web/cart.rb', line 23 def change_mode_of_sale(session_key, code, ={}) parameters = { 'ModeOfSaleId': code } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters) self.class.put(base_api_endpoint("Web/Cart/#{session_key}/Properties"), ) end |
#checkout(session_key, name_on_card, credit_card_number, cvv_number, credit_card_type, expiration_month, expiration_year, is_order_authorized, order_authorization_code, order_amount, allow_under_payment, options = {}) ⇒ Object
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
# File 'lib/tessitura_rest/web/cart.rb', line 294 def checkout(session_key, name_on_card, credit_card_number, cvv_number, credit_card_type, expiration_month, expiration_year, , , order_amount, allow_under_payment, ={}) parameters = { "CreditCardOwner": name_on_card, "CreditCardNumber": credit_card_number, "CreditCardType": credit_card_type, "CreditCardMonth": expiration_month, "CreditCardYear": expiration_year, "Amount": order_amount, "AllowUnderPayment": allow_under_payment, "CreditCardAuthenticationCode": cvv_number, "Authorize": , "AuthorizationCode": , } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters) self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Checkout"), ) end |
#empty_cart(session_key, options = {}) ⇒ Object
8 9 10 11 |
# File 'lib/tessitura_rest/web/cart.rb', line 8 def empty_cart(session_key, ={}) .merge!(basic_auth: @auth, headers: @headers) self.class.delete(base_api_endpoint("Web/Cart/#{session_key}"), ) end |
#get_cart(session_key, options = {}) ⇒ Object
3 4 5 6 |
# File 'lib/tessitura_rest/web/cart.rb', line 3 def get_cart(session_key, ={}) .merge!(basic_auth: @auth, headers: @headers) self.class.get(base_api_endpoint("Web/Cart/#{session_key}"), ) end |
#get_properties(session_key, options = {}) ⇒ Object
102 103 104 105 |
# File 'lib/tessitura_rest/web/cart.rb', line 102 def get_properties(session_key, ={}) .merge!(basic_auth: @auth, headers: @headers) self.class.get(base_api_endpoint("Web/Cart/#{session_key}/Properties"), ) end |
#order_confirm_text(session_key, options = {}) ⇒ Object
18 19 20 21 |
# File 'lib/tessitura_rest/web/cart.rb', line 18 def order_confirm_text(session_key, ={}) .merge!(basic_auth: @auth, headers: @headers) self.class.get(base_api_endpoint("Web/Cart/#{session_key}?messageTypes=#{ENV['ORDER_CONFIRM_TEXT']}&savedCart=true"), ) end |
#print_ticket_elements(session_key, order_id, ticket_design, reprint, mode, new_ticket_no = false, options = {}) ⇒ Object
237 238 239 240 241 242 243 244 245 246 247 248 249 |
# File 'lib/tessitura_rest/web/cart.rb', line 237 def print_ticket_elements(session_key, order_id, ticket_design, reprint, mode, new_ticket_no=false, ={}) parameters = { "NewTicketNoForReprints": new_ticket_no, "ReprintTickets": reprint, "OrderId": order_id, "TicketDesignId": ticket_design, "Mode": mode } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters) self.class.post(base_api_endpoint("/Web/Cart/#{session_key}/Print/TicketElements"), ) end |
#remove_contribution(session_key, line_item_id, options = {}) ⇒ Object
81 82 83 84 |
# File 'lib/tessitura_rest/web/cart.rb', line 81 def remove_contribution(session_key, line_item_id, ={}) .merge!(basic_auth: @auth, headers: @headers) self.class.delete(base_api_endpoint("Web/Cart/#{session_key}/Contributions/#{line_item_id}"), ) end |
#remove_gift_certificate(session_key, gift_certificate_number, options = {}) ⇒ Object
46 47 48 49 |
# File 'lib/tessitura_rest/web/cart.rb', line 46 def remove_gift_certificate(session_key, gift_certificate_number, ={}) .merge!(basic_auth: @auth, headers: @headers) self.class.delete(base_api_endpoint("Web/Cart/#{session_key}/GiftCertificates/#{gift_certificate_number}"), ) end |
#remove_nfs_package_item(session_key, line_item_id, options = {}) ⇒ Object
209 210 211 212 |
# File 'lib/tessitura_rest/web/cart.rb', line 209 def remove_nfs_package_item(session_key, line_item_id, ={}) .merge!(basic_auth: @auth, headers: @headers) self.class.delete(base_api_endpoint("Web/Cart/#{session_key}/Packages/Nfs/#{line_item_id}"), ) end |
#remove_on_account(session_key, payment_id, options = {}) ⇒ Object
97 98 99 100 |
# File 'lib/tessitura_rest/web/cart.rb', line 97 def remove_on_account(session_key, payment_id, ={}) .merge!(basic_auth: @auth, headers: @headers) self.class.delete(base_api_endpoint("Web/Cart/#{session_key}/OnAccount/#{payment_id}"), ) end |
#remove_package_item(session_key, package_id, line_item_id, options = {}) ⇒ Object
186 187 188 189 |
# File 'lib/tessitura_rest/web/cart.rb', line 186 def remove_package_item(session_key, package_id, line_item_id, ={}) .merge!(basic_auth: @auth, headers: @headers) self.class.delete(base_api_endpoint("Web/Cart/#{session_key}/Packages/Fixed/#{package_id}/#{line_item_id}"), ) end |
#remove_sub_package_item(session_key, super_package_id, super_package_line_item_id, options = {}) ⇒ Object
232 233 234 235 |
# File 'lib/tessitura_rest/web/cart.rb', line 232 def remove_sub_package_item(session_key, super_package_id, super_package_line_item_id, ={}) .merge!(basic_auth: @auth, headers: @headers) self.class.delete(base_api_endpoint("Web/Cart/#{session_key}/Packages/Super/#{super_package_id}/#{super_package_line_item_id}"), ) end |
#remove_tickets(session_key, performance_id, line_item_id, options = {}) ⇒ Object
251 252 253 254 |
# File 'lib/tessitura_rest/web/cart.rb', line 251 def remove_tickets(session_key, performance_id, line_item_id, ={}) .merge!(basic_auth: @auth, headers: @headers) self.class.delete(base_api_endpoint("/Web/Cart/#{session_key}/Tickets/#{performance_id}/#{line_item_id}"), ) end |
#reserve_tickets(session_key, number_of_seats, perf_id, price_type, zone_id, unseated, requested_seats = nil, special_requests = nil, options = {}) ⇒ Object
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
# File 'lib/tessitura_rest/web/cart.rb', line 141 def reserve_tickets(session_key, number_of_seats, perf_id, price_type, zone_id, unseated, requested_seats=nil, special_requests=nil, ={}) parameters = { "PriceType": price_type, "PerformanceId": perf_id, "NumberOfSeats": number_of_seats, "ZoneId": zone_id, "SpecialRequests": special_requests, "Unseated": unseated, "RequestedSeats": requested_seats } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters) self.class.post(base_api_endpoint("/Web/Cart/#{session_key}/Tickets"), ) end |
#return_tickets(session_key, return_or_donate, id, options = {}) ⇒ Object
157 158 159 160 161 162 163 164 165 166 |
# File 'lib/tessitura_rest/web/cart.rb', line 157 def return_tickets(session_key, return_or_donate, id, ={}) parameters = { "TicketNumber": id, "ReturnOrDonate": return_or_donate } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters) self.class.post(base_api_endpoint("/Web/Cart/#{session_key}/Tickets/Return"), ) end |
#un_apply_gift_certificate(session_key, gift_certificate_number, options = {}) ⇒ Object
62 63 64 65 |
# File 'lib/tessitura_rest/web/cart.rb', line 62 def un_apply_gift_certificate(session_key, gift_certificate_number, ={}) .merge!(basic_auth: @auth, headers: @headers) self.class.delete(base_api_endpoint("Web/Cart/#{session_key}/Payments/GiftCertificate/#{gift_certificate_number}"), ) end |
#update_cart_properties_custom_data(session_key, index, value, options = {}) ⇒ Object
282 283 284 285 286 287 288 289 290 291 292 |
# File 'lib/tessitura_rest/web/cart.rb', line 282 def update_cart_properties_custom_data(session_key, index, value, ={}) parameters = { "Index": index, "Value": value } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters) put = self.class.put(base_api_endpoint("Web/Cart/#{session_key}/CustomData/#{index}"), ) put.success? end |
#update_properties(session_key, category = 0, solicitor = 'webapi', channel = 0, options = {}) ⇒ Object
107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/tessitura_rest/web/cart.rb', line 107 def update_properties(session_key, category=0, solicitor='webapi', channel=0, ={}) .merge!(basic_auth: @auth, headers: @headers) parameters = { "Solicitor": solicitor, "ChannelId": channel } parameters["CategoryId"] = category if category != 0 .merge!(:body => parameters) self.class.put(base_api_endpoint("Web/Cart/#{session_key}/Properties"), ) end |
#update_source(session_key, source_no, solicitor = 'webapi', options = {}) ⇒ Object
119 120 121 122 123 124 125 126 127 128 |
# File 'lib/tessitura_rest/web/cart.rb', line 119 def update_source(session_key, source_no, solicitor='webapi', ={}) .merge!(basic_auth: @auth, headers: @headers) parameters = { "Solicitor": solicitor, "SourceId": source_no } .merge!(:body => parameters) self.class.put(base_api_endpoint("Web/Cart/#{session_key}/Properties"), ) end |
#validate_cart(session_key, super_package = false, fixed = false, flex = false, plan = false, options = {}) ⇒ Object
269 270 271 272 273 274 275 276 277 278 279 280 |
# File 'lib/tessitura_rest/web/cart.rb', line 269 def validate_cart(session_key, super_package=false, fixed=false, flex=false, plan=false, ={}) parameters = { "ValidateSuperPackages": super_package, "ValidateFSPackages": fixed, "ValidateNFSPackages": flex, "ValidatePaymentPlan": plan } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters) self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Validate"), ) end |
#web_cart_text(session_key, options = {}) ⇒ Object
13 14 15 16 |
# File 'lib/tessitura_rest/web/cart.rb', line 13 def web_cart_text(session_key, ={}) .merge!(basic_auth: @auth, headers: @headers) self.class.get(base_api_endpoint("Web/Cart/#{session_key}/Messages?messageTypes=#{ENV['WEB_CART_TEXT']}&savedCart=false"), ) end |