XML integration: update credit card expiration date creates a transaction

dmchengdmcheng Member
We're using the subscription xml data feed to send data to an external system. We have noticed that certain Foxycart administrative actions create a zero-dollar transaction. For example, when a user updates the credit card expiration date on a subscription, we receive a zero-dollar transaction due to the authorization.

We also allow customers to order free items and thus there is possibility of a product transaction with a zero-dollar total.

How can we distinguish administrative zero-dollar transactions from free-item order transactions? Do we have to look at cc_number_masked, so that a free order has no credit card but an administrative transaction does have one?

But what if a customer makes a free item order and enters their Foxycart password on the checkout screen? Won't that pull the masked cc number into the transaction?

Comments
  • fc_adamfc_adam FoxyCart Team
    @dmcheng,

    Good question. With our legacy XML datafeed, it is possible to detect what type of event has occurred, but it's a little more involved.

    Primarily a customer could update their information in two ways - by clicking a subtoken link and loading the checkout with their subscription marked as a future charge, or by using a cart=updateinfo link.

    - With a subtoken link - you can detect that by looping through all of the products and checking if all of them have an is_future_line_item attribute set to true. If so - then the customer has loaded an existing subscription and just updated some of their information.
    - With an updateinfo - you can check if the only product in the cart has a name of "Update Your Customer Information".

    If you combine both of those checks together, that should allow you to detect a customer just modifying their details, rather than making a purchase of some kind, whether free or not.

    As an aside - if you haven't already seen it, we have a new webhooks functionality for version 2.0 which you can see details on here. Along with a number of great improvements like automatic retries and JSON payloads, it also includes a helper value called transaction_type which provides extra context with values of transaction, updateinfo, subscription_modification, subscription_renewal or subscription_cancellation.
Sign In or Register to comment.