Skip to content

feature: add PayPal campaign ID support - #1669

Merged
saralvasquez merged 7 commits into
braintree:mainfrom
santugowda:paypal-campaigns-feature-to-main
Aug 13, 2026
Merged

feature: add PayPal campaign ID support#1669
saralvasquez merged 7 commits into
braintree:mainfrom
santugowda:paypal-campaigns-feature-to-main

Conversation

@santugowda

@santugowda santugowda commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

AI Usage

Which AI Agent Was Used?

  • Claude
  • Copilot
  • Other (Type Name Here)

How was AI used?
Code generation, unit tests, and PR management for the campaign ID feature work across PayPal and ShopperInsights modules.

Estimated AI Code Contribution

  • less than 30%
  • 30 - 60%
  • 60 - 100%

Checklist

  • Added a changelog entry
  • Tested and confirmed payment flows affected by this change are functioning as expected

Authors

List GitHub usernames for everyone who contributed to this pull request.

  • santugowda

Inner Source Process

Internal to PayPal contributors should fill out this section. All others can delete.

PR should follow these steps before codeowners review will begin:

  1. Comment /inner source on this PR — this will automatically add the inner source and tech lead review required labels. Open the PR in a draft state.
  2. PR should be reviewed by and approved by your team's technical lead, we do not allow LGTM reviews, there should be comments and feedback provided on all PR reviews
  3. Once the above steps are completed, comment /ready on this PR — this will automatically remove the tech lead review required label. Move the PR to ready to review.
  4. PR comments must be addressed within 24 hours, if you are unable to address within this timeframe, move the PR back to a draft state so our team knows not to review

Inner Source Checklist

  • Added all labels to the PR
  • Provide steps to test the flows changed, if applicable in the summary
  • Demo video of the functionality, if applicable
  • All upstream dependencies are merged in and this PR can be released at any time; PRs should not be opened until this is true
  • Unit tests and builds have been run locally and pass/compile as expected

santugowda and others added 4 commits July 31, 2026 10:01
* feature(ShopperInsights): add payPalCampaigns to CustomerSessionRequest

Add PayPalCampaign model and an optional payPalCampaigns list on. CustomerSessionRequest, and build the paypal_campaigns JSON array in CustomerSessionRequestBuilder.

* pr-feedback: add null payPalCampaigns test for CustomerSessionRequestBuilder

* pr-feedback: explicitly set payPalCampaigns to null in purchaseUnits-null test

* pr-feedback: rename payPalCampaigns to campaigns per interface spec

* pr-feedback(ShopperInsights): remove campaigns CHANGELOG entry pending feature branch merge

* pr-feedback(ShopperInsights): rename to ShopperInsightsCampaign and payPalCampaigns per interface spec
* feature(PayPal): add payPalCampaigns to PayPalCheckoutRequest

Add PayPalCampaign model and a payPalCampaigns list so merchants can
associate PayPal co-marketing campaigns with a checkout order,
serialized as paypal_campaigns in the create_payment_resource body.

* pr-feedback: address review comments on payPalCampaigns

Move campaign serialization into PayPalCampaign.toJson() (internal) and
align the payPalCampaigns KDoc wording.

* pr-feedback: rename payPalCampaigns to campaigns per interface spec

* pr-feedback(PayPal): restrict campaigns to PayPalCheckoutRequest
…raintree#1649)

* feature(ShopperInsights): add payPalCampaigns to CustomerSessionRequest

Add PayPalCampaign model and an optional payPalCampaigns list on. CustomerSessionRequest, and build the paypal_campaigns JSON array in CustomerSessionRequestBuilder.

* pr-feedback: add null payPalCampaigns test for CustomerSessionRequestBuilder

* pr-feedback: explicitly set payPalCampaigns to null in purchaseUnits-null test

* pr-feedback: rename payPalCampaigns to campaigns per interface spec

* feature(ShopperInsights): send payPalCampaigns in customer session GraphQL requests

Wire the optional payPalCampaigns list into the create session, update
session, and generate recommendations GraphQL requests as paypalCampaigns
in variables.input.

* pr-feedback: rename payPalCampaigns to campaigns per interface spec

* pr-feedback(ShopperInsights): rename to ShopperInsightsCampaign and payPalCampaigns per interface spec

* pr-feedback(ShopperInsights): consolidate campaigns CHANGELOG under unreleased

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…eens (braintree#1661)

* feature(Demo): add Campaign ID input to ShopperInsights and PayPal demo screens

Wires an optional Campaign ID field into ShopperInsightsFragmentV2 (CustomerSessionRequest.payPalCampaigns)
and PayPalFragment (PayPalCheckoutRequest.campaigns) so the demo app can exercise PayPal co-marketing
campaign attribution on both surfaces.

* feature(Demo): support comma-separated list of campaign IDs

Allows entering multiple PayPal campaign IDs in the ShopperInsights and
PayPal demo screens, matching the list-based campaigns field on the
underlying request objects.
@santugowda
santugowda requested a review from a team August 6, 2026 23:21
@santugowda
santugowda requested a review from a team as a code owner August 6, 2026 23:21
@santugowda
santugowda marked this pull request as draft August 6, 2026 23:24
@santugowda

Copy link
Copy Markdown
Contributor Author

/inner source

@github-actions github-actions Bot added inner source This PR is internal to PP but external to the mobile SDK team tech lead review required labels Aug 6, 2026
@anibalb2500

Copy link
Copy Markdown
Contributor

Do failing unit tests need to be fixed? The following failed for me when I ran the following on your branch

./gradlew :BraintreeCore:connectedCheck :Card:connectedCheck :SharedUtils:connectedCheck :LocalPayment:connectedCheck :DataCollector:connectedCheck :GooglePay:connectedCheck :Demo:connectedCheck :PayPal:connectedCheck :PayPalMessaging:connectedCheck :AmericanExpress:connectedCheck :SEPADirectDebit:connectedCheck :ShopperInsights:connectedCheck :ThreeDSecure:connectedCheck :UIComponents:connectedCheck :Venmo:connectedCheck --stacktrace

@santugowda

santugowda commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for checking! These failures are pre-existing and unrelated to this PR — this PR only touches PayPal, ShopperInsights, and Demo files (campaign ID feature), but the failures are in Venmo, LocalPayment, and DataCollector:

  • VenmoClientTest.createPaymentAuthRequest_whenVenmoDisabled_returnsFailureAssertionError
  • LocalPaymentClientTest.tokenize_afterSuccessfulBrowserSwitch_returnsNonceNullPointerException on AnalyticsEvent.getName()
  • DataCollectorTest.collectDeviceDataOnSuccess_returnsSuccessWithCorrelationIdAssertionError

Same failures show up in CI on this PR too. None of these modules are touched by this change, so they look like existing flaky/instrumentation issues rather than something introduced here.

cc: @saralvasquez @jaxdesmarais

@anibalb2500

Copy link
Copy Markdown
Contributor

Thanks for checking! These failures are pre-existing and unrelated to this PR — this PR only touches PayPal, ShopperInsights, and Demo files (campaign ID feature), but the failures are in Venmo, LocalPayment, and DataCollector:

  • VenmoClientTest.createPaymentAuthRequest_whenVenmoDisabled_returnsFailureAssertionError
  • LocalPaymentClientTest.tokenize_afterSuccessfulBrowserSwitch_returnsNonceNullPointerException on AnalyticsEvent.getName()
  • DataCollectorTest.collectDeviceDataOnSuccess_returnsSuccessWithCorrelationIdAssertionError

Same failures show up in CI on this PR too. None of these modules are touched by this change, so they look like existing flaky/instrumentation issues rather than something introduced here.

Sounds good.
Changes Look Good To Me. Ready for next stage of review.

@santugowda

Copy link
Copy Markdown
Contributor Author

/ready

@santugowda
santugowda marked this pull request as ready for review August 11, 2026 20:04

@saralvasquez saralvasquez left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me! Just a small question

Are there plans to add this new field to the dev docs or something? I'm just curious how merchants are going to know about these changes and how to implement them for themselves

@noguier noguier left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested all the functionality and it all works as expected! I think this is good to merge in!

@santugowda

santugowda commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

This looks good to me! Just a small question

Are there plans to add this new field to the dev docs or something? I'm just curious how merchants are going to know about these changes and how to implement them for themselves

@saralvasquez : removed merchant specifics

@santugowda

Copy link
Copy Markdown
Contributor Author

@jaxdesmarais - please merge this when you get a chance, it has all the approvals

@saralvasquez
saralvasquez merged commit 0fbe067 into braintree:main Aug 13, 2026
22 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

inner source This PR is internal to PP but external to the mobile SDK team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants