#taulant-iban-element
1 messages · Page 1 of 1 (latest)
this is the code I am using to confirmSepaDebitSetup
Thanks
this si the code I use to initialize the ibanElement
taulant-iban-element
@fleet pond can you share real code instead of pictures of code?
also can you share which exact doc you are following?
const result = await this.paymentService.getStripeClientSecret(this.vertragsvorlageBeduerftigeComponent?.contractModel?.id);
this.clientSecret = result.clientSecret;
const options = {
clientSecret: this.clientSecret,
// appearance: {},
};
this.stripe = Stripe(environment.stripe.pk, result.account);
this.elements = this.stripe.elements(options);
// Create and mount the Payment Element
this.ibanElement = this.elements.create('iban', {
// classes: 'base',
supportedCountries: ['SEPA'],
placeholderCountry: 'DE',
style: {
base: {
padding: 40,
fontSize: '18px',
},
},
});
this.ibanElement.mount('#iban-element');
}```
this.stripe
.confirmSepaDebitSetup(this.clientSecret, {
payment_method: {
sepa_debit: this.ibanElement,
billing_details: {
email: this.vertragsvorlageBeduerftigeComponent.formGroup.get('paymentData')?.get('email'),
name: this.vertragsvorlageBeduerftigeComponent.formGroup.get('paymentData')?.get('fullName'),
},
},
})
.then((setupIntent: any) => {
if (setupIntent.status !== 'succeeded') {
// failed
} else {
// setupIntent
}
})
.catch((ex: any) => {
console.log(ex);
});
}```
also the error doesn't seem to be about Stripe or the IBANElement right?
it taks about your own FormGroup
Can you try just in a simple example without any form or anything and calling the confirmSepaDebitSetup() call? It should just work and confirm the problem is unrelated
this is the error:
--> starting at object with constructor 'FormGroup'
| property 'controls' -> object with constructor 'Object'
| property 'personalData' -> object with constructor 'FormGroup'
--- property '_parent' closes the circle: object with constructor 'FormGroup'
| property 'controls' -> object with constructor 'Object'
| property 'personalD
the html code is:
<div id="iban-element">
<!-- Elements will create form elements here -->
</div>
<button (click)="submitIban()">Submit</button>
</div>```
yeah that's my point right now it all seems unrelated to the IBAN code
so @dreamy breach , the code above shared from your perspective is correct?
@fleet pond It seems correct. It's hard to say honestly. My advice is to basically do a standalone HTML/JS file that just mounts that specific Element and then a button to confirm, nothing else, no form, no form submission, etc.