Esempio n. 1
0
        public static OfferClass generateOfferClass(string issuerId, string classId)
        {
            // Define the Image Module Data
            IList <ImageModuleData> imageModulesData = new List <ImageModuleData>();
            ImageModuleData         image            = new ImageModuleData()
            {
                MainImage = new Image()
                {
                    SourceUri = new Uri()
                    {
                        UriValue    = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg",
                        Description = "Coffee beans"
                    }
                }
            };

            imageModulesData.Add(image);

            // Define Links Module Data
            IList <Uri> uris = new List <Uri>();
            Uri         uri1 = new Uri()
            {
                Description = "Nearby Locations",
                UriValue    = "http://maps.google.com/maps?q=google"
            };
            Uri uri2 = new Uri()
            {
                Description = "Call Customer Service",
                UriValue    = "tel:6505555555"
            };

            uris.Add(uri1);
            uris.Add(uri2);

            LinksModuleData linksModuleData = new LinksModuleData()
            {
                Uris = uris
            };

            // Define Text Module Data
            IList <TextModuleData> textModulesData = new List <TextModuleData>();
            TextModuleData         details         = new TextModuleData()
            {
                Header = "Details",
                Body   = "20% off one cup of coffee at all Baconrista Coffee locations.  " +
                         "Only one can be used per visit."
            };
            TextModuleData finePrint = new TextModuleData()
            {
                Header = "About Baconrista",
                Body   = "Since 2013, Baconrista Coffee has been committed to making high quality bacon coffee.  " +
                         "Visit us in our stores or online at www.baconrista.com."
            };

            textModulesData.Add(details);
            textModulesData.Add(finePrint);

            // Define Geofence locations
            IList <LatLongPoint> locations = new List <LatLongPoint>();

            locations.Add(new LatLongPoint()
            {
                Latitude = 37.422601, Longitude = -122.085286
            });
            locations.Add(new LatLongPoint()
            {
                Latitude = 37.424354, Longitude = -122.09508869999999
            });
            locations.Add(new LatLongPoint()
            {
                Latitude = 40.7406578, Longitude = -74.00208940000002
            });

            // Create Offer class
            OfferClass wobClass = new OfferClass()
            {
                Id         = issuerId + "." + classId,
                IssuerName = "Baconrista Coffee",
                Title      = "20% off one cup of coffee",
                Provider   = "Baconrista Deals",
                TitleImage = new Image()
                {
                    SourceUri = new Uri()
                    {
                        UriValue = "http://farm4.staticflickr.com/3723/11177041115_6e6a3b6f49_o.jpg"
                    }
                },
                RedemptionChannel           = "both",
                ReviewStatus                = "underReview",
                Locations                   = locations,
                AllowMultipleUsersPerObject = true,
                ImageModulesData            = imageModulesData,
                TextModulesData             = textModulesData,
                LinksModuleData             = linksModuleData
            };

            return(wobClass);
        }
    /// <summary>
    /// Generates a Loyalty Class
    /// </summary>
    /// <param name="issuerId"> </param>
    /// <param name="classId"> </param>
    /// <returns> loyaltyClass </returns>
    public static LoyaltyClass generateLoyaltyClass(string issuerId, string classId)
    {
        // Define rendering templates per view
        IList<RenderSpec> renderSpec = new List<RenderSpec>();

        RenderSpec listRenderSpec = new RenderSpec() {
          ViewName = "g_list",
          TemplateFamily = "1.loyalty_list"
        };

        RenderSpec expandedRenderSpec = new RenderSpec() {
          ViewName = "g_expanded",
          TemplateFamily = "1.loyalty_expanded"
        };

        renderSpec.Add(listRenderSpec);
        renderSpec.Add(expandedRenderSpec);

        // Define the Image Module Data
        IList<ImageModuleData> imageModulesData = new List<ImageModuleData>();
        ImageModuleData image = new ImageModuleData() {
          MainImage = new Image() {
            SourceUri = new Uri() {
              UriValue = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg",
              Description = "Coffee beans"
            }
          }
        };
        imageModulesData.Add(image);

        // Define Text Module Data
        IList<TextModuleData> textModulesData = new List<TextModuleData>();
        TextModuleData textModuleData = new TextModuleData() {
          Header = "Rewards details",
          Body = "Welcome to Baconrista rewards.  Enjoy your rewards for being a loyal customer.  " +
          "10 points for ever dollar spent.  Redeem your points for free coffee, bacon and more!"
        };
        textModulesData.Add(textModuleData);

        // Define Links Module Data
        IList<Uri> uris = new List<Uri>();
        Uri uri1 = new Uri() {
          Description = "Nearby Locations",
          UriValue = "http://maps.google.com/maps?q=google"
        };
        Uri uri2 = new Uri() {
          Description = "Call Customer Service",
          UriValue = "tel:6505555555"
        };
        uris.Add(uri1);
        uris.Add(uri2);

        LinksModuleData linksModuleData = new LinksModuleData() {
          Uris = uris
        };

        // Define Info Module
        InfoModuleData infoModuleData = new InfoModuleData() {
          HexFontColor = "#F8EDC1",
          HexBackgroundColor = "#442905",
          ShowLastUpdateTime = true
        };

        // Define general messages
        IList<WalletObjectMessage> messages = new List<WalletObjectMessage>();
        WalletObjectMessage message = new WalletObjectMessage() {
          Header = "Welcome to Banconrista Rewards!",
          Body = "Featuring our new bacon donuts.",
          Image = new Image() {
            SourceUri = new Uri() {
              UriValue = "http://farm8.staticflickr.com/7302/11177240353_115daa5729_o.jpg"
            }
          },
          ActionUri = new Uri() { UriValue = "http://baconrista.com" }
        };
        messages.Add(message);

        // Define Geofence locations
        IList<LatLongPoint> locations = new List<LatLongPoint>();
        locations.Add(new LatLongPoint() { Latitude = 37.422601, Longitude = -122.085286 });
        locations.Add(new LatLongPoint() { Latitude = 37.424354, Longitude = -122.09508869999999 });
        locations.Add(new LatLongPoint() { Latitude = 40.7406578, Longitude = -74.00208940000002 });

        // Create Loyalty class
        LoyaltyClass wobClass = new LoyaltyClass() {
          Id = issuerId + "." + classId,
          IssuerName = "Baconrista",
          ProgramName = "Baconrista Rewards",
          ProgramLogo = new Image() {
            SourceUri = new Uri() {
              UriValue = "http://farm8.staticflickr.com/7340/11177041185_a61a7f2139_o.jpg"
            }
          },
          RewardsTierLabel = "Tier",
          RewardsTier = "Gold",
          AccountNameLabel = "Member Name",
          AccountIdLabel = "Member Id",
          RenderSpecs = renderSpec,
          Messages = messages,
          ReviewStatus = "underReview",
          AllowMultipleUsersPerObject = true,
          Locations = locations,
          ImageModulesData = imageModulesData,
          InfoModuleData = infoModuleData,
          TextModulesData = textModulesData,
          LinksModuleData = linksModuleData
        };

        return wobClass;
    }
Esempio n. 3
0
    public static OfferClass generateOfferClass(string issuerId, string classId)
    {
      // Define rendering templates per view
      IList<RenderSpec> renderSpec = new List<RenderSpec>();

      RenderSpec listRenderSpec = new RenderSpec() {
        ViewName = "g_list",
        TemplateFamily = "1.offer_list"
      };

      RenderSpec expandedRenderSpec = new RenderSpec() {
        ViewName = "g_expanded",
        TemplateFamily = "1.offer_expanded"
      };

      renderSpec.Add(listRenderSpec);
      renderSpec.Add(expandedRenderSpec);

      // Define the Image Module Data
      IList<ImageModuleData> imageModulesData = new List<ImageModuleData>();
      ImageModuleData image = new ImageModuleData() {
        MainImage = new Image() {
          SourceUri = new Uri() {
            UriValue = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg",
            Description = "Coffee beans"
          }
        }
      };
      imageModulesData.Add(image);

      // Define Links Module Data
      IList<Uri> uris = new List<Uri>();
      Uri uri1 = new Uri() {
        Description = "Nearby Locations",
        UriValue = "http://maps.google.com/maps?q=google"
      };
      Uri uri2 = new Uri() {
        Description = "Call Customer Service",
        UriValue = "tel:6505555555"
      };
      uris.Add(uri1);
      uris.Add(uri2);

      LinksModuleData linksModuleData = new LinksModuleData() {
        Uris = uris
      };

      // Define Text Module Data
      IList<TextModuleData> textModulesData = new List<TextModuleData>();
      TextModuleData details = new TextModuleData() {
        Header = "Details",
        Body = "20% off one cup of coffee at all Baconrista Coffee locations.  " +
        "Only one can be used per visit."
      };
      TextModuleData finePrint = new TextModuleData() {
        Header = "About Baconrista",
        Body = "Since 2013, Baconrista Coffee has been committed to making high quality bacon coffee.  " +
        "Visit us in our stores or online at www.baconrista.com."
      };
      textModulesData.Add(details);
      textModulesData.Add(finePrint);

      // Define Geofence locations
      IList<LatLongPoint> locations = new List<LatLongPoint>();
      locations.Add(new LatLongPoint() { Latitude = 37.422601, Longitude = -122.085286 });
      locations.Add(new LatLongPoint() { Latitude = 37.424354, Longitude = -122.09508869999999 });
      locations.Add(new LatLongPoint() { Latitude = 40.7406578, Longitude = -74.00208940000002 });

      // Create Offer class
      OfferClass wobClass = new OfferClass() {
        Id = issuerId + "." + classId,
        IssuerName = "Baconrista Coffee",
        Title = "20% off one cup of coffee",
        Provider = "Baconrista Deals",
        TitleImage = new Image() {
          SourceUri = new Uri() {
            UriValue = "http://farm4.staticflickr.com/3723/11177041115_6e6a3b6f49_o.jpg"
          }
        },
        RenderSpecs = renderSpec,
        RedemptionChannel = "both",
        ReviewStatus = "underReview",
        Locations = locations,
        AllowMultipleUsersPerObject = true,
        ImageModulesData = imageModulesData,
        TextModulesData = textModulesData,
        LinksModuleData = linksModuleData
      };

      return wobClass;
    }
Esempio n. 4
0
        /// <summary>
        /// Generates a Loyalty Class
        /// </summary>
        /// <param name="issuerId"> </param>
        /// <param name="classId"> </param>
        /// <returns> loyaltyClass </returns>
        public static LoyaltyClass generateLoyaltyClass(string issuerId, string classId)
        {
            // Define the Image Module Data
            IList <ImageModuleData> imageModulesData = new List <ImageModuleData>();
            ImageModuleData         image            = new ImageModuleData()
            {
                MainImage = new Image()
                {
                    SourceUri = new Uri()
                    {
                        UriValue    = "http://farm4.staticflickr.com/3738/12440799783_3dc3c20606_b.jpg",
                        Description = "Coffee beans"
                    }
                }
            };

            imageModulesData.Add(image);

            // Define Text Module Data
            IList <TextModuleData> textModulesData = new List <TextModuleData>();
            TextModuleData         textModuleData  = new TextModuleData()
            {
                Header = "Rewards details",
                Body   = "Welcome to Baconrista rewards.  Enjoy your rewards for being a loyal customer.  " +
                         "10 points for ever dollar spent.  Redeem your points for free coffee, bacon and more!"
            };

            textModulesData.Add(textModuleData);

            // Define Links Module Data
            IList <Uri> uris = new List <Uri>();
            Uri         uri1 = new Uri()
            {
                Description = "Nearby Locations",
                UriValue    = "http://maps.google.com/maps?q=google"
            };
            Uri uri2 = new Uri()
            {
                Description = "Call Customer Service",
                UriValue    = "tel:6505555555"
            };

            uris.Add(uri1);
            uris.Add(uri2);

            LinksModuleData linksModuleData = new LinksModuleData()
            {
                Uris = uris
            };

            // Define Info Module
            InfoModuleData infoModuleData = new InfoModuleData()
            {
                HexFontColor       = "#F8EDC1",
                HexBackgroundColor = "#442905",
                ShowLastUpdateTime = true
            };

            // Define general messages
            IList <WalletObjectMessage> messages = new List <WalletObjectMessage>();
            WalletObjectMessage         message  = new WalletObjectMessage()
            {
                Header = "Welcome to Banconrista Rewards!",
                Body   = "Featuring our new bacon donuts.",
                Image  = new Image()
                {
                    SourceUri = new Uri()
                    {
                        UriValue = "http://farm8.staticflickr.com/7302/11177240353_115daa5729_o.jpg"
                    }
                },
                ActionUri = new Uri()
                {
                    UriValue = "http://baconrista.com"
                }
            };

            messages.Add(message);

            // Define Geofence locations
            IList <LatLongPoint> locations = new List <LatLongPoint>();

            locations.Add(new LatLongPoint()
            {
                Latitude = 37.422601, Longitude = -122.085286
            });
            locations.Add(new LatLongPoint()
            {
                Latitude = 37.424354, Longitude = -122.09508869999999
            });
            locations.Add(new LatLongPoint()
            {
                Latitude = 40.7406578, Longitude = -74.00208940000002
            });

            // Create Loyalty class
            LoyaltyClass wobClass = new LoyaltyClass()
            {
                Id          = issuerId + "." + classId,
                IssuerName  = "Baconrista",
                ProgramName = "Baconrista Rewards",
                ProgramLogo = new Image()
                {
                    SourceUri = new Uri()
                    {
                        UriValue = "http://farm8.staticflickr.com/7340/11177041185_a61a7f2139_o.jpg"
                    }
                },
                RewardsTierLabel            = "Tier",
                RewardsTier                 = "Gold",
                AccountNameLabel            = "Member Name",
                AccountIdLabel              = "Member Id",
                Messages                    = messages,
                ReviewStatus                = "underReview",
                AllowMultipleUsersPerObject = true,
                Locations                   = locations,
                ImageModulesData            = imageModulesData,
                InfoModuleData              = infoModuleData,
                TextModulesData             = textModulesData,
                LinksModuleData             = linksModuleData
            };

            return(wobClass);
        }