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
- #apply_on_account(session_key, amount, payment_method_id, 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
- #checkout_with_tms(session_key, order_authorization_code, order_amount, allow_under_payment, payment_method_id, payment_reference, authorize, options = {}) ⇒ Object
- #checkout_with_zip(session_key, name_on_card, credit_card_number, cvv_number, credit_card_type, expiration_month, expiration_year, zip_code, 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_checkout_complete(session_key, options = {}) ⇒ Object
- #get_properties(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, get_properties_response, options = {}) ⇒ Object
- #validate_cart(session_key, super_package = false, fixed = false, flex = false, plan = false, options = {}) ⇒ Object
Instance Method Details
#add_contribution(session_key, amount, fund, membership_level, renew = nil, upgrade = nil, options = {}) ⇒ Object
61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/tessitura_rest/web/cart.rb', line 61 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
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/tessitura_rest/web/cart.rb', line 27 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
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/tessitura_rest/web/cart.rb', line 178 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.to_json, :headers => { 'Content-Type' => 'application/json' }) self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Packages/Nfs"), ) end |
#add_on_account(session_key, amount, payment_method_id, options = {}) ⇒ Object
80 81 82 83 84 85 86 87 88 89 |
# File 'lib/tessitura_rest/web/cart.rb', line 80 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
243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'lib/tessitura_rest/web/cart.rb', line 243 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
118 119 120 121 122 123 124 125 126 127 |
# File 'lib/tessitura_rest/web/cart.rb', line 118 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
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/tessitura_rest/web/cart.rb', line 156 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.to_json, :headers => { 'Content-Type' => 'application/json' }) 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
201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/tessitura_rest/web/cart.rb', line 201 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.to_json, :headers => { 'Content-Type' => 'application/json' }) self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Packages/Super"), ) end |
#apply_gift_certificate(session_key, gift_certificate_number, amount, options = {}) ⇒ Object
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/tessitura_rest/web/cart.rb', line 45 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.to_json, :headers => { 'Content-Type' => 'application/json' }) self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Payments/GiftCertificate"), ) end |
#apply_on_account(session_key, amount, payment_method_id, options = {}) ⇒ Object
91 92 93 94 95 96 97 98 99 100 |
# File 'lib/tessitura_rest/web/cart.rb', line 91 def apply_on_account(session_key, amount, payment_method_id, = {}) parameters = { 'Amount': amount, 'PaymentMethodId': payment_method_id, } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters.to_json, :headers => { 'Content-Type' => 'application/json' }) self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Payments/OnAccount"), ) end |
#change_mode_of_sale(session_key, code, options = {}) ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/tessitura_rest/web/cart.rb', line 17 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
281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 |
# File 'lib/tessitura_rest/web/cart.rb', line 281 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.to_json, :headers => { 'Content-Type' => 'application/json' }) self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Checkout"), ) end |
#checkout_with_tms(session_key, order_authorization_code, order_amount, allow_under_payment, payment_method_id, payment_reference, authorize, options = {}) ⇒ Object
300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 |
# File 'lib/tessitura_rest/web/cart.rb', line 300 def checkout_with_tms(session_key, , order_amount, allow_under_payment, payment_method_id, payment_reference, , = {}) parameters = { 'CreditCardType': payment_method_id, 'Amount': order_amount, 'AllowUnderPayment': allow_under_payment, 'Authorize': , 'ECommerce': true, 'AuthorizationCode': , 'PaymentReference': payment_reference } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters.to_json, :headers => { 'Content-Type' => 'application/json' }) self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Checkout"), ) end |
#checkout_with_zip(session_key, name_on_card, credit_card_number, cvv_number, credit_card_type, expiration_month, expiration_year, zip_code, is_order_authorized, order_authorization_code, order_amount, allow_under_payment, options = {}) ⇒ Object
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 |
# File 'lib/tessitura_rest/web/cart.rb', line 316 def checkout_with_zip(session_key, name_on_card, credit_card_number, cvv_number, credit_card_type, expiration_month, expiration_year, zip_code, , , 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': , 'ZipCode': zip_code, } .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => parameters.to_json, :headers => { 'Content-Type' => 'application/json' }) self.class.post(base_api_endpoint("Web/Cart/#{session_key}/Checkout"), ) end |
#empty_cart(session_key, options = {}) ⇒ Object
12 13 14 15 |
# File 'lib/tessitura_rest/web/cart.rb', line 12 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
2 3 4 5 |
# File 'lib/tessitura_rest/web/cart.rb', line 2 def get_cart(session_key, = {}) .merge!(basic_auth: @auth, headers: @headers) self.class.get(base_api_endpoint("Web/Cart/#{session_key}?messageTypes=-11"), ) end |
#get_checkout_complete(session_key, options = {}) ⇒ Object
7 8 9 10 |
# File 'lib/tessitura_rest/web/cart.rb', line 7 def get_checkout_complete(session_key, = {}) .merge!(basic_auth: @auth, headers: @headers) self.class.get(base_api_endpoint("Web/Cart/#{session_key}&savedCart=true"), ) end |
#get_properties(session_key, options = {}) ⇒ Object
107 108 109 110 |
# File 'lib/tessitura_rest/web/cart.rb', line 107 def get_properties(session_key, = {}) .merge!(basic_auth: @auth, headers: @headers) self.class.get(base_api_endpoint("Web/Cart/#{session_key}/Properties"), ) end |
#print_ticket_elements(session_key, order_id, ticket_design, reprint, mode, new_ticket_no = false, options = {}) ⇒ Object
224 225 226 227 228 229 230 231 232 233 234 235 236 |
# File 'lib/tessitura_rest/web/cart.rb', line 224 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
75 76 77 78 |
# File 'lib/tessitura_rest/web/cart.rb', line 75 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
40 41 42 43 |
# File 'lib/tessitura_rest/web/cart.rb', line 40 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
196 197 198 199 |
# File 'lib/tessitura_rest/web/cart.rb', line 196 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
102 103 104 105 |
# File 'lib/tessitura_rest/web/cart.rb', line 102 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
173 174 175 176 |
# File 'lib/tessitura_rest/web/cart.rb', line 173 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
219 220 221 222 |
# File 'lib/tessitura_rest/web/cart.rb', line 219 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
238 239 240 241 |
# File 'lib/tessitura_rest/web/cart.rb', line 238 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
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/tessitura_rest/web/cart.rb', line 129 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.to_json, :headers => { 'Content-Type' => 'application/json' }) self.class.post(base_api_endpoint("/Web/Cart/#{session_key}/Tickets"), ) end |
#return_tickets(session_key, return_or_donate, id, options = {}) ⇒ Object
145 146 147 148 149 150 151 152 153 154 |
# File 'lib/tessitura_rest/web/cart.rb', line 145 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
56 57 58 59 |
# File 'lib/tessitura_rest/web/cart.rb', line 56 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
269 270 271 272 273 274 275 276 277 278 279 |
# File 'lib/tessitura_rest/web/cart.rb', line 269 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, get_properties_response, options = {}) ⇒ Object
112 113 114 115 116 |
# File 'lib/tessitura_rest/web/cart.rb', line 112 def update_properties(session_key, get_properties_response, = {}) .merge!(basic_auth: @auth, headers: @headers) .merge!(:body => get_properties_response) 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
256 257 258 259 260 261 262 263 264 265 266 267 |
# File 'lib/tessitura_rest/web/cart.rb', line 256 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 |