{"_id":"5d8e503f36d28601f5042616","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":"5bc63538e5a6ba000d22ee6d","project":"550f74bb6fc8130d0038aad3","version":"550f75de61d9d30d00af9e01","__v":0,"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2018-10-16T19:00:08.331Z","from_sync":false,"order":1,"slug":"wyre-sdk","title":"Widget"},"user":"5c8fb57a338d71002afda886","__v":0,"parentDoc":null,"metadata":{"title":"","description":"","image":[]},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2019-09-27T18:09:03.942Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":true,"order":12,"body":"Wyre’s hosted Debit Card Widget is the simplest way to add fiat-to-crypto into your web or mobile application. Users can purchase up to $250.00 per day using Apple Pay, Google Pay, or Masterpass.\n\nVisiting https://pay.sendwyre.com/ starts the checkout. To help your users pay quicker, you can pass in some or all of the following query parameters which will auto-fill into the purchase form.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Query Parameter\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"`dest`\",\n    \"0-1\": \"An [SRN](doc:srns) which is where the funds will be sent after the completes\",\n    \"h-2\": \"Value\",\n    \"0-2\": \"`ethereum:0xYYYY`\\n`bitcoin:1xxxxx`\",\n    \"1-0\": \"`destCurrency`\",\n    \"1-1\": \"Specifies the currency to present for purchase to the user. This is present when a transfer is initiated.\",\n    \"1-2\": \"`ETH`, `BTC`, `DAI` or `USDC`\",\n    \"2-0\": \"`destAmount` or `sourceAmount`\",\n    \"2-1\": \"Currency amount to purchase. **Can only have one param passed in.** Read more [here](https://docs.sendwyre.com/docs/create-transfer). \\n\\nIf not `destAmount` or `sourceAmount` is passed, users will be shown a view with an input with the respective currency label.\",\n    \"2-2\": \"`0.5`\",\n    \"6-0\": \"`secretKey`\",\n    \"6-1\": \"**(only if auth_type is secretKey)** More information [here](https://docs.sendwyre.com/docs/widget-api#authorization)\\n\\n**Optional**\",\n    \"6-2\": \"`your_secret_key`\",\n    \"3-0\": \"`paymentMethod`\",\n    \"3-1\": \"The id of the payment method type you’d like the user to start off with.\",\n    \"3-2\": \"`apple-pay` or `google-pay`\",\n    \"4-0\": \"`redirectUrl`\",\n    \"4-1\": \"A url that the user will be sent to when they select any close button.\\n\\nThe following data will be passed to the redirectUrl as url query parameters: `transferId`, `orderId`, `accountId`, `dest`, `fees`, and `destAmount`\",\n    \"4-2\": \"(iOS) `myapp://`\\n(Web) `https://myapp.com/`\",\n    \"5-0\": \"`accountId`\",\n    \"5-1\": \"Your Wyre Account ID. This associates accounts created inside the widget with you, though it does not give you access to their details\"\n  },\n  \"cols\": 3,\n  \"rows\": 6\n}\n[/block]\nAfter initiating a purchase, users will be taken to a processing view as the payment is being completed. This process takes a bit of time. Once Wyre has initiated a blockchain transaction, the user will be taken to the Purchase Completed view which will display information about the completed transaction.\n\nYou can retrieve additional information for a new purchase, including the blockchain transaction hash, by submitting a GET request to the following URL:\n`https://api.sendwyre.com/v2/transfer/[transferId]/track`\n\nUsers will be shown the following payment methods based on the browser they are using:\n**Apple Pay**\nSafari for macOS Sierra (v12.1.2) or iOS 10 (v602.1)\n\n**Google Pay**\nChrome, Firefox, Safari, Edge, and Opera\n\nHere is an example URL that uses URL parameters to help improve UX:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"https://pay.sendwyre.com/purchase?\\ndestCurrency=BTC&sourceAmount=10&\\ndest=2NGZrVvZG92qGYqzTLjCAewvPZ7JE8S8VxE&\\npaymentMethod=apple-pay\",\n      \"language\": \"text\",\n      \"name\": \"Example URL\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"title\": \"Wallet Order Webhook\"\n}\n[/block]\nThis section covers how to receive wallet orders webhook updates when Digital Wallet orders change status. \n\nPassing parameters in the Widget:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"https://pay.testwyre.com/?type=debitcard-hosted&dest=ethereum%3A0x98B031783d0efb1E65C4072C6576BaCa0736A912&destCurrency=ETH&sourceAmount=10&paymentMethod=apple-pay&referenceId=your_own_id&accountId=YOUR_ACCOUNT\",\n      \"language\": \"text\",\n      \"name\": \"Hosted Mode\"\n    },\n    {\n      \"code\": \"{\\n    accountId: \\\"YOUR_ACCOUNT\\\",\\n    referrerId: \\\"your_own_id\\\",\\n    type: \\\"debitcard\\\",\\n    dest: \\\"ethereum:0x98B031783d0efb1E65C4072C6576BaCa0736A912\\\",\\n    destCurrency: \\\"ETH\\\",\\n    sourceAmount: 10.0,\\n    paymentMethod: 'apple-pay'\\n}\",\n      \"language\": \"json\",\n      \"name\": \"Embedded Mode\"\n    }\n  ]\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"`referenceId`\",\n    \"0-1\": \"Your own business id.\",\n    \"0-2\": \"String, optional\",\n    \"h-2\": \"Required\",\n    \"h-1\": \"Description\",\n    \"h-0\": \"Parameter\",\n    \"1-0\": \"`accountId`\",\n    \"1-1\": \"Your Wyre account id.\",\n    \"1-2\": \"String, required for the webhook to work.\"\n  },\n  \"cols\": 3,\n  \"rows\": 2\n}\n[/block]\nRegistering the Webhook (with OPS team)\n\nAsk the Wyre OPS team to register your webhook URL by providing them your `accountId`and the `url`.  This configuration is per environment. \n\nThe webhook will be called for any state change in orders which were submitted with an `accountId`\nthat has a webhook URL configured. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \" \\n{\\n  \\\"referenceId\\\":\\\"your_reference_id\\\", // your own id passed in the order creation\\n   \\\"accountId\\\":\\\"AAAAAAAAAAA\\\", // your Wyre account id\\n   \\\"orderId\\\":\\\"WO_0000000001\\\", // the wallet order id\\n   \\\"orderStatus\\\":\\\"PROCESSING\\\", // the order status {PROCESSING, COMPLETE, FAILED}]\\n   \\\"transferId\\\":\\\"TF_000000001\\\", // OPTIONAL, available when order was completed,  the transfer id\\n   \\\"failedReason\\\":\\\" OPTIONAL,  some string with failed reason\\\" // if failed, there should be a reason string when possible\\n}\\n\",\n      \"language\": \"json\",\n      \"name\": \"Webhook response\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"hosted-widget-1","type":"basic","title":"Hosted Widget (Debit Card)"}

Hosted Widget (Debit Card)


Wyre’s hosted Debit Card Widget is the simplest way to add fiat-to-crypto into your web or mobile application. Users can purchase up to $250.00 per day using Apple Pay, Google Pay, or Masterpass. Visiting https://pay.sendwyre.com/ starts the checkout. To help your users pay quicker, you can pass in some or all of the following query parameters which will auto-fill into the purchase form. [block:parameters] { "data": { "h-0": "Query Parameter", "h-1": "Description", "0-0": "`dest`", "0-1": "An [SRN](doc:srns) which is where the funds will be sent after the completes", "h-2": "Value", "0-2": "`ethereum:0xYYYY`\n`bitcoin:1xxxxx`", "1-0": "`destCurrency`", "1-1": "Specifies the currency to present for purchase to the user. This is present when a transfer is initiated.", "1-2": "`ETH`, `BTC`, `DAI` or `USDC`", "2-0": "`destAmount` or `sourceAmount`", "2-1": "Currency amount to purchase. **Can only have one param passed in.** Read more [here](https://docs.sendwyre.com/docs/create-transfer). \n\nIf not `destAmount` or `sourceAmount` is passed, users will be shown a view with an input with the respective currency label.", "2-2": "`0.5`", "6-0": "`secretKey`", "6-1": "**(only if auth_type is secretKey)** More information [here](https://docs.sendwyre.com/docs/widget-api#authorization)\n\n**Optional**", "6-2": "`your_secret_key`", "3-0": "`paymentMethod`", "3-1": "The id of the payment method type you’d like the user to start off with.", "3-2": "`apple-pay` or `google-pay`", "4-0": "`redirectUrl`", "4-1": "A url that the user will be sent to when they select any close button.\n\nThe following data will be passed to the redirectUrl as url query parameters: `transferId`, `orderId`, `accountId`, `dest`, `fees`, and `destAmount`", "4-2": "(iOS) `myapp://`\n(Web) `https://myapp.com/`", "5-0": "`accountId`", "5-1": "Your Wyre Account ID. This associates accounts created inside the widget with you, though it does not give you access to their details" }, "cols": 3, "rows": 6 } [/block] After initiating a purchase, users will be taken to a processing view as the payment is being completed. This process takes a bit of time. Once Wyre has initiated a blockchain transaction, the user will be taken to the Purchase Completed view which will display information about the completed transaction. You can retrieve additional information for a new purchase, including the blockchain transaction hash, by submitting a GET request to the following URL: `https://api.sendwyre.com/v2/transfer/[transferId]/track` Users will be shown the following payment methods based on the browser they are using: **Apple Pay** Safari for macOS Sierra (v12.1.2) or iOS 10 (v602.1) **Google Pay** Chrome, Firefox, Safari, Edge, and Opera Here is an example URL that uses URL parameters to help improve UX: [block:code] { "codes": [ { "code": "https://pay.sendwyre.com/purchase?\ndestCurrency=BTC&sourceAmount=10&\ndest=2NGZrVvZG92qGYqzTLjCAewvPZ7JE8S8VxE&\npaymentMethod=apple-pay", "language": "text", "name": "Example URL" } ] } [/block] [block:api-header] { "title": "Wallet Order Webhook" } [/block] This section covers how to receive wallet orders webhook updates when Digital Wallet orders change status. Passing parameters in the Widget: [block:code] { "codes": [ { "code": "https://pay.testwyre.com/?type=debitcard-hosted&dest=ethereum%3A0x98B031783d0efb1E65C4072C6576BaCa0736A912&destCurrency=ETH&sourceAmount=10&paymentMethod=apple-pay&referenceId=your_own_id&accountId=YOUR_ACCOUNT", "language": "text", "name": "Hosted Mode" }, { "code": "{\n accountId: \"YOUR_ACCOUNT\",\n referrerId: \"your_own_id\",\n type: \"debitcard\",\n dest: \"ethereum:0x98B031783d0efb1E65C4072C6576BaCa0736A912\",\n destCurrency: \"ETH\",\n sourceAmount: 10.0,\n paymentMethod: 'apple-pay'\n}", "language": "json", "name": "Embedded Mode" } ] } [/block] [block:parameters] { "data": { "0-0": "`referenceId`", "0-1": "Your own business id.", "0-2": "String, optional", "h-2": "Required", "h-1": "Description", "h-0": "Parameter", "1-0": "`accountId`", "1-1": "Your Wyre account id.", "1-2": "String, required for the webhook to work." }, "cols": 3, "rows": 2 } [/block] Registering the Webhook (with OPS team) Ask the Wyre OPS team to register your webhook URL by providing them your `accountId`and the `url`. This configuration is per environment. The webhook will be called for any state change in orders which were submitted with an `accountId` that has a webhook URL configured. [block:code] { "codes": [ { "code": " \n{\n \"referenceId\":\"your_reference_id\", // your own id passed in the order creation\n \"accountId\":\"AAAAAAAAAAA\", // your Wyre account id\n \"orderId\":\"WO_0000000001\", // the wallet order id\n \"orderStatus\":\"PROCESSING\", // the order status {PROCESSING, COMPLETE, FAILED}]\n \"transferId\":\"TF_000000001\", // OPTIONAL, available when order was completed, the transfer id\n \"failedReason\":\" OPTIONAL, some string with failed reason\" // if failed, there should be a reason string when possible\n}\n", "language": "json", "name": "Webhook response" } ] } [/block]