+def paypal_init(request, key):
+ schedule = get_object_or_404(Schedule, key=key)
+ schedule.method = 'paypal'
+ schedule.save(update_fields=['method'])
+ app = request.GET.get('app')
+ return redirect(agreement_approval_url(schedule.amount, schedule.key, app=app))
+
+