|
286 | 286 | it(@"tracks Order Completed with revenue if both total and revenue are present", ^{ |
287 | 287 | integration = [[SEGAmplitudeIntegration alloc] initWithSettings:@{ @"useLogRevenueV2" : @true } andAmplitude:amplitude andAmpRevenue:amprevenue andAmpIdentify:identify]; |
288 | 288 |
|
289 | | - SEGTrackPayload *payload = [[SEGTrackPayload alloc] initWithEvent:@"Order Completed" properties:@{ |
| 289 | + NSDictionary *props = @{ |
290 | 290 | @"checkout_id" : @"9bcf000000000000", |
291 | 291 | @"order_id" : @"50314b8e", |
292 | 292 | @"affiliation" : @"App Store", |
|
304 | 304 | @"price" : @"21.99", |
305 | 305 | @"quantity" : @"1" |
306 | 306 | } |
307 | | - } |
308 | | - context:@{} |
| 307 | + }; |
| 308 | + |
| 309 | + SEGTrackPayload *payload = [[SEGTrackPayload alloc] initWithEvent:@"Order Completed" properties:props context:@{} |
309 | 310 | integrations:@{}]; |
310 | 311 |
|
311 | 312 | [integration track:payload]; |
312 | 313 | [[verify(amprevenue) setPrice:@8] setQuantity:1]; |
| 314 | + [verify(amprevenue) setEventProperties:props]; |
313 | 315 | [verify(amplitude) logRevenueV2:amprevenue]; |
314 | 316 | }); |
315 | 317 |
|
316 | 318 | it(@"tracks Order Completed with total if revenue is not present", ^{ |
317 | 319 | integration = [[SEGAmplitudeIntegration alloc] initWithSettings:@{ @"useLogRevenueV2" : @true } andAmplitude:amplitude andAmpRevenue:amprevenue andAmpIdentify:identify]; |
318 | 320 |
|
319 | | - SEGTrackPayload *payload = [[SEGTrackPayload alloc] initWithEvent:@"Order Completed" properties:@{ |
| 321 | + NSDictionary *props = @{ |
320 | 322 | @"checkout_id" : @"9bcf000000000000", |
321 | 323 | @"order_id" : @"50314b8e", |
322 | 324 | @"affiliation" : @"App Store", |
|
333 | 335 | @"price" : @"21.99", |
334 | 336 | @"quantity" : @"1" |
335 | 337 | } |
336 | | - } |
| 338 | + }; |
| 339 | + |
| 340 | + SEGTrackPayload *payload = [[SEGTrackPayload alloc] initWithEvent:@"Order Completed" properties:props |
337 | 341 | context:@{} |
338 | 342 | integrations:@{}]; |
339 | 343 |
|
340 | 344 | [integration track:payload]; |
341 | 345 | [[verify(amprevenue) setPrice:@30.45] setQuantity:1]; |
| 346 | + [verify(amprevenue) setEventProperties:props]; |
342 | 347 | [verify(amplitude) logRevenueV2:amprevenue]; |
343 | 348 | }); |
344 | 349 |
|
345 | 350 | it(@"tracks Order Completed with revenue of type String", ^{ |
346 | 351 | integration = [[SEGAmplitudeIntegration alloc] initWithSettings:@{ @"useLogRevenueV2" : @true } andAmplitude:amplitude andAmpRevenue:amprevenue andAmpIdentify:identify]; |
347 | 352 |
|
348 | | - SEGTrackPayload *payload = [[SEGTrackPayload alloc] initWithEvent:@"Order Completed" properties:@{ |
| 353 | + NSDictionary *props = @{ |
349 | 354 | @"checkout_id" : @"9bcf000000000000", |
350 | 355 | @"order_id" : @"50314b8e", |
351 | 356 | @"affiliation" : @"App Store", |
|
363 | 368 | @"price" : @"21.99", |
364 | 369 | @"quantity" : @"1" |
365 | 370 | } |
366 | | - } |
367 | | - context:@{} |
| 371 | + }; |
| 372 | + |
| 373 | + SEGTrackPayload *payload = [[SEGTrackPayload alloc] initWithEvent:@"Order Completed" properties:props context:@{} |
368 | 374 | integrations:@{}]; |
369 | 375 |
|
370 | 376 | [integration track:payload]; |
371 | 377 | [[verify(amprevenue) setPrice:@8] setQuantity:1]; |
| 378 | + [verify(amprevenue) setEventProperties:props]; |
372 | 379 | [verify(amplitude) logRevenueV2:amprevenue]; |
373 | 380 | }); |
374 | 381 |
|
|
0 commit comments