Skip to content

Commit

Permalink
Truncate long descriptions (coinbase#9)
Browse files Browse the repository at this point in the history
* Truncate long descriptions
* Update coinbase.php
  • Loading branch information
sahil-cb authored May 23, 2019
1 parent a15d895 commit a04583d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/gateways/coinbase.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ function coinbase_link($params)
$description = Capsule::table('tblinvoiceitems')
->where("invoiceid", "=", $params['invoiceid'])
->value('description');
// Truncate descriptions longer than 200 per Commerce API requirements
$description = (strlen($description) > 200) ? substr($description,0,197).'...' : $description;
} catch (Exception $e) {
}

Expand Down

0 comments on commit a04583d

Please sign in to comment.