Skip to content

Commit

Permalink
Add Shopper Insights feature into Settings
Browse files Browse the repository at this point in the history
  • Loading branch information
scannillo committed Dec 12, 2023
1 parent df9c4ee commit a44a61d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Demo/Application/Base/ContainmentViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ class ContainmentViewController: UIViewController {
return PayPalWebCheckoutViewController(authorization: authorization)
case "SEPADirectDebitViewController":
return SEPADirectDebitViewController(authorization: authorization)
case "ShopperInsightsViewController":
return ShopperInsightsViewController(authorization: authorization)
case "ThreeDSecureViewController":
return ThreeDSecureViewController(authorization: authorization)
case "VenmoViewController":
Expand Down
2 changes: 2 additions & 0 deletions Demo/Application/Base/Settings/Settings.bundle/Root.plist
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<string>iDEAL</string>
<string>Amex</string>
<string>SEPA Direct Debit</string>
<string>Shopper Insights</string>
</array>
<key>Values</key>
<array>
Expand All @@ -40,6 +41,7 @@
<string>IdealViewController</string>
<string>AmexViewController</string>
<string>SEPADirectDebitViewController</string>
<string>ShopperInsightsViewController</string>
</array>
</dict>
<dict>
Expand Down
4 changes: 2 additions & 2 deletions Demo/Application/Features/ShopperInsightsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import BraintreePayPal
import BraintreeVenmo
import BraintreeShopperInsights

class ShopperInsightsViewController: BaseViewController {
class ShopperInsightsViewController: PaymentButtonBaseViewController {

private let shopperInsightsClient: BTShopperInsightsClient
private let paypalClient: BTPayPalClient
Expand All @@ -26,7 +26,7 @@ class ShopperInsightsViewController: BaseViewController {
view.backgroundColor = UIColor(red: 250.0 / 255.0, green: 253.0 / 255.0, blue: 255.0 / 255.0, alpha: 1.0)

let preferredPaymentMethodsButton = UIButton(type: .system)
preferredPaymentMethodsButton.setTitle("Fetch recommended shopper insights", for: .normal)
preferredPaymentMethodsButton.setTitle("Fetch recommended payments", for: .normal)
preferredPaymentMethodsButton.translatesAutoresizingMaskIntoConstraints = false
preferredPaymentMethodsButton.addTarget(self, action: #selector(preferredPaymentMethodsButtonTapped(_:)), for: .touchUpInside)
view.addSubview(preferredPaymentMethodsButton)
Expand Down

0 comments on commit a44a61d

Please sign in to comment.