NovaBryan/EVE_Dump
Log | Files | 📦 下载最新源码 (.zip) | Refs | README

contextualOfferDataHelpers.py (2694B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\packages\contextualOffers\common\contextualOfferDataHelpers.py
      2 
      3 
      4 def flatten_omega_prepared_message(offerInfo):
      5     return {'offerID': offerInfo['offerID'],
      6      'offerType': 'FirstTimeOmega',
      7      'purchaseTitle': offerInfo['purchaseStep']['Title'],
      8      'purchaseDescription': offerInfo['purchaseStep']['Body'],
      9      'purchaseBackground': offerInfo['purchaseStep']['Background'],
     10      'purchaseButtonLabel': offerInfo['purchaseStep']['ButtonTitle'],
     11      'purchaseURL': offerInfo['purchaseStep']['PurchaseURL'],
     12      'notificationTitle': offerInfo['notification']['Title'],
     13      'notificationBody': offerInfo['notification']['Body'],
     14      'notificationType': offerInfo['notification']['Type'],
     15      'tooltipHeader': offerInfo['tooltip']['header'],
     16      'tooltipDescription': offerInfo['tooltip']['content'],
     17      'originalPrice': offerInfo['price']['original'],
     18      'offerPrice': offerInfo['price']['offer'],
     19      'discount': offerInfo['price']['percentageOff'],
     20      'startTimestamp': offerInfo['validFrom'],
     21      'endTimestamp': offerInfo['validTo']}
     22 
     23 
     24 def make_purchase_info_object(offerID, confirmationTitle, confirmationDescription, confirmationBackground, confirmationButtonText, notificationTitle, notificationBody, notificationType):
     25     return {'offerID': offerID,
     26      'confirmationTitle': confirmationTitle,
     27      'confirmationDescription': confirmationDescription,
     28      'confirmationBackground': confirmationBackground,
     29      'confirmationButtonLabel': confirmationButtonText,
     30      'notificationTitle': notificationTitle,
     31      'notificationBody': notificationBody,
     32      'notificationType': notificationType}
     33 
     34 
     35 def make_offer_info_object(offerID, startTime, endTime, originalPrice, offerPrice, percentageOff, purchaseTitle, purchaseBody, purchaseBackground, purchaseButtonTitle, purchaseURL, notificationBody, notificationTitle, notificationType, tooltipHeader, tooltipContent):
     36     offerInfo = {'offerID': offerID,
     37      'validTo': endTime,
     38      'validFrom': startTime,
     39      'price': {'original': originalPrice,
     40                'offer': offerPrice,
     41                'percentageOff': percentageOff},
     42      'purchaseStep': {'Title': purchaseTitle,
     43                       'Body': purchaseBody,
     44                       'Background': purchaseBackground,
     45                       'PurchaseURL': purchaseURL,
     46                       'ButtonTitle': purchaseButtonTitle},
     47      'notification': {'Body': notificationBody,
     48                       'Title': notificationTitle,
     49                       'Type': notificationType},
     50      'tooltip': {'header': tooltipHeader,
     51                  'content': tooltipContent}}
     52     return offerInfo