refactor CRM_Stripe_AJAX::confirmPayment() into an API action (StripePaymentIntent.generate)
I'm working on updating remoteform to make it work with the new payment intent features added to the recent Stripe extensions.
Doing so requires me to essentially re-implement a simplified version of civicrm_stripe.js.
In the course of doing so... I see that I have to work out a way to execute CRM_Stripe_AJAX::conformPayment()
but from a remote server, which means I can't do it via an Ajax call.
I was wondering if you would be open to some re-factoring that might make it easier.
Essentially - I'd like to move all the code in CRM_Stripe_AJAX to a new API action (generate) in the existing StripePaymentIntent API entity.
The API code would return { 'is_error': 0, values: { 'paymentIntent': N }}
which is slightly different then what is returned now, but civicrm_stripe.js could be adjusted to accomodate it.
With this change, civicrm_stripe.js would then call the API method instead of posting to civicrm/stripe/confirm-payment
What do you think? Is there any compelling reason to keep CRM_Stripe_AJAX?
jamie