Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/braintree/braintree_ios int…
Browse files Browse the repository at this point in the history
…o shopper-insights-rp2-feature

# Conflicts:
#	CHANGELOG.md
  • Loading branch information
warmkesselj committed Jan 22, 2025
2 parents 5df0119 + f1a6643 commit f0d6ec6
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Braintree.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Braintree"
s.version = "6.25.0"
s.version = "6.26.0"
s.summary = "Braintree iOS SDK: Helps you accept card and alternative payments in your iOS app."
s.description = <<-DESC
Braintree is a full-stack payments platform for developers
Expand Down
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

## unreleased
* BraintreePayPal
* Fix bug to ensure that `BTPayPalVaultRequest.userAuthenticationEmail` is not sent as an empty string
* Add `shopperSessionID` to `BTPayPalCheckoutRequest` and `BTPayPalVaultRequest`
* BraintreeThreeDSecure
* Return error if no `dfReferenceId` is returned in the 3D Secure flow
* BraintreeShopperInsights (BETA)
* Add `shopperSessionID` to `BTShopperInsightsClient` initializer
* Add `isPayPalAppInstalled()` and/or `isVenmoAppInstalled()`
Expand All @@ -15,6 +12,13 @@
* `pageType`
* `buttonOrder`
* Replace `sendPayPalSelectedEvent()` and `sendPayPalSelectedEvent()` with `sendSelectedEvent(for:)`

## 6.26.0 (2025-01-21)
* BraintreePayPal
* Fix bug to ensure that `BTPayPalVaultRequest.userAuthenticationEmail` is not sent as an empty string
* Add `shippingCallbackURL` to `BTPayPalCheckoutRequest`
* BraintreeThreeDSecure
* Return error if no `dfReferenceId` is returned in the 3D Secure flow

## 6.25.0 (2024-12-11)
* BraintreePayPal
Expand Down
4 changes: 2 additions & 2 deletions Demo/Application/Supporting Files/Braintree-Demo-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>6.25.0</string>
<string>6.26.0</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand All @@ -56,7 +56,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>6.25.0</string>
<string>6.26.0</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>com.braintreepayments.Demo.payments</string>
Expand Down
10 changes: 10 additions & 0 deletions Demo/Demo.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,16 @@
ReferencedContainer = "container:../Braintree.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "8046983D2B27C5530090878E"
BuildableName = "BraintreeShopperInsightsTests.xctest"
BlueprintName = "BraintreeShopperInsightsTests"
ReferencedContainer = "container:../Braintree.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
Expand Down
2 changes: 1 addition & 1 deletion Sources/BraintreeCore/BTCoreConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Foundation
@objcMembers public class BTCoreConstants: NSObject {

/// :nodoc: This property is exposed for internal Braintree use only. Do not use. It is not covered by Semantic Versioning and may change or be removed at any time.
public static var braintreeSDKVersion: String = "6.25.0"
public static var braintreeSDKVersion: String = "6.26.0"

/// :nodoc: This property is exposed for internal Braintree use only. Do not use. It is not covered by Semantic Versioning and may change or be removed at any time.
public static let callbackURLScheme: String = "sdk.ios.braintree"
Expand Down
4 changes: 2 additions & 2 deletions Sources/BraintreeCore/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>6.25.0</string>
<string>6.26.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>6.25.0</string>
<string>6.26.0</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
Expand Down
13 changes: 12 additions & 1 deletion Sources/BraintreePayPal/BTPayPalCheckoutRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ import BraintreeCore
/// Optional: User email to initiate a quicker authentication flow in cases where the user has a PayPal Account with the same email.
public var userAuthenticationEmail: String?

/// Optional: Server side shipping callback URL to be notified when a customer updates their shipping address or options. A callback request will be sent to the merchant server at this URL.
public var shippingCallbackURL: URL?

// MARK: - Initializer

/// Initializes a PayPal Native Checkout request
Expand All @@ -98,20 +101,24 @@ import BraintreeCore
/// See https://developer.paypal.com/docs/api/reference/currency-codes/ for a list of supported currency codes.
/// - requestBillingAgreement: Optional: If set to `true`, this enables the Checkout with Vault flow, where the customer will be prompted to consent to a billing agreement
/// during checkout. Defaults to `false`.
/// - shippingCallbackURL: Optional: Server side shipping callback URL to be notified when a customer updates their shipping address or options.
/// A callback request will be sent to the merchant server at this URL.
public init(
amount: String,
intent: BTPayPalRequestIntent = .authorize,
userAction: BTPayPalRequestUserAction = .none,
offerPayLater: Bool = false,
currencyCode: String? = nil,
requestBillingAgreement: Bool = false
requestBillingAgreement: Bool = false,
shippingCallbackURL: URL? = nil
) {
self.amount = amount
self.intent = intent
self.userAction = userAction
self.offerPayLater = offerPayLater
self.currencyCode = currencyCode
self.requestBillingAgreement = requestBillingAgreement
self.shippingCallbackURL = shippingCallbackURL

super.init(hermesPath: "v1/paypal_hermes/create_payment_resource", paymentType: .checkout)
}
Expand Down Expand Up @@ -155,6 +162,10 @@ import BraintreeCore
}
}

if let shippingCallbackURL {
baseParameters["shipping_callback_url"] = shippingCallbackURL.absoluteString
}

if shippingAddressOverride != nil {
checkoutParameters["line1"] = shippingAddressOverride?.streetAddress
checkoutParameters["line2"] = shippingAddressOverride?.extendedAddress
Expand Down
16 changes: 16 additions & 0 deletions UnitTests/BraintreePayPalTests/BTPayPalCheckoutRequest_Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -176,4 +176,20 @@ class BTPayPalCheckoutRequest_Tests: XCTestCase {

XCTAssertNil(parameters["payer_email"])
}

func testParameters_whenShippingCallbackURLNotSet_returnsParameters() {
let request = BTPayPalCheckoutRequest(amount: "1")

XCTAssertNil(request.shippingCallbackURL)
let parameters = request.parameters(with: configuration)
XCTAssertNil(parameters["shipping_callback_url"])
}

func testParameters_whitShippingCallbackURL_returnsParametersWithShippingCallbackURL() {
let request = BTPayPalCheckoutRequest(amount: "1", shippingCallbackURL: URL(string: "www.some-url.com"))

XCTAssertNotNil(request.shippingCallbackURL)
let parameters = request.parameters(with: configuration)
XCTAssertNotNil(parameters["shipping_callback_url"])
}
}

0 comments on commit f0d6ec6

Please sign in to comment.