Remove user id from authorize.net invoice number

Previously, invoice number was [user_id]T[link_id]C[campaign_id].
Since campaigns are represented as Things now, their ids are longer, putting
us over the 20 char limit for invoice numbers defined in the authorize.net
xml api.
(see https://api.authorize.net/xml/v1/schema/AnetApiSchema.xsd )

Now invoice number will be T[link_id]C[campaign_id], which is still unique
across campaigns since a link is always associated with only one user
This commit is contained in:
shlurbee
2012-05-29 10:06:36 -07:00
parent 09dbd49445
commit 76142d50cd

View File

@@ -116,7 +116,7 @@ def auth_transaction(amount, user, payid, thing, campaign, test = None):
return bid.transaction, ""
elif int(payid) in PayID.get_ids(user):
order = Order(invoiceNumber = "%dT%dC%d" % (user._id, thing._id, campaign))
order = Order(invoiceNumber = "T%dC%d" % (thing._id, campaign))
success, res = _make_transaction(ProfileTransAuthOnly,
amount, user, payid,
order = order, test = test)