diff --git a/Braintree.podspec b/Braintree.podspec index 01086b8d05..e60494f432 100644 --- a/Braintree.podspec +++ b/Braintree.podspec @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 232bafaf10..04b99f9d0d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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()` @@ -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 diff --git a/Demo/Application/Supporting Files/Braintree-Demo-Info.plist b/Demo/Application/Supporting Files/Braintree-Demo-Info.plist index 0fff3896e4..e31abafe72 100644 --- a/Demo/Application/Supporting Files/Braintree-Demo-Info.plist +++ b/Demo/Application/Supporting Files/Braintree-Demo-Info.plist @@ -41,7 +41,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 6.25.0 + 6.26.0 CFBundleURLTypes @@ -56,7 +56,7 @@ CFBundleVersion - 6.25.0 + 6.26.0 LSApplicationQueriesSchemes com.braintreepayments.Demo.payments diff --git a/Demo/Demo.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme b/Demo/Demo.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme index 2f905023b2..fb5e346254 100644 --- a/Demo/Demo.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme +++ b/Demo/Demo.xcodeproj/xcshareddata/xcschemes/Demo.xcscheme @@ -262,6 +262,16 @@ ReferencedContainer = "container:../Braintree.xcodeproj"> + + + + CFBundlePackageType FMWK CFBundleShortVersionString - 6.25.0 + 6.26.0 CFBundleSignature ???? CFBundleVersion - 6.25.0 + 6.26.0 NSPrincipalClass diff --git a/Sources/BraintreePayPal/BTPayPalCheckoutRequest.swift b/Sources/BraintreePayPal/BTPayPalCheckoutRequest.swift index cec57840b1..6d2378c5b1 100644 --- a/Sources/BraintreePayPal/BTPayPalCheckoutRequest.swift +++ b/Sources/BraintreePayPal/BTPayPalCheckoutRequest.swift @@ -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 @@ -98,13 +101,16 @@ 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 @@ -112,6 +118,7 @@ import BraintreeCore self.offerPayLater = offerPayLater self.currencyCode = currencyCode self.requestBillingAgreement = requestBillingAgreement + self.shippingCallbackURL = shippingCallbackURL super.init(hermesPath: "v1/paypal_hermes/create_payment_resource", paymentType: .checkout) } @@ -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 diff --git a/UnitTests/BraintreePayPalTests/BTPayPalCheckoutRequest_Tests.swift b/UnitTests/BraintreePayPalTests/BTPayPalCheckoutRequest_Tests.swift index e082e120f7..4a94111ef4 100644 --- a/UnitTests/BraintreePayPalTests/BTPayPalCheckoutRequest_Tests.swift +++ b/UnitTests/BraintreePayPalTests/BTPayPalCheckoutRequest_Tests.swift @@ -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"]) + } }