Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/removeSnapshots.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Remove Snapshots

on:
pull_request:
types: [labeled]

jobs:
removeSnapshots:
if: github.event.label.name == 'remove-snapshots'
runs-on: ubuntu-24.04
permissions:
contents: write
issues: write
steps:
- name: Checkout PR branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
persist-credentials: true

- name: Reset snapshots to base
run: |
git remote add base https://github.com/${{ github.event.pull_request.base.repo.full_name }}.git
git fetch base ${{ github.event.pull_request.base.sha }}
git checkout ${{ github.event.pull_request.base.sha }} -- tests/functional/snapshots tests/functional/v2/snapshots

- name: Detect snapshot changes
id: changes
run: |
if [ -z "$(git status --porcelain)" ]; then
echo "hasChanges=false" >> $GITHUB_OUTPUT
else
echo "hasChanges=true" >> $GITHUB_OUTPUT
fi

- name: Commit reverted snapshots
if: steps.changes.outputs.hasChanges == 'true'
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'chore(snapshots): remove snapshots [skip ci]'
commit_options: '--no-verify --quiet'
file_pattern: tests/functional/snapshots tests/functional/v2/snapshots
push_options: '-v'

- name: Remove labels
uses: actions/github-script@v7
with:
script: |
const labels = ['remove-snapshots', 'snapshots'];
await Promise.all(
labels.map(name =>
github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
name
}).catch(() => {
console.log(`${name} label already removed`);
})
)
);
2 changes: 2 additions & 0 deletions content/modals/US/v2_short_term.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"meta": {
"product": "PAY_LATER_SHORT_TERM",
"testVal": "true",
"useV5Design": "true",
"v5.1": "true",
"periodicPayment": "{formattedPeriodicPayment}",
Expand Down Expand Up @@ -34,6 +35,7 @@
"Complete your purchase with a 25% down payment.",
"Use autopay for the rest of your payments. It's easy!"
],
"testButtonText": "Check your Spending Power",
"disclosure": [
"Pay in 4 is available to consumers upon approval for purchases of {formattedMinAmount} to {formattedMaxAmount}. Pay in 4 is currently not available to residents of <span aria-hidden='true'>MO</span><span class='sr-only'>Missouri</span>. Offer availability depends on the merchant and also may not be available for certain recurring, subscription services.​ When applying, a soft credit check may be needed, but will not affect your credit score.​ You must be of legal age in your U.S. state of residence to use Pay in 4.​ PayPal, Inc.: Loans to <span aria-hidden='true'>CA</span><span class='sr-only'>California</span> residents are made or arranged pursuant to <span aria-hidden='true'>CA</span><span class='sr-only'>California</span> Financing Law License.​ <span aria-hidden='true'>GA</span><span class='sr-only'>Georgia</span> Installment Lender Licensee, NMLS #910457.​ <span aria-hidden='true'>RI</span><span class='sr-only'>Rhode Island</span> Small Loan Lender Licensee."
],
Expand Down
35 changes: 33 additions & 2 deletions src/components/modal/v2/parts/views/ShortTerm/Content.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ export const ShortTerm = ({
disclosure,
donutTimestamps,
learnMoreLink,
cta
cta,
testButtonText
},
productMeta: { qualifying, periodicPayment, useV4Design, useV5Design, preapproved, showPreapprovedBadge },
productMeta: { qualifying, periodicPayment, useV4Design, useV5Design, preapproved, showPreapprovedBadge, testVal },
openProductList,
useNewCheckoutDesign,
use5Dot1Design
Expand All @@ -37,12 +38,41 @@ export const ShortTerm = ({
const isPreapproved = preapproved === 'true';
const shouldShowPreapprovedBadge = showPreapprovedBadge === 'true';
const showPreapprovalContent = isPreapproved && shouldShowPreapprovedBadge;
const isTestVal = testVal === 'true';

const preapprovalDisclaimerHeadline = preapproval?.preapprovalDisclaimerHeadline;
const preapprovalDisclaimerBody = preapproval?.preapprovalDisclaimerBody;
const preapprovalPrivacyDisclaimer = preapproval?.preapprovalPrivacyDisclaimer;
const countryClassName = country?.toLowerCase();

const renderTestCtaButton = () => {
if (!isTestVal) {
return null;
}

const testClickTitle = 'Test CTA';

return (
<div className="button__fixed-wrapper">
<div
className={`button__container ${
useNewCheckoutDesign === 'true' ? 'checkout' : ''
} ${countryClassName}`}
>
<Button
onClick={() => {
onClick({ linkName: testClickTitle });
onClose({ linkName: testClickTitle });
}}
className="cta"
>
{testButtonText}
</Button>
</div>
</div>
);
};

const renderCheckoutCtaButton = () => {
/**
* Event link name used in checkout version of the modal.
Expand Down Expand Up @@ -180,6 +210,7 @@ export const ShortTerm = ({
<div className="content__row productLink">
<div className="productLink__container">{renderProductListLink()}</div>
</div>
<div className="content__row">{renderTestCtaButton()}</div>
<div className="content__row">{renderCheckoutCtaButton()}</div>
</Fragment>
);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.