I'm trying to work through the subscriptions guide on stripe
Im using seperate elements for Cardnumber, Expiry and CVC (as below)
<div id="card-number" class="MyCardNumber">
<!-- Elements will create input elements here -->
</div>
<div id="card-expiry" class="MyCardExpiry">
<!-- Elements will create input elements here -->
</div>
<div id="card-cvc" class="MyCardCvc">
<!-- Elements will create input elements here -->
</div>
Everything is rendering on screen correctly and when i submit (using the createPaymentMethod as detailed here) i am getting a payment method object returned (so its working) - example below.
paymentMethod:
billing_details:
address:
city: "somwhere"
country: "US"
line1: "123 fake street"
line2: "fake something"
postal_code: "12345"
state: "new york"
__proto__: Object
email: "[email protected]"
name: "john doe"
phone: null
__proto__: Object
card:
brand: "visa"
checks:
address_line1_check: null
address_postal_code_check: null
cvc_check: null
__proto__: Object
country: "US"
exp_month: 2
exp_year: 2020
funding: "credit"
generated_from: null
last4: "4242"
three_d_secure_usage: {supported: true}
wallet: null
__proto__: Object
created: 1575838186
customer: null
id: "pm_1FnWhKDEOzF6SOM2om8fNlSi"
livemode: false
metadata: {}
object: "payment_method"
type: "card"
__proto__: Object
__proto__: Object
What i am struggling to understand/work out is how to make the createPaymentMethod perform checks on the postal_code and CVC (the checks are returning as null).
Are the checks only performed when using the single card element or can they be performed when collecting cardnumber/expiry and CVC seperately? I read a post on stack overflow which suggests stripe.js magically does this under the hood, but i dont cant work out what im missing?
Thanks