def METHOD_NAME(request, recurring_payment_id,
                          template_name="recurring_payments/authnet/cim_update_payment_info2.html"):
    """
    Add or edit payment info.
    """
    rp = get_object_or_404(RecurringPayment, pk=recurring_payment_id)
    # only admin or user self can access this page
    if not request.user.profile.is_superuser and request.user.id != rp.user.id:
        raise Http403
    rp.populate_payment_profile()
    payment_profiles = PaymentProfile.objects.filter(
                                        customer_profile_id=rp.customer_profile_id,
                                        status=True, status_detail='active')
    if payment_profiles:
        payment_profile = payment_profiles[0]
    else:
        payment_profile = None
    authnet_api = AuthNetAPI()
    token, gateway_error = authnet_api.get_token(rp.customer_profile_id)
    #token, gateway_error = get_token(rp, CIMCustomerProfile, CIMHostedProfilePage,
    #                                is_secure=request.is_secure())
    test_mode = get_test_mode()
    return render_to_resp(request=request, template_name=template_name,
        context={'rp': rp,
                                              'payment_profile': payment_profile,
                                              'token': token,
                                              'test_mode': test_mode,
                                              'gateway_error': gateway_error
                                              })