{"_id":"5be5cfec6d6c0f0044ccfdac","project":"550f74bb6fc8130d0038aad3","version":{"_id":"550f75de61d9d30d00af9e01","__v":17,"project":"550f74bb6fc8130d0038aad3","forked_from":"550f74bb6fc8130d0038aad6","createdAt":"2015-03-23T02:09:34.221Z","releaseDate":"2015-03-23T02:09:34.221Z","categories":["550f75de61d9d30d00af9e02","551027e38579861900a86698","551029e08579861900a8669a","551029e7498062190006328a","5bc633a722d682005c9ad9e4","5bc633b08c4b0b000d6a7eaa","5bc633b48f3ff600626e3e18","5bc63538e5a6ba000d22ee6d","5bc63587a18a6b000decd295","5bc635c0937fcb0056223d9c","5bc6360f42f41800319aeaa6","5be5d13ff1d319002baca9ce","5be5d2287cd14d00291fbfdb","5be8b3b09f7cb70023c56a39","5be8b3cbb910100044e20206","5c1d769a4f6aed001fe527f0","5c402942010f0d001496dded"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"3.0.0","version":"3"},"category":{"_id":"5bc633b08c4b0b000d6a7eaa","project":"550f74bb6fc8130d0038aad3","version":"550f75de61d9d30d00af9e01","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2018-10-16T18:53:36.184Z","from_sync":false,"order":7,"slug":"payment-methods","title":"Payment Methods"},"user":"54eb883f4f94620d00789aaa","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2018-11-09T18:20:28.968Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","examples":{"codes":[]},"method":"post","apiSetting":null,"auth":"required","params":[],"url":""},"isReference":true,"order":2,"body":"The Wyre `LOCAL_TRANSFER` connection flow leverages the Plaid connect account UI in order to make it easy for your customers to connect their bank account to their Wyre account.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/f841fe2-Screen_Shot_2018-11-21_at_11.49.31_AM.png\",\n        \"Screen Shot 2018-11-21 at 11.49.31 AM.png\",\n        754,\n        1108,\n        \"#999a9b\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Payment Method Creation Flow\"\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/f97d854-PM_flow_1.png\",\n        \"PM flow (1).png\",\n        1084,\n        748,\n        \"#15274f\"\n      ],\n      \"caption\": \"Diagram of flow\"\n    }\n  ]\n}\n[/block]\n1. User creates a record on the Wyre API via the Wyre Bank Connection UI module\n2. The Wyre API will return a `publicToken` that corresponds to the newly created record to the Wyre Bank Connection module\n3. The Wyre Bank Connection module hands `publicToken` to your frontend application\n4. Your frontend application sends the `publicToken` to your server\n5. Your server sends the `publicToken` and the user's Account ID to the Wyre API, which will connect the Payment Method record on Wyre to the User's account (See [LOCAL_TRANSFER (ACH) - Create Payment Method](doc:local_transfer-ach-create-payment-method) for this API call)\n6. The Wyre API returns with the newly created Payment Method\n[block:api-header]\n{\n  \"title\": \"Injecting the Wyre Bank Connection module\"\n}\n[/block]\nThe following is an example of how you might invoke the Wyre Bank Connection module within your frontend application.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<!DOCTYPE html>\\n<html>\\n<head>\\n\\t<script src=\\\"https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js\\\"></script>\\n\\t<script src=\\\"https://cdn.plaid.com/link/v2/stable/link-initialize.js\\\"></script>\\n\\t<script src=\\\"https://verify.sendwyre.com/js/pm-widget-init.js\\\"></script>\\n\\t<script type=\\\"text/javascript\\\">\\n\\t\\tvar handler = new WyrePmWidget({\\n\\t\\t\\tenv: \\\"test\\\",\\n\\t\\t\\tonLoad: function(){\\n\\t\\t\\t\\t// In this example we open the modal immediately on load. More typically you might have the handler.open() invocation attached to a button.\\n\\t\\t\\t\\thandler.open();\\n\\t\\t\\t},\\n\\t\\t\\tonSuccess: function(result){\\n        // Here you would forward the publicToken back to your server in order to  be shipped to the Wyre API\\n        console.log(result.publicToken);\\n\\t\\t\\t},\\n\\t\\t\\tonExit: function(err){\\n\\t\\t\\t\\tif (err != null) {\\n        \\t// The user encountered an error prior to exiting the module\\n      \\t}\\n\\t\\t\\t\\tconsole.log(\\\"Thingo exited:\\\", err);\\n\\t\\t\\t}\\n\\t\\t});\\n\\t\\t\\n\\t</script>\\n</head>\\n<body>\\n\\n</body>\\n</html>\",\n      \"language\": \"html\"\n    }\n  ]\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"field\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"env\",\n    \"1-0\": \"onLoad\",\n    \"2-0\": \"onSuccess\",\n    \"3-0\": \"onExit\",\n    \"1-1\": \"function that is invoked when the module has fully loaded/initialized\",\n    \"2-1\": \"function that is invoked when the user has successfully connected their account. This function should take a result object. See the example above to get the publicToken from the object.\",\n    \"0-1\": \"the environment the module will attach to. Options include: `test` and `production`\",\n    \"3-1\": \"function that is invoked when the user closes the bank connection window without following the flow to completion. This can be because the user abandoned the flow, or because they encountered an error. If there was an error, it will be passed into this method.\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Creating the Payment Method\"\n}\n[/block]\nOnce you have the `publicToken` refer to the [LOCAL_TRANSFER (ACH) - Create Payment Method](doc:local_transfer-ach-create-payment-method) API for details finishing the link.","excerpt":"","slug":"create-ach-payment-method","type":"basic","title":"ACH - Connect Bank"}

ACH - Connect Bank


The Wyre `LOCAL_TRANSFER` connection flow leverages the Plaid connect account UI in order to make it easy for your customers to connect their bank account to their Wyre account. [block:image] { "images": [ { "image": [ "https://files.readme.io/f841fe2-Screen_Shot_2018-11-21_at_11.49.31_AM.png", "Screen Shot 2018-11-21 at 11.49.31 AM.png", 754, 1108, "#999a9b" ] } ] } [/block] [block:api-header] { "title": "Payment Method Creation Flow" } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/f97d854-PM_flow_1.png", "PM flow (1).png", 1084, 748, "#15274f" ], "caption": "Diagram of flow" } ] } [/block] 1. User creates a record on the Wyre API via the Wyre Bank Connection UI module 2. The Wyre API will return a `publicToken` that corresponds to the newly created record to the Wyre Bank Connection module 3. The Wyre Bank Connection module hands `publicToken` to your frontend application 4. Your frontend application sends the `publicToken` to your server 5. Your server sends the `publicToken` and the user's Account ID to the Wyre API, which will connect the Payment Method record on Wyre to the User's account (See [LOCAL_TRANSFER (ACH) - Create Payment Method](doc:local_transfer-ach-create-payment-method) for this API call) 6. The Wyre API returns with the newly created Payment Method [block:api-header] { "title": "Injecting the Wyre Bank Connection module" } [/block] The following is an example of how you might invoke the Wyre Bank Connection module within your frontend application. [block:code] { "codes": [ { "code": "<!DOCTYPE html>\n<html>\n<head>\n\t<script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js\"></script>\n\t<script src=\"https://cdn.plaid.com/link/v2/stable/link-initialize.js\"></script>\n\t<script src=\"https://verify.sendwyre.com/js/pm-widget-init.js\"></script>\n\t<script type=\"text/javascript\">\n\t\tvar handler = new WyrePmWidget({\n\t\t\tenv: \"test\",\n\t\t\tonLoad: function(){\n\t\t\t\t// In this example we open the modal immediately on load. More typically you might have the handler.open() invocation attached to a button.\n\t\t\t\thandler.open();\n\t\t\t},\n\t\t\tonSuccess: function(result){\n // Here you would forward the publicToken back to your server in order to be shipped to the Wyre API\n console.log(result.publicToken);\n\t\t\t},\n\t\t\tonExit: function(err){\n\t\t\t\tif (err != null) {\n \t// The user encountered an error prior to exiting the module\n \t}\n\t\t\t\tconsole.log(\"Thingo exited:\", err);\n\t\t\t}\n\t\t});\n\t\t\n\t</script>\n</head>\n<body>\n\n</body>\n</html>", "language": "html" } ] } [/block] [block:parameters] { "data": { "h-0": "field", "h-1": "Description", "0-0": "env", "1-0": "onLoad", "2-0": "onSuccess", "3-0": "onExit", "1-1": "function that is invoked when the module has fully loaded/initialized", "2-1": "function that is invoked when the user has successfully connected their account. This function should take a result object. See the example above to get the publicToken from the object.", "0-1": "the environment the module will attach to. Options include: `test` and `production`", "3-1": "function that is invoked when the user closes the bank connection window without following the flow to completion. This can be because the user abandoned the flow, or because they encountered an error. If there was an error, it will be passed into this method." }, "cols": 2, "rows": 4 } [/block] [block:api-header] { "title": "Creating the Payment Method" } [/block] Once you have the `publicToken` refer to the [LOCAL_TRANSFER (ACH) - Create Payment Method](doc:local_transfer-ach-create-payment-method) API for details finishing the link.