Calculating surcharges

Let’s say a credit card processor charges a variable rate plus a fixed fee on any credit card transactions. For example, Stripe’s current merchant fee in the US is 2.9% + $0.30. This means that, for a $100 amount charged, the seller is getting only $100 − ($100 × 2.9% + $0.30) = $96.80 after the fee is deducted. In some contexts, sellers will want to make up for the difference by passing the fee on to the customer.

What if the seller wants to add a surcharge to recoup the amount of the processing fee? They can’t just tack on 2.9% + $0.30 to the subtotal, because that surcharge itself will incur the processing fee, and the seller will still lose money.

So the formula instead is:

\begin{aligned}
p_v &=\text{the variable portion of the processing fee (e.g., 0.029)} \\
p_f &=\text{the fixed portion of the processing fee (e.g., 0.30)} \\
x &=\text{the subtotal} \\
f &=\text{the surcharge needed to recoup the processing fee} \\
\end{aligned} \\
f=\frac{x+p_f}{1-p_v}-x

This follows from a simple derivation. The amount on which the processing fees will be charged is x+f. This means the processing fees are

(x+f)p_v+p_f

What the seller earns after processing fees, then, is the total minus the above fee:

(x+f)-((x+f)p_v+p_f) \\
=(1-p_v)(x+f)-p_f

Our goal is for the expression above (what the seller earns after processing fees are deducted) to end up equal to the subtotal. Now solve for f that makes that true:

\begin{equation*}
\begin{aligned}
x &= (1-p_v)(x+f) - p_f \\
x+p_f &= (1-p_v)(x+f) \\
\frac{x+p_f}{1-p_v} &= x+f \\
f &=\frac{x+p_f}{1-p_v}-x \\
\end{aligned}
\end{equation*}

Pretty sure the IRS made a typo in Publication 519

There’s a provision that allows aliens in the U.S.[1] to choose to be treated as a U.S. resident for tax purposes even if they would not otherwise qualify as a resident. Income tax rules themselves are already really confusing — and they are even more complicated for foreigners in the U.S. — so a typographic error could really confuse a taxpayer.

I think the IRS made a typographic error, but I’m not even sure how to get in touch with them to fix this.

Motivating example

Suppose you arrive in the U.S. for the very first time on October 1, 2015 to work for the foreseeable future on a TN-1 (NAFTA Professional) visa. Because the period from 2015-10-01 to 2015-12-31 is insufficient to meet the Substantial Presence Test,[2] you would otherwise be a nonresident alien for tax year 2015. This would mean your income in the United States might be subject to taxation in the U.S. as well as in your home country. What if you wanted to be treated as a resident alien starting on October 1, 2015 — despite not satisfying the Substantial Presence Test?

This is the First-Year Choice, and it’s documented in Publication 519 (“U.S. Tax Guide for Aliens”) by the IRS.

The error

I got a little confused when I first read the rule, because it seemed to require an impossibility:

2015 Publication 519 typo on page 7

Let me excerpt that to show why it’s so self-contradictory: “If you do not meet either the [GCT] or the [SPT] for 2014 … but you meet the [SPT] for 2014.”

Huh? Clearly they meant 2016 there. Moreover, if you met the SPT for 2014, the current tax year — 2015 — wouldn’t be your first year in the U.S.

This is confirmed by the bulleted list on the following page:

2015 Publication 519 excerpt from page 8

Motivating example resolved

If you are going to satisfy the Substantial Presence Test in the following tax year — 2016 — you can choose to pretend to be a U.S. resident from 2015-10-01 to 2015-12-31 as well, if you meet all of the requirements in the bulleted list above.

 

Footnotes

Footnotes
1 Foreigners, not extraterrestrials.
2 The Substantial Presence Test (SPT) requires, in its simplest form, at least 183 days of physical presence within the United States in a three-year period.

What’s in that USPS postage barcode?

pbSmartPostage test stamp

I am publishing this post as a hobbyist, because I find barcodes cool (as demonstrated by a prior open source project using 2D barcodes that I worked on). Do not attempt to use this information for any illegitimate purpose. Counterfeiting postage is a federal crime. 18 U.S.C. § 501.

This post ties together some of my favourite things: 2D barcodes, high speed automation, printers, cryptographic signatures (!), postal mail and postage, fraud prevention, and even a little bit about patents!

Continue reading “What’s in that USPS postage barcode?”

A new blog series?

Over dinner this week, I was revealed as one of those weirdos who actually read the fine print. Yep, once in a while—embarrassingly often—I’ll actually dig right into those long documents that come with the health insurance, the credit card offer, or the website signup.

Forced arbitration clause in Amex Premier Rewards Gold cardmember agreement.
When was the last time you actually read something like this?

Why? Because the purpose of these “Terms and Conditions,” or “Cardmember Agreements,” or whatever else they’re calling these lengthy, prewritten, one-sided contracts, is to modify default legal rules/rights in such a way that benefits the parties that wrote them. So, even if I don’t have any practical choice in whether or not to use Facebook, even if I can’t really negotiate with American Express and rewrite the terms of the extended warranty, at the very least it’s useful to know what my rights are—and what hidden benefits there might be that most people don’t know about.

So a friend thought it might be fun if I just occasionally write about these things. Perhaps a sort of Bad Terms & Conditions section on my blog, or … Digging through the Fine Print

Still working on the name.

I’ll try not to fall into the bad habit of labelling companies “fascists” or something similarly colourful, which other blogs highlighting these issues inevitably find themselves doing. (I mean, literally every company that deserves any business does it, so what’s a conscientious consumer to do?) For what it’s worth, Consumerist already writes about this and does a pretty good job of it.

Continue reading “A new blog series?”