Exemplo n.º 1
0
def generate_form_paypal(order_id, amount, **kwargs):
    form_params = {
        "business": settings.PAYPAL_BUSINESS,
        "item_name": str(_("Agency membership")),
        "currency_code": settings.PAYMENT_CURRENCY,
        "invoice": str(order_id),
        "notify_url": build_backend_url(reverse('paypal-ipn')),
        "return": build_frontend_url(settings.PAYPAL_FRONTEND_SUCCESS_URL),
        "cancel_return":
        build_frontend_url(settings.PAYPAL_FRONTEND_CANCEL_URL),
        "no_note": 1,
        "no_shipping": 1,
        "amount": amount,
    }
    form_params.update(kwargs)

    return {f.name: f.value() for f in PayPalPaymentsForm(initial=form_params)}
Exemplo n.º 2
0
 def get_image(self, obj):
     return build_backend_url(obj.image.url) if obj.image else None
Exemplo n.º 3
0
 def get_company_logo(self, obj):
     return build_backend_url(
         obj.company_logo.url) if obj.company_logo else None
Exemplo n.º 4
0
def build_candidate_cv_url(pk):
    return build_backend_url(f'/admin/accounts/candidatecv/{pk}')
Exemplo n.º 5
0
def build_company_admin_url(pk):
    return build_backend_url(f'admin/accounts/companyprofile/{pk}/')
Exemplo n.º 6
0
def build_position_admin_url(pk):
    return build_backend_url(f'admin/accounts/position/{pk}/')
Exemplo n.º 7
0
def build_agency_admin_url(pk):
    return build_backend_url(f'admin/accounts/agencyprofile/{pk}/')
Exemplo n.º 8
0
def build_candidate_admin_url(pk):
    return build_backend_url(f'admin/accounts/candidateprofile/{pk}/')