コード例 #1
0
ファイル: preapproval.py プロジェクト: crankycoder/solitude
    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