cfpayment icon indicating copy to clipboard operation
cfpayment copied to clipboard

Stripe CVVS is optional, but shouldn't be passed if not being used (or it will fail)

Open JamoCA opened this issue 9 years ago • 1 comments

The CFPayment library allows an empty CVV2 value to be posted to Stripe, but Stripe requires that the parameter not be passed if it's not being used. Excluding setVerificationValue() still caused an empty value to be set and passed. I added the following logic to api/gateway/base.cfc in order to exclude the empty parameter from being passed.

<CFIF NOT Findnocase("cvc", key) OR (Findnocase("cvc", key) AND LEN(trim(arguments.payload[key])))>
    <!--- CFHTTParam --->
</CFIF>

JamoCA avatar Feb 08 '16 18:02 JamoCA

If you can send a pull request I'll merge it in. Thanks!

ghidinelli avatar Feb 09 '16 20:02 ghidinelli