OCA / cooperative

GNU Affero General Public License v3.0
11 stars 22 forks source link

Online Payment on Subscription Request #143

Open QuiJoQuim opened 1 month ago

QuiJoQuim commented 1 month ago

A client asks us for a functionality not provided for in the module: Being able to make the payment at the time of registering his Subscription Request. This is not the first time we have had this requirement. So we thought it might be useful.

Does anyone have experience with a similar scenario? Is there anything developed that allows this?

As it stands now, the process does not seem easy: for one thing, the invoice is not generated until it has been validated, so it would not make sense to link the payment to the invoice. On the other hand there is the problem of adding a payment button to the registration form.

We thought this could be achieved by making an unlinked payment and then reconciling it to the future invoice. What do you think?

Any ideas? Any approach?

luisnore commented 3 weeks ago

We had a similar requirement: we were asked to create a scheduled action that validates the subscription requests without human supervision every few minutes. That creates the invoice, and we added the invoice website link (with get_portal_url()) in the email template that is sent at validation so the new cooperator can make the payment.

The cron code is quite simple:

        draft_requests = self.env["subscription.request"].search(
            [("state", "=", "draft")]
        )
        for subscription_request in draft_requests:
            subscription_request.validate_subscription_request()

Not ideal, but it's been working for months without custom developments if not human validation is needed.