I'd like to make it so that a partner can manage which payment token
their individual subscription(s) is using. I dug around in the odoo
& odoo-enterprise code, and found that there actually is a "Manage
Payment Method" button on the portal that was hidden, possibly by our
own code.
I read some enterprise code, and found:
t t-call="payment.manage">
t t-set="assign_token_route" t-value="'/my/subscription/assign_token/' + str(subscription.id)"/>
t t-set="landing_route" t-value="subscription.get_portal_url() + '&message=Your payment method has been changed for this subscription.&message_class=alert-success'"/>
This code seems to be calling this template in payment_templates.xml in odoo:
template id="manage" name="Payment Manage">
- 'acquirers' - The payment acquirers supporting tokenization
- 'tokens' - The set of payment tokens of the current partner
- 'default_token_id' - The id of the token that should be pre-selected. Optional
# - 'reference_prefix' - The custom prefix to compute the full transaction reference
- 'partner_id' - The id of the partner managing the tokens
# - 'access_token' - The access token used to authenticate the partner.
# - 'transaction_route' - The route used to create a validation transaction
- 'assign_token_route' - The route to call to assign a token to a record. If set, it
enables the token assignation mechanisms: creation of a new
token through a refunded transaction and assignation of an
existing token
- 'landing_route' - The route the user is redirected to at then end of the flow
- 'footer_template_id' - The template id for the submit button. Optional
form name="o_payment_manage"
When I click "Manage Payment Method", a dialog pops up, but its empty. I assume this is because the enterprise code isn't passing all the mentioned arguments to The payment.manage template.
How do I get the values that the 'reference_prefix', 'access_token', and 'transaction_route' fields are asking for so that I can let the partner manage their subscription's payment method?
I'm in Odoo v15.