Using Stripe Payment Form Inside of Editor

Using Stripe Payment Form Inside of Editor

braydengirardbraydengirard Posts: 1Questions: 1Answers: 0

Is it possible to put a custom form inside of the editor? I am looking to get the id of a datatable column that I have selected, and take that along with the custom form data and submit it to stripe.

Thanks

Answers

  • allanallan Posts: 63,689Questions: 1Answers: 10,500 Site admin

    Hi,

    You can't really put an entire custom form into Editor (as in a form) since Editor is already a form. You can put individual custom fields into the form (custom field types can be developed) so you could technically put virtually anything into the form as a single field (potentially including another form, even although it would be invalid HTML).

    However, I think a better option, based on your desired action, would be to use the Editor form as normal and then use the preSubmit event to modify the data that Editor would normally send to the server into something that Stripe wants. You would also need to use postSubmit to modify the data returned from Stripe into that needed by Editor! You could use ajax as a function if you refer that over the two events.

    Regards,
    Allan

  • INTONEINTONE Posts: 153Questions: 58Answers: 6
    edited July 2015

    I am working on this now. My solution is to insert the additional form fields and then use a simple button to send the info to stripe server and process the card after using a normal ajax call. After all this processing you can then Inform user that processing was complete/error then reveal/hide the normal editor create/update button as needed.

    I did it this way instead of going through on Presubmit because even though i was successful with the presubmit call to stripe the form was closing before
    the stripe request returned data. I tried using onpreclose and returned false to keep the form open but it did not work.

    I inserted the html for the credit card fields instead of building the fields using editor because i did not want credit card info to be sent to the server.

This discussion has been closed.