{"__v":3,"_id":"57080180758d432900b117da","category":{"__v":2,"_id":"54d309955616470d0013cc55","pages":["54d309f42ce0e00d00751632","56b36ff3ce8e5a1700f7c3e0"],"project":"542998547a6b69080076806e","version":"542998547a6b690800768071","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-02-05T06:11:33.180Z","from_sync":false,"order":9999,"slug":"api-access","title":"API Access"},"parentDoc":null,"project":"542998547a6b69080076806e","user":"542998207a6b690800768069","version":{"__v":9,"_id":"542998547a6b690800768071","project":"542998547a6b69080076806e","createdAt":"2014-09-29T17:35:16.249Z","releaseDate":"2014-09-29T17:35:16.249Z","categories":["542998547a6b690800768072","5433027990d63b1c0030c0f1","5433028190d63b1c0030c0f2","5433028d9a2b451a00ad4508","5433055790d63b1c0030c10a","5461417d37e5bc200049e1e4","54624066ddd31b0800a58db4","54625de66d1f1010002f3901","54d309955616470d0013cc55"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-04-08T19:07:44.981Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":2,"body":"The SuperRewards PayPage is the most flexible product we've ever designed, giving you a simple payment UX for any virtual good or virtual currency bundle in your app.  \n\nThe simple API lets you define the product at run-time, instead of defining the product price and attributes in advance, so you can rapidly add and change the currency bundles, items, and power-ups that you're promoting to users, without ever logging into our system to do it.\n\nUsers will see a clean payment page that includes your product description and image, and allows them to pay using the method that you have selected.\n\nThis document is perfect for adding a button to your site that lets a user purchase using PayPal, Mobile, Credit Card, or Bitcoin.\n[block:callout]\n{\n  \"type\": \"success\",\n  \"title\": \"One payment method, or many methods?\",\n  \"body\": \"This integration is identical to [PayPage](doc:paypage) in how products are defined and how you integrate.  The only difference is we allow you to specify which payment method to use, instead of allowing the user to choose.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Same integration as PayPage\",\n  \"body\": \"Please read the [PayPage](doc:paypage) document first, then continue here.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"How To Launch\"\n}\n[/block]\nThere are only two changes from [PayPage](doc:paypage) in order to use a certain payment method:\n* **Action**: the `action` field must be set to `popup` instead of `paypage`.  This must be done in the JWT data body, as well as in the query string.\n* **Method**: there is a new `method` field in the JWT data, which is set to the numeric ID of our payment method.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Example\"\n}\n[/block]\nFor example, to sell a $10 sword using PayPal:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"h\\\": \\\"mdgprxkqigh.022997899048\\\",\\n  \\\"uid\\\": \\\"123456789\\\",\\n  \\\"action\\\": \\\"popup\\\",\\n  \\\"timestamp\\\": 1459958191,\\n  \\\"product\\\": {\\n    \\\"title\\\": \\\"Sword of Smiting\\\",\\n    \\\"description\\\": \\\"The shining-est sword in the realm\\\",\\n    \\\"image\\\": \\\"https://cdn.mygame.com/assets/virtual_goods/sword100.png\\\",\\n    \\\"product_code\\\": \\\"sword_smite\\\",\\n    \\\"price\\\": [\\n      {\\\"amount\\\": 10.00, \\\"currency\\\": \\\"USD\\\"}\\n    ]\\n  },\\n  \\\"method\\\": 5032\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nPassed through the JWT encoder, using your app's `secret key` from our system as the JWT secret, you get:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJoIjoibWRncHJ4a3FpZ2guMDIyOTk3ODk5MDQ4IiwidWlkIjoiMTIzNDU2Nzg5IiwicHJvZHVjdCI6eyJ0aXRsZSI6IlN3b3JkIG9mIFNtaXRpbmciLCJkZXNjcmlwdGlvbiI6IlRoZSBzaGluaW5nLWVzdCBzd29yZCBpbiB0aGUgcmVhbG0iLCJpbWFnZSI6Imh0dHA6Ly9jZG4ubXlnYW1lLmNvbS9hc3NldHMvdmlydHVhbF9nb29kcy9zd29yZDEwMC5wbmciLCJwcmljZSI6eyJhbW91bnQiOjEwLCJjdXJyZW5jeSI6IlVTRCJ9fX0.EY-p7d648LUYs2SOuoXzAvUYBeQNbW5kR3s_OtFFIH0\",\n      \"language\": \"text\"\n    }\n  ]\n}\n[/block]\nThat encoded value should be passed to our PayPage endpoint, passing the `action` and `app hash` again so we can identify the web hits well:\nhttps://wall.superrewards.com/payments?action=popup&h=mdgprxkqigh.022997899048&uid=123456&data=<encoded string>\n\n**Note that the action=popup in the JWT data and the query string**\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Method IDs\"\n}\n[/block]\nIn the future we will use easier names, but for now you can use the following ID numbers for different payment methods.  These numbers are what you should use in the \n`\"method\": <id number>` section of the JWT JSON.\nWe will make more methods available here in the future.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Method\",\n    \"h-1\": \"ID Number\",\n    \"0-0\": \"Credit Card (Gate2Shop)\",\n    \"0-1\": \"7197\",\n    \"2-0\": \"Skrill\",\n    \"2-1\": \"5009\",\n    \"3-0\": \"PaySafeCard\",\n    \"3-1\": \"5011\",\n    \"4-0\": \"Centili (Mobile Payments)\",\n    \"4-1\": \"5050\",\n    \"5-0\": \"Fortumo (Mobile Payments)\",\n    \"5-1\": \"5054\",\n    \"6-0\": \"Zong (Mobile Payments)\",\n    \"6-1\": \"3851\",\n    \"1-0\": \"PayPal\",\n    \"1-1\": \"5032\",\n    \"7-0\": \"Prepaid Cards (eg. Subway, CVS)\",\n    \"7-1\": \"5056\",\n    \"8-1\": \"5010\",\n    \"8-0\": \"Rixty\"\n  },\n  \"cols\": 2,\n  \"rows\": 9\n}\n[/block]","excerpt":"A payment landing page for any virtual good or virtual currency.","slug":"paypage-single-method","type":"basic","title":"PayPage Single Method"}

PayPage Single Method

A payment landing page for any virtual good or virtual currency.

The SuperRewards PayPage is the most flexible product we've ever designed, giving you a simple payment UX for any virtual good or virtual currency bundle in your app. The simple API lets you define the product at run-time, instead of defining the product price and attributes in advance, so you can rapidly add and change the currency bundles, items, and power-ups that you're promoting to users, without ever logging into our system to do it. Users will see a clean payment page that includes your product description and image, and allows them to pay using the method that you have selected. This document is perfect for adding a button to your site that lets a user purchase using PayPal, Mobile, Credit Card, or Bitcoin. [block:callout] { "type": "success", "title": "One payment method, or many methods?", "body": "This integration is identical to [PayPage](doc:paypage) in how products are defined and how you integrate. The only difference is we allow you to specify which payment method to use, instead of allowing the user to choose." } [/block] [block:callout] { "type": "warning", "title": "Same integration as PayPage", "body": "Please read the [PayPage](doc:paypage) document first, then continue here." } [/block] [block:api-header] { "type": "basic", "title": "How To Launch" } [/block] There are only two changes from [PayPage](doc:paypage) in order to use a certain payment method: * **Action**: the `action` field must be set to `popup` instead of `paypage`. This must be done in the JWT data body, as well as in the query string. * **Method**: there is a new `method` field in the JWT data, which is set to the numeric ID of our payment method. [block:api-header] { "type": "basic", "title": "Example" } [/block] For example, to sell a $10 sword using PayPal: [block:code] { "codes": [ { "code": "{\n \"h\": \"mdgprxkqigh.022997899048\",\n \"uid\": \"123456789\",\n \"action\": \"popup\",\n \"timestamp\": 1459958191,\n \"product\": {\n \"title\": \"Sword of Smiting\",\n \"description\": \"The shining-est sword in the realm\",\n \"image\": \"https://cdn.mygame.com/assets/virtual_goods/sword100.png\",\n \"product_code\": \"sword_smite\",\n \"price\": [\n {\"amount\": 10.00, \"currency\": \"USD\"}\n ]\n },\n \"method\": 5032\n}", "language": "json" } ] } [/block] Passed through the JWT encoder, using your app's `secret key` from our system as the JWT secret, you get: [block:code] { "codes": [ { "code": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJoIjoibWRncHJ4a3FpZ2guMDIyOTk3ODk5MDQ4IiwidWlkIjoiMTIzNDU2Nzg5IiwicHJvZHVjdCI6eyJ0aXRsZSI6IlN3b3JkIG9mIFNtaXRpbmciLCJkZXNjcmlwdGlvbiI6IlRoZSBzaGluaW5nLWVzdCBzd29yZCBpbiB0aGUgcmVhbG0iLCJpbWFnZSI6Imh0dHA6Ly9jZG4ubXlnYW1lLmNvbS9hc3NldHMvdmlydHVhbF9nb29kcy9zd29yZDEwMC5wbmciLCJwcmljZSI6eyJhbW91bnQiOjEwLCJjdXJyZW5jeSI6IlVTRCJ9fX0.EY-p7d648LUYs2SOuoXzAvUYBeQNbW5kR3s_OtFFIH0", "language": "text" } ] } [/block] That encoded value should be passed to our PayPage endpoint, passing the `action` and `app hash` again so we can identify the web hits well: https://wall.superrewards.com/payments?action=popup&h=mdgprxkqigh.022997899048&uid=123456&data=<encoded string> **Note that the action=popup in the JWT data and the query string** [block:api-header] { "type": "basic", "title": "Method IDs" } [/block] In the future we will use easier names, but for now you can use the following ID numbers for different payment methods. These numbers are what you should use in the `"method": <id number>` section of the JWT JSON. We will make more methods available here in the future. [block:parameters] { "data": { "h-0": "Method", "h-1": "ID Number", "0-0": "Credit Card (Gate2Shop)", "0-1": "7197", "2-0": "Skrill", "2-1": "5009", "3-0": "PaySafeCard", "3-1": "5011", "4-0": "Centili (Mobile Payments)", "4-1": "5050", "5-0": "Fortumo (Mobile Payments)", "5-1": "5054", "6-0": "Zong (Mobile Payments)", "6-1": "3851", "1-0": "PayPal", "1-1": "5032", "7-0": "Prepaid Cards (eg. Subway, CVS)", "7-1": "5056", "8-1": "5010", "8-0": "Rixty" }, "cols": 2, "rows": 9 } [/block]