-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Shopper Insights - Added Presentment Details Object and Update Presen…
…ted Events (#1484) * Added presentment details and events * Addressed PR comments * Added doc strings * Updated CHANGELOG and unit tests * Addressed PR comments * Addressed PR comments * Fixed failing tests * Removed test from bad merge * Fixed failing unit test * Added unit tests * Added missing unit tests * Updated `buttonOrder` and doc strings * Removed `experimentType` * Updated doc strings * Fixed failing tests * Remove experimentType * Create functions to toggle the paypal or venmo buttons and send presentment analytics at the correct time. * Update docs * Re add functions that were deleted. Chnage accessor for func used in unit test * Reverse changes to PayPalClient * Remove trailing white space * Update Sources/BraintreeShopperInsights/BTPresentmentDetails.swift * Update * Update CHANGELOG.md --------- Co-authored-by: Justin Warmkessel <Jwarmkessel@paypal.com> Co-authored-by: Jax DesMarais-Leder <jdesmarais@paypal.com>
- Loading branch information
1 parent
b02bb43
commit 365a059
Showing
18 changed files
with
333 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import Foundation | ||
|
||
/// The order or ranking in which payment buttons appear. | ||
/// - Warning: This module is in beta. It's public API may change or be removed in future releases. | ||
public enum BTButtonOrder: String { | ||
|
||
/// First place | ||
case first = "1" | ||
|
||
/// Second place | ||
case second = "2" | ||
|
||
/// Third place | ||
case third = "3" | ||
|
||
/// Fourth place | ||
case fourth = "4" | ||
|
||
/// Fifth place | ||
case fifth = "5" | ||
|
||
/// Sixth place | ||
case sixth = "6" | ||
|
||
/// Seventh place | ||
case seventh = "7" | ||
|
||
/// Eighth place | ||
case eighth = "8" | ||
|
||
/// Greater than Eighth place | ||
case other = "other" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Foundation | ||
|
||
/// The type of button displayed or presented | ||
/// Warning: This module is in beta. It's public API may change or be removed in future releases. | ||
public enum BTButtonType: String { | ||
|
||
/// PayPal button | ||
case payPal = "PayPal" | ||
|
||
/// Venmo button | ||
case venmo = "Venmo" | ||
|
||
/// All button types other than PayPal or Venmo | ||
case other = "Other" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import Foundation | ||
|
||
/// The experiment type that is sent to analytics to help improve the Shopper Insights feature experience. | ||
/// - Warning: This module is in beta. It's public API may change or be removed in future releases. | ||
public enum BTExperimentType: String { | ||
|
||
/// The test experiment | ||
case test | ||
|
||
/// The control experiment | ||
case control | ||
|
||
public var formattedExperiment: String { | ||
""" | ||
[ | ||
{ "exp_name" : "PaymentReady" } | ||
{ "treatment_name" : "\(self.rawValue)" } | ||
] | ||
""" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import Foundation | ||
|
||
/// The type of page where the payment button is displayed or where an event occured. | ||
/// - Warning: This module is in beta. It's public API may change or be removed in future releases. | ||
public enum BTPageType: String { | ||
|
||
/// A home page is the primary landing page that a visitor will view when they navigate to a website. | ||
case homepage = "homepage" | ||
|
||
/// An About page is a section on a website that provides information about a company, organization, or individual. | ||
case about = "about" | ||
|
||
/// A contact page is a page on a website for visitors to contact the organization or individual providing the website. | ||
case contact = "contact" | ||
|
||
/// An intermediary step that users pass through on their way to a product-listing page that doesn't provide a complete | ||
/// list of products but may showcase a few products and provide links to product subcategories. | ||
case productCategory = "product_category" | ||
|
||
/// A product detail page (PDP) is a web page that outlines everything customers and buyers need to know about a | ||
/// particular product. | ||
case productDetails = "product_details" | ||
|
||
/// The page a user sees after entering a search query. | ||
case search = "search" | ||
|
||
/// A cart is a digital shopping cart that allows buyers to inspect and organize items they plan to buy. | ||
case cart = "cart" | ||
|
||
/// A checkout page is the page related to payment and shipping/billing details on an eCommerce store. | ||
case checkout = "checkout" | ||
|
||
/// An order review page gives the buyer an overview of the goods or services that they have selected and summarizes | ||
/// the order that they are about to place. | ||
case orderReview = "order_review" | ||
|
||
/// The order confirmation page summarizes an order after checkout completes. | ||
case orderConfirmation = "order_confirmation" | ||
|
||
/// Popup cart displayed after “add to cart” click. | ||
case miniCart = "mini_cart" | ||
|
||
/// Any other page available on a merchant’s site. | ||
case other = "other" | ||
} |
Oops, something went wrong.