Skip to content

Commit

Permalink
Merge branch 'main' into 3ds
Browse files Browse the repository at this point in the history
  • Loading branch information
richherrera committed Jan 10, 2024
2 parents 2896471 + b39b179 commit 86b5a4e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
# PayPal iOS SDK Release Notes

## unreleased
* PaymentButtons
* Deprecate `PaymentButtonColor` `.black`, `.silver`, `.blue`, and `.darkBlue`
* Add `PaymentButtonColor.gold` for `PayPalCreditButton`

* PayPalWebPayments
* Add `vault(url:)` method to `PayPalWebCheckoutClient`
* Add `PayPalVaultResult` type to return vault result
Expand Down
2 changes: 1 addition & 1 deletion Demo/Demo/Extensions/PaymentButtonEnums+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extension PayPalButton.Color: CaseIterable {
extension PayPalCreditButton.Color: CaseIterable {

public static var allCases: [PayPalCreditButton.Color] {
[.white, .black, .darkBlue]
[.gold, .white, .black, .darkBlue]
}

static func allCasesAsString() -> [String] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ struct PayPalWebButtonsView: View {
.font(.headline)
Picker("Funding Source", selection: $selectedFundingSource) {
Text("PayPal").tag(PayPalWebCheckoutFundingSource.paypal)
Text("PayPal Credit").tag(PayPalWebCheckoutFundingSource.paylater)
Text("Pay Later").tag(PayPalWebCheckoutFundingSource.paypalCredit)
Text("PayPal Credit").tag(PayPalWebCheckoutFundingSource.paypalCredit)
Text("Pay Later").tag(PayPalWebCheckoutFundingSource.paylater)
}
.pickerStyle(SegmentedPickerStyle())

switch selectedFundingSource {
case .paypalCredit:
PayPalCreditButton.Representable(color: .black, size: .full) {
PayPalCreditButton.Representable(color: .gold, size: .full) {
payPalWebViewModel.paymentButtonTapped(funding: .paypalCredit)
}
case .paylater:
Expand Down
3 changes: 2 additions & 1 deletion Sources/PaymentButtons/PayPalCreditButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ public final class PayPalCreditButton: PaymentButton {
Available colors for PayPalCreditButton.
*/
public enum Color: String {
case gold
case white
case black
case darkBlue

var color: PaymentButtonColor {
PaymentButtonColor(rawValue: rawValue) ?? .darkBlue
PaymentButtonColor(rawValue: rawValue) ?? .white
}
}

Expand Down
10 changes: 5 additions & 5 deletions Sources/PaymentButtons/PaymentButtonColor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ public enum PaymentButtonColor: String {
/// The gold background and blue wordmark, monogram, and black text.
case gold

/// The white background and blue wordmark, monogram, and black text.
/// The white background and blue wordmark, blue border, monogram, and black text.
case white

/// The black background and monochrome wordmark, monogram, and white text.
@available(*, deprecated, message: "Deprecated color. Replace with `white` button color.")
case black

/// The silver background and blue wordmark, monogram, and black text.
@available(*, deprecated, message: "Deprecated color. Replace with `white` button color.")
case silver

/// The blue background and white wordmark, blue monogram, and white text.
@available(*, deprecated, message: "Deprecated color. Replace with `white` button color.")
case blue

/// The dark blue background with PayPal Credit wordmark and monogram.
@available(*, deprecated, message: "Deprecated color. Replace with `white` button color.")
case darkBlue

var color: UIColor {
Expand Down

0 comments on commit 86b5a4e

Please sign in to comment.