{"_id":"5865639b4532123900bece2d","project":"563cc7119799fb0d00047685","user":"563cc6fa8894d20d00014ea3","__v":2,"category":{"_id":"5862e862b8b7fa23009665b7","project":"563cc7119799fb0d00047685","version":"563cc7119799fb0d00047688","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-12-27T22:17:06.616Z","from_sync":false,"order":4,"slug":"funding-1","title":"Funding"},"parentDoc":null,"version":{"_id":"563cc7119799fb0d00047688","__v":18,"project":"563cc7119799fb0d00047685","createdAt":"2015-11-06T15:28:17.683Z","releaseDate":"2015-11-06T15:28:17.683Z","categories":["563cc7129799fb0d00047689","566f37f37ffa002300c3cd5b","56914e9bd47b020d002225ac","5692b19ffe72e00d00e4f0a8","56940bc2d8c04d1700e5adb6","56940bc83e9d080d00f064f0","56951b2dfcb1032d0089df7a","569522aecaa32519009c410c","569523ce562335190016da97","569523fddcaf0d1700cb86bf","56980e4a8560a60d00e2c3c3","569921a41693520d002e1305","5699323b7465970d00650b82","569e6cc4fbee990d0072d927","56a2768a0aefae0d00b7fe66","5862e862b8b7fa23009665b7","592835c7bc8bca0f000cc9ff","596f693df43cca002e690e1c"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Model T","version_clean":"1.0.0","version":"1"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-12-29T19:27:23.574Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","examples":{"codes":[]},"method":"get","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":true,"order":0,"body":"[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Integrating Funding Into Your Platform\"\n}\n[/block]\n1. Use the following API to retrieve a list of all funding and withdrawal methods.\n2. Build your own list view for your user to select an appropriate method. The API response includes logos and full localized text (title, fees, processing time) for you to embed on your platform.\n3. After the user selects the funding method he wishes to use, redirect the user to the URL provided by our API. This URL can be opened in an iframe, new browser window, or WebView.\n4.  Alternatively, use our fully customizable and embeddable widget:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"http://apps.drivewealth.io/funding\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\n**Custom amount inputs:**\n\nBy following the steps above, the user will choose a method on your platform, and then enter the amount and additional details via DriveWealth's UI. To avoid this, you may build your own screen for the user to enter their deposit/withdraw dollar amount. Then, after redirecting the user to the DriveWealth Funding URL:\n\n- If the method does not support Rapid Checkout, the user will enter additional details on our platform before completing the transaction. However, the amount field will be locked to what the user specified in your UI.\n- If the method *does* support Rapid Checkout, the user will immediately be directed to the payment vendor (e.g. PayPal) and will not see the DriveWealth UI at all.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Definition\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"http://apps.drivewealth.io/funding/methods\",\n      \"language\": \"http\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Parameters\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Query Parameter\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Example\",\n    \"h-3\": \"Required\",\n    \"0-0\": \"`partner`\",\n    \"0-1\": \"Used to identify custom integrations.<br />**Note:** Set to `DW` unless noted otherwise.\",\n    \"0-2\": \"`\\\"DW\\\"`\",\n    \"0-3\": \"Yes\",\n    \"1-0\": \"`userID`\",\n    \"2-0\": \"`accountID`\",\n    \"3-0\": \"`language`\",\n    \"4-0\": \"`minAmount`\",\n    \"5-0\": \"`maxAmount`\",\n    \"6-0\": \"`amount`\",\n    \"7-0\": \"`filter[name]`\",\n    \"8-0\": \"`filter[country]`\",\n    \"9-0\": \"`filter[currency]`\",\n    \"10-0\": \"`filter[allowed]`\",\n    \"1-1\": \"User ID\",\n    \"1-2\": \"`\\\"02e57c7d-d071-4c63-b491-1194a9939ea5\\\"`\",\n    \"2-1\": \"Account ID of account funds should be deposited or withdrawn from.<br />**Note:** Required if partner is configured to hide the account switcher\",\n    \"1-3\": \"Yes\",\n    \"2-2\": \"`\\\"02e57c7d-d071-4c63-b491-1194a9939ea5.1452548617456\\\"`\",\n    \"2-3\": \"No\",\n    \"3-1\": \"Default language\",\n    \"3-2\": \"• `\\\"en_US\\\"` (Default)<br />• `\\\"zh_CN\\\"`<br />• `\\\"es_ES\\\"`<br />• `\\\"pt_BR\\\"`\",\n    \"3-3\": \"No\",\n    \"4-1\": \"Minimum deposit or withdraw amount\",\n    \"4-2\": \"`\\\"10\\\"`\",\n    \"4-3\": \"No\",\n    \"5-1\": \"Maximum deposit or withdraw amount\",\n    \"5-2\": \"`\\\"5000\\\"`\",\n    \"5-3\": \"No\",\n    \"6-1\": \"If `amount` is set, `minAmount` and `maxAmount` are not supported. This will enable Rapid Checkout™ where available; otherwise it will force the user to deposit/withdraw the amount supplied.\",\n    \"6-2\": \"`\\\"100\\\"`\",\n    \"6-3\": \"No\",\n    \"7-1\": \"Finds methods whose names contain the supplied string.<br />**Note:** `language` is required if this parameter is used.\",\n    \"7-2\": \"`\\\"china\\\"`\",\n    \"7-3\": \"No\",\n    \"8-1\": \"3 Character Country Code.\\n<br />**Note:** Follows the [ISO 3166-1 format](https://en.wikipedia.org/wiki/ISO_3166-1).\",\n    \"8-2\": \"`\\\"USA\\\"`\",\n    \"8-3\": \"No\",\n    \"9-1\": \"Finds methods where either the deposit or withdrawal supports the supplied currency.<br />**Note: Follows the [ISO 4217 format](https://en.wikipedia.org/wiki/ISO_4217)**\",\n    \"9-2\": \"`\\\"INR\\\"`\",\n    \"9-3\": \"No\",\n    \"10-1\": \"Show only deposit, withdraw or both methods\",\n    \"10-2\": \"• `\\\"DEPOSIT\\\"`<br />• `\\\"WITHDRAW\\\"`<br />• `\\\"DEPOSIT_AND_WITHDRAW\\\"`\",\n    \"10-3\": \"No\"\n  },\n  \"cols\": 4,\n  \"rows\": 11\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Examples\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"GET /funding/methods/?partner=DW&userID=02e57c7d-d071-4c63-b491-1194a9939ea5&language=en_US HTTP/1.1\\nHost: apps.drivewealth.io\\nAccept: application/json\\nx-mysolomeo-session-key: 02e57c7d-d071-4c63-b491-1194a9939ea5.2016-11-01T18:15:11.005Z\",\n      \"language\": \"http\",\n      \"name\": null\n    },\n    {\n      \"code\": \"curl -X GET -H \\\"Content-Type: application/json\\\" -H \\\"x-mysolomeo-session-key: 02e57c7d-d071-4c63-b491-1194a9939ea5.2016-11-01T18:15:11.005Z\\\" \\\"http://apps.drivewealth.io/funding/methods/?partner=DW&userID=02e57c7d-d071-4c63-b491-1194a9939ea5\\\"\",\n      \"language\": \"curl\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Response\"\n}\n[/block]\nEvery method in the array has a default list of attributes.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\n    {\\n    \\\"id\\\": \\\"creditcard\\\",\\n    \\\"name\\\": {\\n      \\\"en_US\\\": \\\"Credit Card\\\",\\n      \\\"es_ES\\\": \\\"Tarjeta de Cargo\\\",\\n      \\\"pt_BR\\\": \\\"Cartão\\\",\\n      \\\"zh_CN\\\": \\\"信用卡\\\"\\n    },\\n    \\\"logo\\\": \\\"https://drivewealth.imgix.net/funding/icons/creditcard.png?h=250&w=250&fit=fill&bg=0FFF\\\",\\n    \\\"deposit\\\": {\\n      \\\"status\\\": true,\\n      \\\"currencies\\\": [\\n        \\\"USD\\\"\\n      ],\\n      \\\"time\\\": {\\n        \\\"en_US\\\": \\\"2 Business Days\\\",\\n        \\\"es_ES\\\": \\\"2 días laborales\\\",\\n        \\\"pt_BR\\\": \\\"2 Dias Úteis\\\",\\n        \\\"zh_CN\\\": \\\"2个工作日\\\"\\n      },\\n      \\\"fees\\\": {\\n        \\\"en_US\\\": \\\"2.19%–3.94%\\\",\\n        \\\"es_ES\\\": \\\"2.19%–3.94%\\\",\\n        \\\"pt_BR\\\": \\\"2.19%–3.94%\\\",\\n        \\\"zh_CN\\\": \\\"2.19%–3.94%\\\"\\n      },\\n      \\\"rapidCheckout\\\": false,\\n      \\\"supportsIframe\\\": true,\\n      \\\"url\\\": \\\"http://apps.drivewealth.io/funding/DW/deposit/creditcard/en_US?partner=DW&userID=02e57c7d-d071-4c63-b491-1194a9939ea5&sessionKey=02e57c7d-d071-4c63-b491-1194a9939ea5.2016-11-01T18:15:11.005Z\\\"\\n    },\\n    \\\"withdraw\\\": {\\n      \\\"status\\\": false\\n    },\\n    \\\"countries\\\": [\\n      \\\"ABW\\\",\\n      \\\"AFG\\\",\\n      \\\"AGO\\\",\\n      \\\"AIA\\\",\\n      \\\"ALA\\\",\\n      \\\"ALB\\\",\\n      ...\\n    ]\\n  },\\n  {...},\\n  {...}\\n]\",\n      \"language\": \"json\",\n      \"name\": \"200 OK\"\n    },\n    {\n      \"code\": \"{\\n    \\\"error\\\": \\\"Bad Request\\\",\\n    \\\"message\\\": \\\"\\\\\\\"userID\\\\\\\" is required\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"400 Bad Request\"\n    }\n  ]\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Type\",\n    \"0-1\": \"`string`\",\n    \"0-0\": \"`id`\",\n    \"1-0\": \"`name`\",\n    \"1-1\": \"`Object{\\n  en_US: string,\\n  ...\\n}`\",\n    \"2-0\": \"`logo`\",\n    \"2-1\": \"`string`\",\n    \"3-0\": \"`deposit`\",\n    \"3-1\": \"`Object`\",\n    \"4-0\": \"`deposit.status`\",\n    \"4-1\": \"`boolean`\",\n    \"5-0\": \"`deposit.currencies`\",\n    \"5-1\": \"`Array<string>`\",\n    \"6-0\": \"`deposit.time`\",\n    \"6-1\": \"`Object{\\n  en_US: string,\\n  ...\\n}`\",\n    \"7-0\": \"`deposit.fee`\",\n    \"7-1\": \"`Object{\\n  en_US: string,\\n  ...\\n}`\",\n    \"8-0\": \"`deposit.rapidCheckout`\",\n    \"8-1\": \"`boolean`\",\n    \"9-0\": \"`deposit.supportsIframe`\",\n    \"9-1\": \"`boolean`\",\n    \"10-0\": \"`deposit.url`\",\n    \"10-1\": \"`string`\",\n    \"h-2\": \"Description\",\n    \"0-2\": \"Identifier of funding method\",\n    \"1-2\": \"The name of the funding method. If the `language` param is sent, this object has only 1 key.\",\n    \"2-2\": \"Official logo to be used for funding method<br />**Note:** If you need custom logo sizes or background color, please get in touch for a custom integration\",\n    \"3-2\": \"Details for depositing using this method\",\n    \"4-2\": \"If `true` then this funding method can be used for depositing funds\",\n    \"5-2\": \"Array of supported currencies.<br />**Note: Follows the [ISO 4217 format](https://en.wikipedia.org/wiki/ISO_4217)**\",\n    \"6-2\": \"The time it takes for a deposit to be processed. If the `language` param is sent, this object has only 1 key.\",\n    \"7-2\": \"The fees charged for a deposit to be processed. If the `language` param is sent, this object has only 1 key.\",\n    \"8-2\": \"Rapid Checkout allows you to bypass the deposit amount entry screen and go directly to the payment vendor (e.g. China Union Pay). This option is only available for methods where this attribute is set to `true`, and when the `amount` param is sent in.\",\n    \"9-2\": \"If `true` funding method can be embedded inside an iframe. If `false`, the URL must be opened in a new window.\",\n    \"10-2\": \"URL of funding method deposit form\"\n  },\n  \"cols\": 3,\n  \"rows\": 11\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Use on Websites\"\n}\n[/block]\nAfter using the API to fetch a list of methods, the URL for depositing or withdrawing can be embedded in an iframe or opened in a new window. Note that the `supportsIframe` property dictates whether a method can be embedded inside an iframe.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var openDepositPage = function(method) {\\n    // the method object is a method received from the API request\\n    if (!method.deposit.supportsIframe) {\\n        window.open(method.deposit.url, \\\"DWFunding\\\");\\n    }\\n    else {\\n        document.getElementById(\\\"fund-iframe\\\").src = method.deposit.url;\\n    }\\n}\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\nIf opened in a new window, the newly-opened page will bubble a message to your site once the user has completed a funding transaction so that the window may be closed. This event can be captured as such:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"var eventMethod = window.addEventListener ? \\\"addEventListener\\\" : \\\"attachEvent\\\";\\nvar eventer = window[eventMethod];\\nvar messageEvent = eventMethod == \\\"attachEvent\\\" ? \\\"onmessage\\\" : \\\"message\\\";\\n\\neventer(messageEvent, function(e) {\\n    if (e.data === \\\"COMPLETE\\\") {\\n        alert(\\\"Yay! You completed funding your account!\\\");\\n    }\\n}, false);\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"list-all-fundingwithdrawal-methods","type":"endpoint","title":"List All Deposit/Withdrawal Methods"}

getList All Deposit/Withdrawal Methods


[block:api-header] { "type": "basic", "title": "Integrating Funding Into Your Platform" } [/block] 1. Use the following API to retrieve a list of all funding and withdrawal methods. 2. Build your own list view for your user to select an appropriate method. The API response includes logos and full localized text (title, fees, processing time) for you to embed on your platform. 3. After the user selects the funding method he wishes to use, redirect the user to the URL provided by our API. This URL can be opened in an iframe, new browser window, or WebView. 4. Alternatively, use our fully customizable and embeddable widget: [block:code] { "codes": [ { "code": "http://apps.drivewealth.io/funding", "language": "http" } ] } [/block] **Custom amount inputs:** By following the steps above, the user will choose a method on your platform, and then enter the amount and additional details via DriveWealth's UI. To avoid this, you may build your own screen for the user to enter their deposit/withdraw dollar amount. Then, after redirecting the user to the DriveWealth Funding URL: - If the method does not support Rapid Checkout, the user will enter additional details on our platform before completing the transaction. However, the amount field will be locked to what the user specified in your UI. - If the method *does* support Rapid Checkout, the user will immediately be directed to the payment vendor (e.g. PayPal) and will not see the DriveWealth UI at all. [block:api-header] { "type": "basic", "title": "Definition" } [/block] [block:code] { "codes": [ { "code": "http://apps.drivewealth.io/funding/methods", "language": "http" } ] } [/block] [block:api-header] { "type": "basic", "title": "Parameters" } [/block] [block:parameters] { "data": { "h-0": "Query Parameter", "h-1": "Description", "h-2": "Example", "h-3": "Required", "0-0": "`partner`", "0-1": "Used to identify custom integrations.<br />**Note:** Set to `DW` unless noted otherwise.", "0-2": "`\"DW\"`", "0-3": "Yes", "1-0": "`userID`", "2-0": "`accountID`", "3-0": "`language`", "4-0": "`minAmount`", "5-0": "`maxAmount`", "6-0": "`amount`", "7-0": "`filter[name]`", "8-0": "`filter[country]`", "9-0": "`filter[currency]`", "10-0": "`filter[allowed]`", "1-1": "User ID", "1-2": "`\"02e57c7d-d071-4c63-b491-1194a9939ea5\"`", "2-1": "Account ID of account funds should be deposited or withdrawn from.<br />**Note:** Required if partner is configured to hide the account switcher", "1-3": "Yes", "2-2": "`\"02e57c7d-d071-4c63-b491-1194a9939ea5.1452548617456\"`", "2-3": "No", "3-1": "Default language", "3-2": "• `\"en_US\"` (Default)<br />• `\"zh_CN\"`<br />• `\"es_ES\"`<br />• `\"pt_BR\"`", "3-3": "No", "4-1": "Minimum deposit or withdraw amount", "4-2": "`\"10\"`", "4-3": "No", "5-1": "Maximum deposit or withdraw amount", "5-2": "`\"5000\"`", "5-3": "No", "6-1": "If `amount` is set, `minAmount` and `maxAmount` are not supported. This will enable Rapid Checkout™ where available; otherwise it will force the user to deposit/withdraw the amount supplied.", "6-2": "`\"100\"`", "6-3": "No", "7-1": "Finds methods whose names contain the supplied string.<br />**Note:** `language` is required if this parameter is used.", "7-2": "`\"china\"`", "7-3": "No", "8-1": "3 Character Country Code.\n<br />**Note:** Follows the [ISO 3166-1 format](https://en.wikipedia.org/wiki/ISO_3166-1).", "8-2": "`\"USA\"`", "8-3": "No", "9-1": "Finds methods where either the deposit or withdrawal supports the supplied currency.<br />**Note: Follows the [ISO 4217 format](https://en.wikipedia.org/wiki/ISO_4217)**", "9-2": "`\"INR\"`", "9-3": "No", "10-1": "Show only deposit, withdraw or both methods", "10-2": "• `\"DEPOSIT\"`<br />• `\"WITHDRAW\"`<br />• `\"DEPOSIT_AND_WITHDRAW\"`", "10-3": "No" }, "cols": 4, "rows": 11 } [/block] [block:api-header] { "type": "basic", "title": "Examples" } [/block] [block:code] { "codes": [ { "code": "GET /funding/methods/?partner=DW&userID=02e57c7d-d071-4c63-b491-1194a9939ea5&language=en_US HTTP/1.1\nHost: apps.drivewealth.io\nAccept: application/json\nx-mysolomeo-session-key: 02e57c7d-d071-4c63-b491-1194a9939ea5.2016-11-01T18:15:11.005Z", "language": "http", "name": null }, { "code": "curl -X GET -H \"Content-Type: application/json\" -H \"x-mysolomeo-session-key: 02e57c7d-d071-4c63-b491-1194a9939ea5.2016-11-01T18:15:11.005Z\" \"http://apps.drivewealth.io/funding/methods/?partner=DW&userID=02e57c7d-d071-4c63-b491-1194a9939ea5\"", "language": "curl" } ] } [/block] [block:api-header] { "type": "basic", "title": "Response" } [/block] Every method in the array has a default list of attributes. [block:code] { "codes": [ { "code": "[\n {\n \"id\": \"creditcard\",\n \"name\": {\n \"en_US\": \"Credit Card\",\n \"es_ES\": \"Tarjeta de Cargo\",\n \"pt_BR\": \"Cartão\",\n \"zh_CN\": \"信用卡\"\n },\n \"logo\": \"https://drivewealth.imgix.net/funding/icons/creditcard.png?h=250&w=250&fit=fill&bg=0FFF\",\n \"deposit\": {\n \"status\": true,\n \"currencies\": [\n \"USD\"\n ],\n \"time\": {\n \"en_US\": \"2 Business Days\",\n \"es_ES\": \"2 días laborales\",\n \"pt_BR\": \"2 Dias Úteis\",\n \"zh_CN\": \"2个工作日\"\n },\n \"fees\": {\n \"en_US\": \"2.19%–3.94%\",\n \"es_ES\": \"2.19%–3.94%\",\n \"pt_BR\": \"2.19%–3.94%\",\n \"zh_CN\": \"2.19%–3.94%\"\n },\n \"rapidCheckout\": false,\n \"supportsIframe\": true,\n \"url\": \"http://apps.drivewealth.io/funding/DW/deposit/creditcard/en_US?partner=DW&userID=02e57c7d-d071-4c63-b491-1194a9939ea5&sessionKey=02e57c7d-d071-4c63-b491-1194a9939ea5.2016-11-01T18:15:11.005Z\"\n },\n \"withdraw\": {\n \"status\": false\n },\n \"countries\": [\n \"ABW\",\n \"AFG\",\n \"AGO\",\n \"AIA\",\n \"ALA\",\n \"ALB\",\n ...\n ]\n },\n {...},\n {...}\n]", "language": "json", "name": "200 OK" }, { "code": "{\n \"error\": \"Bad Request\",\n \"message\": \"\\\"userID\\\" is required\"\n}", "language": "json", "name": "400 Bad Request" } ] } [/block] [block:parameters] { "data": { "h-0": "Attribute", "h-1": "Type", "0-1": "`string`", "0-0": "`id`", "1-0": "`name`", "1-1": "`Object{\n en_US: string,\n ...\n}`", "2-0": "`logo`", "2-1": "`string`", "3-0": "`deposit`", "3-1": "`Object`", "4-0": "`deposit.status`", "4-1": "`boolean`", "5-0": "`deposit.currencies`", "5-1": "`Array<string>`", "6-0": "`deposit.time`", "6-1": "`Object{\n en_US: string,\n ...\n}`", "7-0": "`deposit.fee`", "7-1": "`Object{\n en_US: string,\n ...\n}`", "8-0": "`deposit.rapidCheckout`", "8-1": "`boolean`", "9-0": "`deposit.supportsIframe`", "9-1": "`boolean`", "10-0": "`deposit.url`", "10-1": "`string`", "h-2": "Description", "0-2": "Identifier of funding method", "1-2": "The name of the funding method. If the `language` param is sent, this object has only 1 key.", "2-2": "Official logo to be used for funding method<br />**Note:** If you need custom logo sizes or background color, please get in touch for a custom integration", "3-2": "Details for depositing using this method", "4-2": "If `true` then this funding method can be used for depositing funds", "5-2": "Array of supported currencies.<br />**Note: Follows the [ISO 4217 format](https://en.wikipedia.org/wiki/ISO_4217)**", "6-2": "The time it takes for a deposit to be processed. If the `language` param is sent, this object has only 1 key.", "7-2": "The fees charged for a deposit to be processed. If the `language` param is sent, this object has only 1 key.", "8-2": "Rapid Checkout allows you to bypass the deposit amount entry screen and go directly to the payment vendor (e.g. China Union Pay). This option is only available for methods where this attribute is set to `true`, and when the `amount` param is sent in.", "9-2": "If `true` funding method can be embedded inside an iframe. If `false`, the URL must be opened in a new window.", "10-2": "URL of funding method deposit form" }, "cols": 3, "rows": 11 } [/block] [block:api-header] { "type": "basic", "title": "Use on Websites" } [/block] After using the API to fetch a list of methods, the URL for depositing or withdrawing can be embedded in an iframe or opened in a new window. Note that the `supportsIframe` property dictates whether a method can be embedded inside an iframe. [block:code] { "codes": [ { "code": "var openDepositPage = function(method) {\n // the method object is a method received from the API request\n if (!method.deposit.supportsIframe) {\n window.open(method.deposit.url, \"DWFunding\");\n }\n else {\n document.getElementById(\"fund-iframe\").src = method.deposit.url;\n }\n}", "language": "javascript" } ] } [/block] If opened in a new window, the newly-opened page will bubble a message to your site once the user has completed a funding transaction so that the window may be closed. This event can be captured as such: [block:code] { "codes": [ { "code": "var eventMethod = window.addEventListener ? \"addEventListener\" : \"attachEvent\";\nvar eventer = window[eventMethod];\nvar messageEvent = eventMethod == \"attachEvent\" ? \"onmessage\" : \"message\";\n\neventer(messageEvent, function(e) {\n if (e.data === \"COMPLETE\") {\n alert(\"Yay! You completed funding your account!\");\n }\n}, false);", "language": "javascript" } ] } [/block]