Skip to content

Commit

Permalink
chore: Update Klarna SDK in the Debug App (#835)
Browse files Browse the repository at this point in the history
* Dont add captureVaultedCardCvv unless it is true

* Rename one time payment to enableKlarnaEMD

* Update Klarna to remot eversion
  • Loading branch information
NQuinn27 authored Apr 11, 2024
1 parent f1317b9 commit b256ffe
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions Debug App/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ PODS:
- IQKeyboardManagerSwift (7.0.2)
- Primer3DS (2.3.2)
- PrimerIPay88MYSDK (0.1.7)
- PrimerKlarnaSDK (1.1.0)
- PrimerKlarnaSDK (1.1.1)
- PrimerNolPaySDK (1.0.1)
- PrimerSDK (2.26.0):
- PrimerSDK/Core (= 2.26.0)
Expand Down Expand Up @@ -32,7 +32,7 @@ SPEC CHECKSUMS:
IQKeyboardManagerSwift: d338c11a896e9f29603443700c4567e32f830c22
Primer3DS: 81e7969033230c7346a517cd609be956914738bb
PrimerIPay88MYSDK: 436ee0be7e2c97e4e81456ccddee20175e9e3c4d
PrimerKlarnaSDK: 83e9a1357a7247bf8fa2836fc945cf97644d601d
PrimerKlarnaSDK: 564105170cc7b467bf95c31851813ea41c468f8b
PrimerNolPaySDK: 08b140ed39b378a0b33b4f8746544a402175c0cc
PrimerSDK: ffa6b212c08cab4157bae5f89566ad9f89f2d613

Expand Down
46 changes: 23 additions & 23 deletions Debug App/Resources/Localized Views/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
<rect key="frame" x="20" y="20" width="374" height="3737"/>
<subviews>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="oCT-9e-d89" userLabel="Environment Stack View">
<rect key="frame" x="0.0" y="0.0" width="374" height="420.5"/>
<rect key="frame" x="0.0" y="0.0" width="374" height="369.5"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Environment" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yLn-q9-pMX">
<rect key="frame" x="0.0" y="0.0" width="374" height="33.5"/>
Expand Down Expand Up @@ -265,27 +265,10 @@
</switch>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" spacing="7" translatesAutoresizingMaskIntoConstraints="NO" id="t9m-wr-w9Y" userLabel="One time payment">
<rect key="frame" x="0.0" y="389.5" width="374" height="31"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="One time payment" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eSy-Oz-Hfs" userLabel="Apply theming">
<rect key="frame" x="0.0" y="0.0" width="318" height="31"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="wXY-Ga-dcF">
<rect key="frame" x="325" y="0.0" width="51" height="31"/>
<connections>
<action selector="oneTimePaymentValueChanged:" destination="jAd-Lg-hf8" eventType="valueChanged" id="576-Aq-wld"/>
</connections>
</switch>
</subviews>
</stackView>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="n1R-Ky-ifJ" userLabel="Test Params Stack View">
<rect key="frame" x="0.0" y="460.5" width="374" height="424.5"/>
<rect key="frame" x="0.0" y="409.5" width="374" height="424.5"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Test" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5m9-J2-Vfy">
<rect key="frame" x="0.0" y="0.0" width="374" height="33.5"/>
Expand Down Expand Up @@ -380,7 +363,7 @@
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="f7f-4e-ZPN" userLabel="SDK Settings Stack View">
<rect key="frame" x="0.0" y="925" width="374" height="556.5"/>
<rect key="frame" x="0.0" y="874" width="374" height="607.5"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="SDK Settings" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="HZ9-hO-miI">
<rect key="frame" x="0.0" y="0.0" width="374" height="33.5"/>
Expand Down Expand Up @@ -519,6 +502,23 @@
</switch>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" spacing="7" translatesAutoresizingMaskIntoConstraints="NO" id="t9m-wr-w9Y" userLabel="One time payment">
<rect key="frame" x="0.0" y="576.5" width="374" height="31"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Enable Klarna EMD" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eSy-Oz-Hfs" userLabel="Apply theming">
<rect key="frame" x="0.0" y="0.0" width="318" height="31"/>
<fontDescription key="fontDescription" type="system" weight="semibold" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="wXY-Ga-dcF">
<rect key="frame" x="325" y="0.0" width="51" height="31"/>
<connections>
<action selector="oneTimePaymentValueChanged:" destination="jAd-Lg-hf8" eventType="valueChanged" id="576-Aq-wld"/>
</connections>
</switch>
</subviews>
</stackView>
</subviews>
</stackView>
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="20" translatesAutoresizingMaskIntoConstraints="NO" id="Wmb-0A-wCB" userLabel="Order Stack View">
Expand Down Expand Up @@ -1171,10 +1171,10 @@
<outlet property="enableCVVRecaptureFlowSwitch" destination="XZa-6j-T8o" id="M4Q-x4-pMw"/>
<outlet property="environmentSegmentedControl" destination="ekZ-3s-TxK" id="SsX-7s-JaH"/>
<outlet property="environmentStackView" destination="oCT-9e-d89" id="JnB-93-2Gv"/>
<outlet property="klarnaEMDStackView" destination="t9m-wr-w9Y" id="42W-PH-dBF"/>
<outlet property="lineItemsStackView" destination="KMj-Qp-rNj" id="gVb-8g-WNx"/>
<outlet property="merchantNameTextField" destination="PHb-NY-wz8" id="59v-8M-bqS"/>
<outlet property="metadataTextField" destination="P7i-Zx-VF4" id="OA2-uc-tMJ"/>
<outlet property="oneTimePaymentStackView" destination="t9m-wr-w9Y" id="42W-PH-dBF"/>
<outlet property="orderIdTextField" destination="1XS-HX-uUR" id="H3x-3f-S4P"/>
<outlet property="orderStackView" destination="Wmb-0A-wCB" id="Pbr-Sp-L9J"/>
<outlet property="primerHeadlessSDKButton" destination="0FS-cB-H3t" id="j9d-hB-VMw"/>
Expand Down Expand Up @@ -1723,13 +1723,13 @@
<color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="placeholderTextColor">
<color red="0.23529411759999999" green="0.23529411759999999" blue="0.26274509800000001" alpha="0.29803921570000003" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.23529411764705882" green="0.23529411764705882" blue="0.2627450980392157" alpha="0.29803921568627451" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
<systemColor name="systemRedColor">
<color red="1" green="0.23137254900000001" blue="0.18823529410000001" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="1" green="0.23137254901960785" blue="0.18823529411764706" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</systemColor>
</resources>
</document>
2 changes: 1 addition & 1 deletion Debug App/Sources/Model/CreateClientToken.swift
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ struct ClientSessionRequestBody {
dic["extraMerchantData"] = extraMerchantData
}

if let captureVaultedCardCvv = captureVaultedCardCvv {
if let captureVaultedCardCvv = captureVaultedCardCvv, captureVaultedCardCvv == true {
dic["captureVaultedCardCvv"] = captureVaultedCardCvv
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct MerchantMockDataManager {

enum SessionType {
case generic
case oneTimePayment
case klarnaWithEMD
}

static let customerIdStorageKey = "io.primer.debug.customer-id"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class MerchantSessionAndSettingsViewController: UIViewController {
@IBOutlet weak var testParamsGroupStackView: UIStackView!
@IBOutlet weak var apiKeyStackView: UIStackView!
@IBOutlet weak var useNewWorkflowsStackView: UIStackView!
@IBOutlet weak var oneTimePaymentStackView: UIStackView!
@IBOutlet weak var klarnaEMDStackView: UIStackView!
@IBOutlet weak var clientTokenStackView: UIStackView!
@IBOutlet weak var sdkSettingsStackView: UIStackView!
@IBOutlet weak var orderStackView: UIStackView!
Expand Down Expand Up @@ -226,7 +226,7 @@ class MerchantSessionAndSettingsViewController: UIViewController {
customerStackView.isHidden = false
surchargeGroupStackView.isHidden = false
useNewWorkflowsStackView.isHidden = false
oneTimePaymentStackView.isHidden = false
klarnaEMDStackView.isHidden = false

case .clientToken:
environmentStackView.isHidden = false
Expand All @@ -238,7 +238,7 @@ class MerchantSessionAndSettingsViewController: UIViewController {
customerStackView.isHidden = true
surchargeGroupStackView.isHidden = true
useNewWorkflowsStackView.isHidden = true
oneTimePaymentStackView.isHidden = true
klarnaEMDStackView.isHidden = true

case .testScenario:
environmentStackView.isHidden = true
Expand All @@ -250,7 +250,7 @@ class MerchantSessionAndSettingsViewController: UIViewController {
customerStackView.isHidden = false
surchargeGroupStackView.isHidden = false
useNewWorkflowsStackView.isHidden = true
oneTimePaymentStackView.isHidden = true
klarnaEMDStackView.isHidden = true

testParamsStackView.isHidden = (selectedTestScenario == nil)

Expand Down Expand Up @@ -387,7 +387,7 @@ class MerchantSessionAndSettingsViewController: UIViewController {
}

@IBAction func oneTimePaymentValueChanged(_ sender: UISwitch) {
paymentSessionType = sender.isOn ? .oneTimePayment : .generic
paymentSessionType = sender.isOn ? .klarnaWithEMD : .generic
populateSessionSettingsFields()
}

Expand Down

0 comments on commit b256ffe

Please sign in to comment.