Receiving failed status for credit card number when posting cc token in request

31 views
Skip to first unread message

Thomas Young

unread,
Dec 14, 2016, 2:53:15 PM12/14/16
to FreshBooks API (not monitored)
In the documentation, it states that freshbooks will only accept either a credit card token, or a card number, but not both.

Since they will no longer accept card numbers after january of next year, I used the stripe js library and now receive a token from stripe that i am passing into my xml writer.

I get this error in the when i dump the response from the curl call i send to freshbooks.

<?xml version="1.0" encoding="utf-8"?>
<response xmlns="http://www.freshbooks.com/api/" status="fail">
 
<error>Invalid value for field 'number'. Invalid or missing credit card number.</error>
 
<code>40060</code>
 
<field>number</field>
</response>

Here is the autobill section in my xml writer

$writer->startElement('autobill');
    $writer->writeElement('gateway_name', 'Stripe');
    $writer->startElement('card');
         $writer->writeElement('cc_token', $cc_token);
              $writer->writeElement('name', $card_name);
              $writer->startElement('expiration');
                   $writer->writeElement('month', $month);
                   $writer->writeElement('year', $year);
              // end expiration
              $writer->endElement();
            // end card
            $writer->endElement();
// end autobill
$writer->endElement();



Anyone else run into this issue? 

Any help would be appreciated. Thanks!

Thomas Young

unread,
Dec 14, 2016, 3:50:05 PM12/14/16
to FreshBooks API (not monitored)
Talked to freshbooks on the phone. They just hadnt rolled out the changes yet. That error is expected, if anyone else was having the same issue. 

He said that it should be ready by the end of the day tomorrow. 

Great customer and dev support from Freshbooks. Thanks!
Reply all
Reply to author
Forward
0 new messages