Subversion Repositories SmartDukaan

Rev

Rev 16603 | Rev 16615 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 16603 Rev 16613
Line 1... Line 1...
1
from elixir import *
1
from elixir import *
2
from dtr.storage import DataService
2
from dtr.storage import DataService
3
from dtr.storage.DataService import app_offers, app_affiliates, appmasters
3
from dtr.storage.DataService import app_offers, app_affiliates, appmasters
4
from dtr.utils.utils import AFFILIATE_OFFER_API, AFFILIATE_OFFER_DESC_API, fetchResponseUsingProxy
4
from dtr.utils.utils import AFFILIATE_OFFER_API, AFFILIATE_OFFER_DESC_API, fetchResponseUsingProxy
5
import json
5
import json
-
 
6
import math
6
 
7
 
7
AFFILIATE_ID = 1
8
AFFILIATE_ID = 1
8
DEVICE_ID = "SpiceRetail"
9
DEVICE_ID = "SpiceRetail"
9
RETAILER_CODE = 123
10
RETAILER_CODE = 123
10
ACTIVE_OFFERS = []
11
ACTIVE_OFFERS = []
Line 45... Line 46...
45
        app_offer.affiliate_offer_id = offer['offerId']
46
        app_offer.affiliate_offer_id = offer['offerId']
46
        try:
47
        try:
47
            app_offer.offer_price = float(offer['offerPrice'])
48
            app_offer.offer_price = float(offer['offerPrice'])
48
        except:
49
        except:
49
            app_offer.offer_price = 0.0
50
            app_offer.offer_price = 0.0
50
        app_offer.user_payout = round(.64 * app_offer.offer_price,0)
51
        app_offer.user_payout = math.floor(.64 * app_offer.offer_price,0)
51
        app_offer.override_payout = False
52
        app_offer.override_payout = False
52
        app_offer.overriden_payout = 0.0
53
        app_offer.overriden_payout = 0.0
53
        app_offer.app_name = offer.get('appName')
54
        app_offer.app_name = offer.get('appName')
54
        app_offer.package_name = offer.get('packageName')
55
        app_offer.package_name = offer.get('packageName')
55
        app_offer.description = input_json.get('description')
56
        app_offer.description = input_json.get('description')
Line 77... Line 78...
77
    else:
78
    else:
78
        try:
79
        try:
79
            app_offer.offer_price = float(offer['offerPrice'])
80
            app_offer.offer_price = float(offer['offerPrice'])
80
        except:
81
        except:
81
            app_offer.offer_price = 0.0
82
            app_offer.offer_price = 0.0
82
        app_offer.user_payout = round(.64 * app_offer.offer_price,0)
83
        app_offer.user_payout = math.floor(.64 * app_offer.offer_price,0)
83
        app_offer.description = input_json.get('description')
84
        app_offer.description = input_json.get('description')
84
        app_offer.shortDescription = offer.get('shortDesc')
85
        app_offer.shortDescription = offer.get('shortDesc')
85
        app_offer.longDescription = offer.get('longDesc')
86
        app_offer.longDescription = offer.get('longDesc')
86
        app_offer.link = offer.get('url')
87
        app_offer.link = offer.get('url')
87
        app_offer.offerCategory = offer.get('offerCategory')
88
        app_offer.offerCategory = offer.get('offerCategory')