{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","settings":"","results":{"codes":[]},"params":[]},"next":{"description":"","pages":[]},"title":"Introduction","type":"basic","slug":"payment-api","excerpt":"Payment-API","body":"With the FundraisingBox-Payment-API you can send your collected data directly to the [app/payment](doc:apppayment)-endpoint or you build up a session with the [Introduction](doc:session-api-introduction) and process a complete session. You get a JSON in return.\n\nFor a 1-step-form we recommend to send the data directly to the payment-endpoint.\n\nUse the [forms/config](doc:formsconfig) to check which fields and values are available in your form.\n[block:callout]\n{\n \"type\": \"info\",\n \"title\": \"Form-API\",\n \"body\": \"We also provide our [Form-API](doc:form-api), a Javascript-jQuery-Plugin, for easy implementation on your website.\"\n}\n[/block]\n\n[block:api-header]\n{\n \"type\": \"basic\",\n \"title\": \"Authentication\"\n}\n[/block]\nYou just have to provide the hash of your form, there is no secret authentication, because the donation form is a public part of your website. You can find the hash of your form in the settings of your form in your FundraisingBox.\n[block:image]\n{\n \"images\": [\n {\n \"image\": [\n \"https://files.readme.io/41433c2-FundraisingBox-FormAPI-FormHash.png\",\n \"FundraisingBox-FormAPI-FormHash.png\",\n 463,\n 173,\n \"#eaeff4\"\n ]\n }\n ]\n}\n[/block]\n\n[block:api-header]\n{\n \"type\": \"basic\",\n \"title\": \"Errors\"\n}\n[/block]\nOn a successful API-request you get a JSON with HTTP status 200. Even if there are e.g. current_fields_errors on your session or the payment_status is \"error\", it was a successful request and it returns a JSON with status \"success\".\n\nOnly if there is an error preventing the API from working you get a JSON with status \"error\" and the corresponding HTTP error code, 400, 404 or 500.\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"{\\n \\\"status\\\": \\\"error\\\",\\n \\\"error\\\": \\\"error 105: no hash\\\"\\n}\",\n \"language\": \"json\"\n }\n ]\n}\n[/block]\n**Possible errors:**\n[block:parameters]\n{\n \"data\": {\n \"h-0\": \"Error\",\n \"h-1\": \"Description\",\n \"0-0\": \"error 101: general error\\nerror 900: general error\",\n \"0-1\": \"something went wrong, please contact our support\",\n \"1-0\": \"error 102: not owner\",\n \"2-0\": \"error 103: inactive\",\n \"3-0\": \"error 104: not api owner\",\n \"4-0\": \"error 105: no hash\",\n \"5-0\": \"error 106: no config\",\n \"6-0\": \"error 201: session incomplete\",\n \"7-0\": \"error 202: session processed\",\n \"11-0\": \"error 404: server error\\nerror 500: server error\",\n \"12-0\": \"maintenance: *...translated maintenance message...*\",\n \"1-1\": \"you are not allowed to use forms\",\n \"2-1\": \"the selected form is inactive\",\n \"3-1\": \"you are not allowed to use the form api\",\n \"4-1\": \"form hash is missing\",\n \"5-1\": \"no form has been found for the given hash\",\n \"6-1\": \"you can only process complete session with doPayment()\",\n \"7-1\": \"processed sessions cannot be read or updated\",\n \"11-1\": \"something is wrong with the server\",\n \"12-1\": \"the FundraisingBox is currently in maintenance mode\",\n \"8-0\": \"error 203: session not found\",\n \"8-1\": \"wrong or no session hash at updateSession\",\n \"9-0\": \"error 204: session exists already\",\n \"9-1\": \"hash of existing session used for createSession\",\n \"10-0\": \"error 205: new session requires values\",\n \"10-1\": \"you have to submit some values for createSession\"\n },\n \"cols\": 2,\n \"rows\": 13\n}\n[/block]","updates":[],"order":0,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"57dfab324d55c022002811c8","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Payment-API (Enterprise)","slug":"form-api","order":4,"from_sync":false,"reference":true,"_id":"57df91b2c6348d0e0020c452","createdAt":"2016-09-19T07:20:18.372Z","__v":1,"project":"571f5e8cd8667f0e00a3c498","version":"571f5e8cd8667f0e00a3c49b"},"project":"571f5e8cd8667f0e00a3c498","user":"5720c075db52d01700f5d1e4","createdAt":"2016-09-19T09:09:06.006Z","githubsync":"","parentDoc":null,"version":{"version":"1","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["571f5e8cd8667f0e00a3c49c","571f73cfcb4baa0e00d13a80","571f7451cb4baa0e00d13a88","571f7d2720695f3400f38797","571f7fb0ac2a080e0014c661","571f884be54f2d0e003ebb0a","572200c9ecb38d0e00d80ebd","572c301e7c8eff0e00aaa174","57df91b2c6348d0e0020c452","57e104db9ff1e21900a721ab","57fd04caeaa77f19008b8202","5899c7113514ce0f0014da84","5cbeda4b862d090013abd413","5e60d6278f8b380072f0b1e3"],"_id":"571f5e8cd8667f0e00a3c49b","hasDoc":true,"releaseDate":"2016-04-26T12:26:52.312Z","__v":14,"hasReference":true,"createdAt":"2016-04-26T12:26:52.312Z","project":"571f5e8cd8667f0e00a3c498"},"__v":1}
Introduction
Payment-API