Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8477589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T18:30:36+00:00 2026-06-10T18:30:36+00:00

I am implementing an external wrapper for the Stripe API in Coldfusion. One of

  • 0

I am implementing an external wrapper for the Stripe API in Coldfusion.

One of the functions I am calling takes an argument of type “timestamp”, as seen below:

public struct function updateSubscription(required string customerid, required string planid, string coupon='', boolean prorate=true, timestamp trial_end, any card) 
{
...
}

I am passing a valid date (tested and IsDate() resulted in “YES”) to the trial_end argument but it is giving me a “not of type timestamp” error.

What do I need to do to this date to get the function call to work properly?

Thanks

UPDATE: FULL FUNCTION ADDED:

public struct function updateSubscription(required string customerid, required string planid, string coupon='', boolean prorate=true, timestamp trial_end, any card) {

    local.HTTPService = createHTTPService('POST');
    local.HTTPService.addParam(type='formfield',name='plan',value=arguments.planid);

    local.HTTPService.setUrl(getBaseUrl() & 'customers/' & arguments.customerid & '/subscription');
    if (Len(Trim(arguments.coupon))) {
        local.HTTPService.addParam(type='formfield',name='coupon',value=Trim(arguments.coupon));
    }
    local.HTTPService.addParam(type='formfield',name='prorate',value=arguments.prorate);
    if (StructKeyExists(arguments,'trial_end') AND IsDate(arguments.trial_end)) {
        loca.intUTCDate = timeToUTCInt(arguments.trial_end);
        local.HTTPService.addParam(type='formfield',name='trial_end',value=local.intUTCDate);
    }
    if (StructKeyExists(arguments,'card') AND isStruct(arguments.card)) {
        local.HTTPService.addParam(type='formfield',name='card[number]',value=arguments.card.number);
        local.HTTPService.addParam(type='formfield',name='card[exp_month]',value=arguments.card.exp_month);
        local.HTTPService.addParam(type='formfield',name='card[exp_year]',value=arguments.card.exp_year);
        if (StructKeyExists(arguments,'card.cvc')) {
            local.HTTPService.addParam(type='formfield',name='card[cvc]',value=arguments.card.cvc);
        }
        if (StructKeyExists(arguments,'card.name') AND Len(Trim(arguments.card.name))) {
            local.HTTPService.addParam(type='formfield',name='card[name]',value=arguments.card.name);
        }
        if (StructKeyExists(arguments,'card.address_line1') AND Len(Trim(arguments.card.address_line1))) {
            local.HTTPService.addParam(type='formfield',name='card[address_line1]',value=Trim(arguments.card.address_line1));
        }
        if (StructKeyExists(arguments,'card.address_line2') AND Len(Trim(arguments.card.address_line2))) {
            local.HTTPService.addParam(type='formfield',name='card[address_line2]',value=Trim(arguments.card.address_line2));
        }
        if (StructKeyExists(arguments,'card.address_zip') AND Len(Trim(arguments.card.address_zip))) {
            local.HTTPService.addParam(type='formfield',name='card[address_zip]',value=Trim(arguments.card.address_zip));
        }
        if (StructKeyExists(arguments,'card.address_state') AND Len(Trim(arguments.card.address_state))) {
            local.HTTPService.addParam(type='formfield',name='card[address_state]',value=Trim(arguments.card.address_state));
        }
        if (StructKeyExists(arguments,'card.address_country') AND Len(Trim(arguments.card.address_country))) {
            local.HTTPService.addParam(type='formfield',name='card[address_country]',value=Trim(arguments.card.address_country));
        }
    } else if (StructKeyExists(arguments,'card')) {
        local.HTTPService.addParam(type='formfield',name='card',value=Trim(arguments.card));
    }
    local.HTTPResult = local.HTTPService.send().getPrefix();

    if (NOT isDefined("local.HTTPResult.statusCode")) {
        throw(type='Stripe',errorcode="stripe_unresponsive", message="The Stripe server did not respond.", detail="The Stripe server did not respond.");
    } else if (left(local.HTTPResult.statusCode,3) NEQ "200") {
        throw(type='Stripe',errorcode=local.HTTPResult.statusCode, message=local.HTTPResult.statuscode, detail=local.HTTPResult.filecontent);
    }
    return deserializeJSON(local.HTTPResult.filecontent);
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T18:30:37+00:00Added an answer on June 10, 2026 at 6:30 pm

    timestamp is not a native CF data type, so CF is trying to find a CFC called timestamp.cfc.

    I think you just mean date in this case.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The preamble We're implementing a MVC2 site that needs to consume an external API
I'm just getting started defining and implementing external javaScript libraries and I'm a little
implementing publishActivity in PHP using the REST API using this code: $activity = array(
When implementing a hash table using a good hash function (one where the probability
I'm implementing callback routines for external static C++ library to be used in Objective-C
I am using an external API to interface to a FireWire Camera. The API
I'm implementing GA on one of our client's sites and we have a contact
I'm working on an API wrapper class, which is the first I've made. For
I'm implementing a plugin architecture to implement authentication an external authentication mechanism for a
I'm implementing a JAX-WS webservice that will be consumed by external Java and PHP

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.