Skip to content

[Due for payment 2025-04-17] [Due for payment 2025-04-16] Update policyOwnerAmountOwedOverdue billing banner #58067

Description

@amyevans

We want to update the policyOwnerAmountOwedOverdue billing banner to be:

New title: Your payment could not be processed
New subtitle: Your ${date} charge of ${formattedAmount} could not be processed. Please add a payment card to clear the amount owed

Example of the subtitle using real values: Your April 3rd, 2024 charge of $41.58 could not be processed. Please add a payment card to clear the amount owed. The date (April 3rd, 2024) and purchase amount ($41.58) are dynamic.

The data source will be a new Onyx key purchaseList (PURCHASE_LIST), which is an array of a single purchase object. The object has fields amount, created, currency, message, purchaseID. Note: it's possible there will be more than 1 in the future (hence this data shape), but it will be 0 or 1 only for now.

Here's an example:

[
    {
        "amount": 0,
        "created": "2024-04-03 22:47:55",
        "currency": "USD",
        "message": {
            "accountManagerAccountID": 0,
            "approvedAccountantAccountIDs": [],
            "approvedSpend": {
                "USD": 0
            },
            "billableAmount": 4158,
            "billableAmountBeforeFreeTrialDiscount": 5400,
            "billablePolicies": [],
            "billingType": "failed_2018",
            "cardSpendSurchargePercent": 1,
            "cashBackAmount": 0,
            "cashBackPercentage": 0,
            "chatOnlyActorList": "",
            "corporateActorCount": 0,
            "corporateRevenue": 5400,
            "expensifyCardMonthlySpend": 0,
            "expensifyCardSpend": {
                "USD": 0
            },
            "freeActorCount": 0,
            "freeTrialDays": 7,
            "freeTrialDiscountAmount": 1242,
            "freeTrialDiscountPercentage": 23,
            "freebieCreditsUsed": 0,
            "guideAccountID": 0,
            "isApprovedAccountant": false,
            "isApprovedAccountantClient": false,
            "paidActorCount": 0,
            "partnerManagerAccountID": 0,
            "perPolicyTotalMembersCount": {
                "5D3C0526388B7146": 1,
                "B8777AF8C34D8D73": 8
            },
            "potentialCashBackAmount": 0,
            "potentialCashBackPercentage": 0.01,
            "subscription": {
                "addNewUsersAutomatically": false,
                "autoRenew": true,
                "autoRenewLastChangedDate": "2024-01-23 20:06:38",
                "endDate": "2025-03-01",
                "startDate": "2024-01-01",
                "type": "yearly2018",
                "userCount": 3
            },
            "teamActorCount": 0,
            "teamRevenue": 0,
            "totalActorCount": 0,
            "totalFreebieCredits": 0,
            "totalPlatformSpend": 0,
            "totalRevenue": 4158,
            "totalUniqueMembersCount": 8,
            "wasDomainBillingUsed": false,
            "yearlyOverageSurcharge": 0,
            "yearlySubscriptionOverageCost": 0,
            "yearlySubscriptionSurcharge": 2700,
            "yearlySubscriptionUserCountCost": 2700
        },
        "purchaseID": 53
    }
]

The date source is purchaseList.created, the purchase amount source is obtained from purchaseList.currency and purchaseList.message.billableAmount. We should validate that purchaseList.message.billingType is failed_2018 before displaying the Your April 3rd, 2024 charge of $41.58 could not be processed. portion of the subtitle, just to be sure.

You should mock Onyx data as needed to get this policyOwnerAmountOwedOverdue banner to show, as the state cannot be achieved otherwise without running real billing on an account.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions