예제 #1
0
    def obj_create(self, bundle, request, **kwargs):
        form = PreapprovalValidation(bundle.data)
        if not form.is_valid():
            raise self.form_errors(form)

        paypal = get_client()
        bundle.data = paypal.get_preapproval_key(*form.args())
        bundle.data['uuid'] = form.cleaned_data['uuid'].uuid
        bundle.obj = self.obj()
        bundle.obj.set(bundle.data)
        return bundle
예제 #2
0
    def obj_create(self, bundle, request, **kwargs):
        form = PreapprovalValidation(bundle.data)
        if not form.is_valid():
            raise self.form_errors(form)

        paypal = get_client()
        bundle.data = paypal.get_preapproval_key(*form.args())
        bundle.data['uuid'] = form.cleaned_data['uuid'].uuid
        bundle.obj = self.obj()
        bundle.obj.set(bundle.data)
        return bundle