ghidinelli / cfpayment

ColdFusion payment processing library makes plumbing e-commerce apps easy. Charging credit cards has never been easier. Inspired by Ruby's ActiveMerchant.
Other
90 stars 54 forks source link

stripe.cfc - getToken function name causes CF error #22

Closed MiY4MOTO closed 9 years ago

MiY4MOTO commented 9 years ago

If I implement the example exactly "as is" on Coldfusion 8, I get the following CF error;

The names of user-defined functions cannot be the same as built-in ColdFusion functions. The name getToken is the name of a built-in ColdFusion function. The CFML compiler was processing:

A cffunction tag beginning on line 216, column 10.

The error occurred in C:\inetpub\wwwroot\cfpayment\api\gateway\stripe\stripe.cfc: line 216 Called from C:\inetpub\wwwroot\cfpayment\api\core.cfc: line 52

ghidinelli commented 9 years ago

Thanks for the report... when you say the example as is, are you referring to the 6-liner in the README?

getToken() is part of recent work on the stripe gateway. If you temporarily use this commit:

https://github.com/ghidinelli/cfpayment/commit/95a13b489b48b2833287059c151571111764be7d#diff-1bc979c4da2f112dd72a5535e4925476

You should be OK and I'll make sure this is corrected as part of some more work I'm doing.

MiY4MOTO commented 9 years ago

Thanks for that.

Yes, I was referring to the example in the README. Basically, as soon as you reference the stripe.cfc the error is thrown.

The issue doesn't occur on CF11, so it may well only affect CF8. I don't have 9 or 10 available to me so I can't check if they exhibit the same behaviour.

ghidinelli commented 9 years ago

Yeah, doesn't occur in CF10 for me either I don't think.

ghidinelli commented 9 years ago

Odd that it doesn't throw an error in CF10 or 11, but for safety, I renamed to getAccountToken()