feature: add PayPal campaign ID support - #1669
Conversation
* 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.
|
/inner source |
|
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 |
|
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
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. |
|
/ready |
saralvasquez
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
I tested all the functionality and it all works as expected! I think this is good to merge in!
@saralvasquez : removed merchant specifics |
|
@jaxdesmarais - please merge this when you get a chance, it has all the approvals |
Summary of changes
PayPalCheckoutRequest.campaigns(PayPalCampaign) to associate PayPal co-marketing campaigns with a checkout order, sent aspaypal_campaignsin thecreate_payment_resourcerequest.CustomerSessionRequest.payPalCampaigns(ShopperInsightsCampaign) to associate campaigns with a ShopperInsights v2 customer session, sent aspaypalCampaignsin theCreateCustomerSession/UpdateCustomerSessionGraphQL mutations.AI Usage
Which AI Agent Was Used?
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
Checklist
Authors
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:
/inner sourceon this PR — this will automatically add theinner sourceandtech lead review requiredlabels. Open the PR in a draft state./readyon this PR — this will automatically remove thetech lead review requiredlabel. Move the PR to ready to review.Inner Source Checklist