Skip to content

Failing to submit #1

@ndarilek

Description

@ndarilek

Hey, looks like a nice package. Trying to integrate this with Stripe tokenization on the client-side, but I can't get my form to submit. I looked at your example in tests/ and it looks like you write to a collection. I'm attempting to pass the data to either a submit or success hook so Stripe's JS can be called. Here's my LiveScript/Jade:

@CreditCardSchema = new SimpleSchema do
cardNumber:
type: String
autoform:
type: "payments/creditCard"
custom: PaymentsHelpers.CreditCardValidation
cvc:
type: String
autoform:
type: "payments/creditCardCVC"
custom: PaymentsHelpers.CVCValidation
expiration:
type: String
autoform:
type: "payments/creditCardExpiry"
custom: PaymentsHelpers.CCExpiryValidation

And my form:

template(name = "newCard")
h1 New Credit Card
+quickForm(id = "newCardForm" schema = "CreditCardSchema" buttonContent = "Update")

When I submit the form, I get this error:

error:
Validation error
TypeError: $.payment is undefined

aldeed_...d0c01da (line 7795)

And indeed, calling $.payment from the console is in fact undefined. I see the ppayments library in my page source.

Am I missing something other than the submit hooks, which still fail the same way even when they're added?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions