# Using Wix Payment in form submition

**URL:** <https://forum.wixstudio.com/t/using-wix-payment-in-form-submition/7372>\
**Category:** Ask the community\
**Tags:** wix-forms, code, question\
**Created:** [January 7, 2023, 3:30pm UTC](https://forum.wixstudio.com/t/using-wix-payment-in-form-submition/7372 "2023-01-07T15:30:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aviv-waiss](https://avatars.discourse-cdn.com/v4/letter/a/3d9bf3/32.png) [@aviv-waiss](https://forum.wixstudio.com/u/aviv-waiss)\
**Post date:** [January 7, 2023, 3:30pm UTC](https://forum.wixstudio.com/t/using-wix-payment-in-form-submition/7372/1 "2023-01-07T15:30:17Z")

</div>

Hi.  
I’m setting up a custom pay on a wix form.  
I’m using the wixFormSubmitted () and createMyPayment inside it to trigger the payment.  
my problem is that when payment fail for some reason I still get a row in the submission table.  
is there a better way to implement it so when a payment fail or canceled I wont get a submission?

---

<div class="post-metadata">

**Author:** ![bilonii](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/bilonii/32/15984_2.png) [@bilonii](https://forum.wixstudio.com/u/bilonii)\
**Post date:** [January 7, 2023, 3:48pm UTC](https://forum.wixstudio.com/t/using-wix-payment-in-form-submition/7372/2 "2023-01-07T15:48:49Z")

</div>

Hi! You have the option to prevent submissions from being created in the case of a failed or canceled payment would be to add a check for the payment status before creating a new submission. You can do this by using the fetchPaymentStatus method of the Wix Payments API to check the status of the payment after it has been attempted.
