Skip to content

Commit

Permalink
Merge branch 'shopper-insights-rp2-feature' into shopper-insights-rp2…
Browse files Browse the repository at this point in the history
…-presentment

# Conflicts:
#	CHANGELOG.md
#	Sources/BraintreePayPal/BTPayPalClient.swift
  • Loading branch information
warmkesselj committed Dec 20, 2024
2 parents 0791239 + b02bb43 commit c98208d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Braintree iOS SDK Release Notes

## unreleased
* BraintreePayPal
* Add `shopperSessionID` to `BTPayPalCheckoutRequest` and `BTPayPalVaultRequest`
* BraintreeShopperInsights (BETA)
* Add `shopperSessionID` to `BTShopperInsightsClient` initializer
* Add `isPayPalAppInstalled()` and/or `isVenmoAppInstalled()`
Expand All @@ -14,8 +16,6 @@
## 6.25.0 (2024-12-11)
* BraintreePayPal
* Add `BTPayPalRequest.userPhoneNumber` optional property
* Add `shopperSessionID` to `BTPayPalCheckoutRequest` and `BTPayPalVaultRequest`
* BraintreeVenmo
* Send `url` in `event_params` for App Switch events to PayPal's analytics service (FPTI)
* BraintreeVenmo
* Send `url` in `event_params` for App Switch events to PayPal's analytics service (FPTI)
Expand Down
46 changes: 23 additions & 23 deletions Sources/BraintreePayPal/BTPayPalClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,29 @@ import BraintreeDataCollector
performSwitchRequest(appSwitchURL: url, paymentType: paymentType, completion: completion)
}

func invokedOpenURLSuccessfully(_ success: Bool, url: URL, completion: @escaping (BTPayPalAccountNonce?, Error?) -> Void) {
if success {
apiClient.sendAnalyticsEvent(
BTPayPalAnalytics.appSwitchSucceeded,
isVaultRequest: isVaultRequest,
linkType: linkType,
payPalContextID: payPalContextID,
appSwitchURL: url
)
BTPayPalClient.payPalClient = self
appSwitchCompletion = completion
} else {
apiClient.sendAnalyticsEvent(
BTPayPalAnalytics.appSwitchFailed,
isVaultRequest: isVaultRequest,
linkType: linkType,
payPalContextID: payPalContextID,
appSwitchURL: url
)
notifyFailure(with: BTPayPalError.appSwitchFailed, completion: completion)
}
}

// MARK: - App Switch Methods

func handleReturnURL(_ url: URL) {
Expand Down Expand Up @@ -416,29 +439,6 @@ import BraintreeDataCollector
}
}

func invokedOpenURLSuccessfully(_ success: Bool, url: URL, completion: @escaping (BTPayPalAccountNonce?, Error?) -> Void) {
if success {
apiClient.sendAnalyticsEvent(
BTPayPalAnalytics.appSwitchSucceeded,
appSwitchURL: url,
isVaultRequest: isVaultRequest,
linkType: linkType,
payPalContextID: payPalContextID
)
BTPayPalClient.payPalClient = self
appSwitchCompletion = completion
} else {
apiClient.sendAnalyticsEvent(
BTPayPalAnalytics.appSwitchFailed,
appSwitchURL: url,
isVaultRequest: isVaultRequest,
linkType: linkType,
payPalContextID: payPalContextID
)
notifyFailure(with: BTPayPalError.appSwitchFailed, completion: completion)
}
}

private func performSwitchRequest(
appSwitchURL: URL,
paymentType: BTPayPalPaymentType,
Expand Down

0 comments on commit c98208d

Please sign in to comment.