{"id":221815,"date":"2014-05-05T17:28:03","date_gmt":"2014-05-05T13:28:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=221815"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=221815","title":{"rendered":"<span class=\"post_title\">\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0441\u0430\u0439\u0442, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Laravel \u0438 Recurly. \u0427\u0430\u0441\u0442\u044c 2<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c, \u0425\u0430\u0431\u0440! \u041f\u043e\u0441\u043b\u0435 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f <a href=\"http:\/\/habrahabr.ru\/post\/195690\/\">\u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/a>, \u044f \u043d\u0430\u0447\u0430\u043b \u0438\u0441\u043a\u0430\u0442\u044c \u0432\u0442\u043e\u0440\u0443\u044e, \u043d\u043e \u0435\u0451 \u043d\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0448\u0438\u043b \u0441\u0430\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434. \u0418\u0442\u0430\u043a, \u043d\u0430\u0447\u043d\u0435\u043c.<\/p>\n<h5>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h5>\n<p>   \u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0435\u0440\u0438\u0438 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0433\u043e\u043b\u044b\u0439 \u043a\u043e\u0441\u0442\u044f\u043a \u0441\u0430\u0439\u0442\u0430 \u0441 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0430\u043c\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Laravel. \u0422\u0430\u043a \u0436\u0435, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0441\u0430\u0439\u0442 \u0441 \u0440\u043e\u043b\u044f\u043c\u0438 \u0438 \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u043e\u043b\u0435\u0439 \u0434\u043b\u044f \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043f\u043e\u0434\u043e\u0448\u043b\u0438 \u043a \u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443, \u0433\u0434\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044e, \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u0432\u044b\u0445\u043e\u0434.<br \/>   \u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c Recurly \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u0430\u0448\u0438\u0445 \u043f\u043b\u0430\u0442\u043d\u044b\u0445 \u043f\u043b\u0430\u043d\u043e\u0432 \u0447\u043b\u0435\u043d\u0441\u0442\u0432\u0430.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u043a \u0440\u0430\u0431\u043e\u0442\u0435<\/h4>\n<p>  \u0415\u0441\u0442\u044c \u0434\u0432\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Recurly \u2014 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 PHP, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0440\u0430\u043d\u0435\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e composer (\u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438) \u0438 Recurly JS. Recurly JS \u2014 \u044d\u0442\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0444\u043e\u0440\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0441 \u043a\u0430\u0440\u0442.<br \/>  \u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043a\u0430\u0440\u0442 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430\u0445 Recurly, \u0430 \u043d\u0435 \u0432 \u043d\u0430\u0448\u0435\u043c \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0447\u0442\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442 \u043d\u0430\u0448\u0443 \u0433\u043e\u043b\u043e\u0432\u043d\u0443\u044e \u0431\u043e\u043b\u044c.<\/p>\n<p>  \u0421\u043a\u0430\u0447\u0430\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <a href=\"https:\/\/github.com\/recurly\/recurly-js\/zipball\/master\">Recurly JS<\/a> \u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c <b>recurly.min.js<\/b> \u0438\u0437 \u043f\u0430\u043f\u043a\u0438 \u0441\u0431\u043e\u0440\u043a\u0438 \u0432 \u043f\u0430\u043f\u043a\u0443 <b>public\/js\/libs<\/b> \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0433\u043e \u0432 \u043c\u0430\u043a\u0435\u0442\u0435 \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0438\u043c \u0442\u0435\u0433\u043e\u043c:  <\/p>\n<pre><code class=\"html\">&lt;script src=&quot;\/js\/libs\/recurly.min.js&quot;&gt;&lt;\/script&gt; &lt;\/body&gt; <\/code><\/pre>\n<p>  \u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c CSS-\u0441\u0442\u0438\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0444\u043e\u0440\u043c\u044b \u043e\u043f\u043b\u0430\u0442\u044b. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 <b> css\/recurly<\/b> \u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u0432 \u043d\u0435\u0433\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e themes, \u0430 \u0437\u0430\u0442\u0435\u043c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043d\u0435\u0433\u043e \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u0430\u043a\u0435\u0442\u0430  <\/p>\n<pre><code class=\"html\">&lt;link href=&quot;\/css\/recurly\/themes\/default\/recurly.css&quot; rel=&quot;stylesheet&quot;&gt; <\/code><\/pre>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u0437\u0430\u043b\u043e\u0433\u0438\u043d\u0438\u0442\u0435\u0441\u044c \u043f\u043e\u0441\u043b\u0435 <a href=\"http:\/\/recurly.com\/\">\u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u0441 Recurly<\/a>, \u0432\u0430\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0430\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u043f\u043b\u0430\u043d\u044b \u043f\u043e\u0434\u043f\u0438\u0441\u043e\u043a. \u0412 <a href=\"http:\/\/habrahabr.ru\/post\/195690\/\">\u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/a> \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0442\u0440\u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u0443\u0440\u043e\u0432\u043d\u044f \u043f\u043e\u0434\u043f\u0438\u0441\u043e\u043a \u2014 \u0431\u0440\u043e\u043d\u0437\u0430, \u0441\u0435\u0440\u0435\u0431\u0440\u043e \u0438 \u0437\u043e\u043b\u043e\u0442\u043e. \u0412\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0438\u0445 \u0438\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0435, \u043d\u043e \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0432\u0440\u0435\u0434\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0441\u0435\u0439\u0447\u0430\u0441.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u043b\u0430\u043d \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <i>\u0411\u0440\u043e\u043d\u0437\u043e\u0432\u044b\u0439<\/i>; \u0411\u0443\u0434\u044c\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u044b, \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e \u0431\u044b \u043f\u043b\u0430\u043d \u043a\u043e\u0434\u0430 \u0431\u044b\u043b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d <u><i> \u201cbronze\u201d<\/i><\/u> (\u0432 \u043d\u0438\u0436\u043d\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435). \u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0446\u0435\u043d\u0443 \u2014 \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b \u00a3 4,99 \u0432 \u043c\u0435\u0441\u044f\u0446, \u043d\u043e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u0441\u0443\u043c\u043c\u0443 \u0438 \/ \u0438\u043b\u0438 \u0441\u0440\u043e\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0430\u043c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f. \u041f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u0434\u043d\u043e\u0440\u0430\u0437\u043e\u0432\u0443\u044e \u043f\u043b\u0430\u0442\u0443 \u0438\u043b\u0438 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0439 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0435\u0440\u0438\u043e\u0434.<\/p>\n<p>  \u041f\u043e\u0432\u0442\u043e\u0440\u0438\u0442\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0435\u0449\u0435 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0441\u0435\u0440\u0435\u0431\u0440\u044f\u043d\u043e\u0433\u043e (\u043a\u043e\u0434: \u00absilver\u00bb) \u0438 \u0437\u043e\u043b\u043e\u0442\u043e\u0433\u043e (\u043a\u043e\u0434: \u00abgold\u00bb) \u043f\u043b\u0430\u043d\u043e\u0432. \u042f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043f\u0440\u0438 \u00a3 9.99 \u0438 \u00a3 14,99 \u0432 \u043c\u0435\u0441\u044f\u0446 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u0430\u0434\u043c\u0438\u043d-\u043f\u0430\u043d\u0435\u043b\u044c Recurly, \u0433\u0434\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0435\u0449\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430\u0439\u0442\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u0434\u043e\u0441\u0442\u0443\u043f API \u043d\u0430 \u043b\u0435\u0432\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435. \u0429\u0435\u043b\u043a\u043d\u0438\u0442\u0435 \u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f API. \u0417\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0441\u0432\u043e\u0439 \u200b\u200b\u043a\u043b\u044e\u0447 API, \u0438 \u0432\u0430\u0448 \u043f\u043e\u0434\u0434\u043e\u043c\u0435\u043d.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 Recurly.js \u043d\u0430 \u043b\u0435\u0432\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 (\u043f\u043e\u0434 \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a (Developer)). \u0429\u0435\u043b\u043a\u043d\u0438\u0442\u0435 \u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c Recurly.js \u0438 Transparent Post API. \u0417\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u0432\u0430\u0448 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0444\u0430\u0439\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 Recurly \u0432 \u043f\u0430\u043f\u043a\u0435 <b>app\/config\/recurly.php<\/b>, \u0437\u0430\u043c\u0435\u043d\u044f\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441 \u0442\u0435\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0442\u0440\u0435\u0445\u0437\u043d\u0430\u0447\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u0443\u044e \u0432\u0430\u043c\u0438 \u0432\u0430\u043b\u044e\u0442\u0443 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, USD, GBP, AUD):  <\/p>\n<pre><code class=\"php\">&lt;?php return array(     'api_key'          =&gt; 'YOUR-API-KEY',     'private_key'      =&gt; 'YOUR-PRIVATE-KEY',     'subdomain'        =&gt; 'YOUR-SUBDOMAIN',     'default_currency' =&gt; 'XYZ' ); <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0432\u0441\u043f\u043b\u044b\u0432\u0430\u044e\u0449\u0438\u043c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f\u043c \u043d\u0430 \u043b\u0435\u0432\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u0435. \u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0443 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c. \u0412\u0432\u0435\u0434\u0438\u0442\u0435 URL \u0430\u0434\u0440\u0435\u0441 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u043a\u043b\u044e\u0447\u0430\u044f <i>\/recurly<\/i>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <i><a href=\"http:\/\/www.example.com\/recurly\">www.example.com\/recurly<\/a><\/i>. \u041e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043f\u043e\u043b\u044f HTTP \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0418\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (Username) \u0438 HTTP \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0430\u0440\u043e\u043b\u044f (Password) \u043f\u0443\u0441\u0442\u044b\u043c\u0438 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442.<\/p>\n<h4>\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438<\/h4>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u043f\u043b\u0430\u043d. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043f\u0443\u0442\u0438 <b>app\/views\/home<\/b> \u0444\u0430\u0439\u043b <b>signup.blade.php<\/b> \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435\u043c:  <\/p>\n<pre><code class=\"php\">@extends('layouts.default')   @section('content')     &lt;h1&gt;Signup&lt;\/h1&gt;     &lt;p&gt;Please select your plan...&lt;\/p&gt;     &lt;div class=&quot;row-fluid pricing-table pricing-three-column&quot;&gt;     &lt;div class=&quot;span4 plan&quot;&gt;       &lt;div class=&quot;plan-name-bronze&quot;&gt;       &lt;h2&gt;Bronze&lt;\/h2&gt;       &lt;span&gt;&pound;4.99 \/ Month&lt;\/span&gt;       &lt;\/div&gt;       &lt;ul&gt;       &lt;li class=&quot;plan-feature&quot;&gt;Feature #1&lt;\/li&gt;       &lt;li class=&quot;plan-feature&quot;&gt;Feature #2&lt;\/li&gt;       &lt;li class=&quot;plan-feature&quot;&gt;&lt;a href=&quot;\/user\/register\/bronze&quot; class=&quot;btn btn-primary btn-plan-select&quot;&gt;&lt;i class=&quot;icon-white icon-ok&quot;&gt;&lt;\/i&gt; Select&lt;\/a&gt;&lt;\/li&gt;       &lt;\/ul&gt;     &lt;\/div&gt;     &lt;div class=&quot;span4 plan&quot;&gt;       &lt;div class=&quot;plan-name-silver&quot;&gt;       &lt;h2&gt;Silver &lt;span class=&quot;badge badge-warning&quot;&gt;Popular&lt;\/span&gt;&lt;\/h2&gt;       &lt;span&gt;&pound;9.99 \/ Month&lt;\/span&gt;       &lt;\/div&gt;       &lt;ul&gt;       &lt;li class=&quot;plan-feature&quot;&gt;Feature #1&lt;\/li&gt;       &lt;li class=&quot;plan-feature&quot;&gt;Feature #2&lt;\/li&gt;       &lt;li class=&quot;plan-feature&quot;&gt;&lt;a href=&quot;\/user\/register\/silver&quot; class=&quot;btn btn-primary btn-plan-select&quot;&gt;&lt;i class=&quot;icon-white icon-ok&quot;&gt;&lt;\/i&gt; Select&lt;\/a&gt;&lt;\/li&gt;       &lt;\/ul&gt;     &lt;\/div&gt;     &lt;div class=&quot;span4 plan&quot;&gt;       &lt;div class=&quot;plan-name-gold&quot;&gt;       &lt;h2&gt;Gold&lt;\/h2&gt;       &lt;span&gt;&pound;4.99 \/ Month&lt;\/span&gt;       &lt;\/div&gt;       &lt;ul&gt;       &lt;li class=&quot;plan-feature&quot;&gt;Feature #1&lt;\/li&gt;       &lt;li class=&quot;plan-feature&quot;&gt;Feature #2&lt;\/li&gt;       &lt;li class=&quot;plan-feature&quot;&gt;&lt;a href=&quot;\/user\/register\/gold&quot; class=&quot;btn btn-primary btn-plan-select&quot;&gt;&lt;i class=&quot;icon-white icon-ok&quot;&gt;&lt;\/i&gt; Select&lt;\/a&gt;&lt;\/li&gt;       &lt;\/ul&gt;     &lt;\/div&gt;     &lt;\/div&gt;   @stop <\/code><\/pre>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0441\u0432\u043e\u0435\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0446\u0435\u043d, \u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Recurly API \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u044d\u0442\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 <b>css\/style.css:<\/b>  <\/p>\n<pre><code class=\"css\">.pricing-table .plan {     background-color: #f3f3f3;     text-align: center; }   .plan:hover {     background-color: #fff; }   .plan {     color: #fff;     background-color: #5e5f59;     padding: 20px; }     .plan-name-bronze {     background-color: #665D1E;     color: #fff;     padding: 20px; }     .plan-name-silver {     background-color: #C0C0C0;     color: #fff;     padding: 20px; }     .plan-name-gold {     background-color: #FFD700;     color: #fff;     padding: 20px; }      .pricing-table-bronze  {     background-color: #f89406;     color: #fff;     padding: 20px; }     .pricing-table .plan .plan-name span {     font-size: 20px; }    .pricing-table .plan ul {     list-style: none;     margin: 0; }    .pricing-table .plan ul li.plan-feature {     border-top: 1px solid #c5c8c0;     padding: 15px 10px; }    .pricing-three-column {     margin: 0 auto;     width: 80%; }    .pricing-variable-height .plan {     display: inline-block;     float: none;     margin-left: 2%;     vertical-align: bottom;     zoom:1;     *display:inline; }    .plan-mouseover .plan-name {     background-color: #4e9a06 !important; }    .btn-plan-select {     font-size: 18px;     padding: 8px 25px; } <\/code><\/pre>\n<p>  \u0418 \u043d\u0430\u043a\u043e\u043d\u0435\u0446 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0432 <b>app\/routes.php<\/b>  <\/p>\n<pre><code class=\"php\">Route::get('\/signup', function() {     return View::make('home\/signup'); }); <\/code><\/pre>\n<h4>\u041f\u0440\u0438\u0435\u043c \u043f\u043b\u0430\u0442\u0435\u0436\u0435\u0439<\/h4>\n<p>  \u0412\u043e\u0442 \u043c\u044b \u0438 \u0434\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c \u0434\u043e \u043f\u0443\u043d\u043a\u0442\u0430 \u043f\u0440\u0438\u0435\u043c\u0430 \u043f\u043b\u0430\u0442\u0435\u0436\u0435\u0439, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u2014 \u043e\u043f\u043b\u0430\u0442\u0430.<br \/>  \u0412\u043e \u043f\u0435\u0440\u0432\u044b\u0445, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043c <b>user\/register<\/b> POST \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430(callback). \u0412\u043c\u0435\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0430 \u0434\u043e\u043c\u0430\u0448\u043d\u044e\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043e\u043f\u043b\u0430\u0442\u044b. \u0417\u0430\u043c\u0435\u043d\u0438\u0442\u0435 \u044d\u0442\u0438 \u0441\u0442\u0440\u043e\u043a\u0438:  <\/p>\n<pre><code class=\"php\">return Redirect::to('\/')-&gt;with(     'success',     'Welcome to the site, . Auth::user()-&gt;name . '!' ); <\/code><\/pre>\n<p>  \u043d\u0430 \u044d\u0442\u0438:  <\/p>\n<pre><code class=\"php\">Session::put('register_user', $user); return Redirect::to('\/user\/register\/payment'); <\/code><\/pre>\n<p>  \u041d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u043c\u0430\u043a\u0435\u0442 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0442\u0430\u043a, \u0447\u0442\u043e \u043c\u044b \u0441\u043c\u043e\u0436\u0435\u043c \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c JavaScript \u043a\u043e\u0434 \u0432 \u0444\u0443\u0442\u0435\u0440 (\u043d\u0438\u0437). \u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443 \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0442\u0435\u0433\u0430 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f:  <\/p>\n<pre><code class=\"javascript\">@yield('scripts') <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u043e\u0432\u044b\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442:  <\/p>\n<pre><code class=\"php\">Route::get('\/user\/register\/payment', function() {     Recurly_js::$privateKey = Config::get('recurly.private_key');     $plan = 'bronze'; \/\/ todo: get this from vars     $user = Session::get('register_user');     $signature = Recurly_js::sign(array(         'account'      =&gt; array(             'account_code' =&gt; 'user_' . $user-&gt;id         ),         'subscription' =&gt; array(             'plan_code'    =&gt;  $plan,             'currency'     =&gt; Config::get('recurly.default_currency')         )     ));       return View::make('user\/register')-&gt;with(array(         'plan'      =&gt; $plan,         'subdomain' =&gt; Config::get('recurly.subdomain'),         'currency'  =&gt; Config::get('recurly.default_currency'),         'signature' =&gt; $signature     )); }); <\/code><\/pre>\n<p>  \u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u0439 \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u043a\u043e\u0434\u0443:  <\/p>\n<ul>\n<li>\u041c\u044b \u0434\u043e\u043b\u0436\u043d\u044b\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 <i>Recurly_js<\/i>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0440\u0430\u043d\u0435\u0435.<\/li>\n<li>\u0414\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0443 (\u043f\u043b\u0430\u043d) \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u044d\u0442\u0430\u043f\u0430, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438. \u042d\u0442\u043e\u0442 \u043a\u0443\u0441\u043e\u043a \u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043a\u0430\u043a \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0443\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u0435<\/li>\n<li>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u0443 (\u043f\u043e\u0434\u043f\u0438\u0441\u044c) \u0434\u043b\u044f Recurly.js, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0447\u0430\u0441\u0442\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u0432 \u0438\u0445 \u0447\u0438\u0441\u043b\u0435 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u044f \u043a\u043b\u0430\u0441\u0441 (\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f) \u0438 \u0435\u0433\u043e ID<\/li>\n<li>\u042d\u0442\u0430 \u043f\u043e\u0434\u043f\u0438\u0441\u044c \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0440\u044f\u0434\u0443 \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438<\/li>\n<\/ul>\n<p>  \u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043e\u043f\u043b\u0430\u0442\u044b \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0447\u0430\u0441\u0442\u0435\u0439, \u043f\u0435\u0440\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u2014 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 HTML:  <\/p>\n<pre><code class=\"html\">@extends('layouts.default')   @section('content')     &lt;div id=&quot;recurly-subscribe&quot;&gt;   &lt;\/div&gt;   @stop  <\/code><\/pre>\n<p>  Recurly.js \u0432\u043d\u0435\u0434\u0440\u044f\u0435\u0442 \u0441\u0432\u043e\u0439 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0438\u0439 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0444\u043e\u0440\u043c\u044b \u043e\u043f\u043b\u0430\u0442\u044b \u0432 \u0434\u0430\u043d\u043d\u044b\u0439 div.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435, \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043c JavaScript \u043a \u0441\u0435\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0432\u044b\u0432\u043e\u0434 \u0432\u043d\u0438\u0437\u0443 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043c\u0430\u043a\u0435\u0442\u0430:  <\/p>\n<pre><code class=\"php\">@section('scripts') &lt;script&gt; Recurly.config({     subdomain: '{{ $subdomain }}',     currency: '{{ $currency }}' });   Recurly.buildSubscriptionForm({     target: '#recurly-subscribe',     \/\/ Signature must be generated server-side with a utility     \/\/ method provided in client libraries.     signature: '{{ $signature }}',     successURL: '\/user\/register\/confirm',     planCode: '{{ $plan }}',     distinguishContactFromBillingInfo: true,     collectCompany: false,     termsOfServiceURL: 'http:\/\/www.example.com\/terms',     acceptPaypal: true,     acceptedCards: ['mastercard',                     'discover',                     'american_express',                      'visa'],     account: {         firstName: 'Joe',         lastName: 'User',         email: 'test@example.net',         phone: '555-555-5555'     },     billingInfo: {         firstName: 'Joe',         lastName: 'User',         address1: '123 somestreet',         address2: '45',         city: 'San Francisco',         zip: '94107',         state: 'CA',         country: 'US',         cardNumber: '4111-1111-1111-1111',         CVV: '123'     } }); &lt;\/script&gt; @stop <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u043e\u043b\u0448\u0435\u0431\u0441\u0442\u0432\u043e \u2014 Recurly \u0441\u0442\u0440\u043e\u0438\u0442 \u0444\u043e\u0440\u043c\u0443 \u043e\u043f\u043b\u0430\u0442\u044b \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0435\u0433\u043e \u0432 div c id <i>#recurly-subscribe<\/i>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0447\u0430\u0441\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438, \u043c\u044b \u043f\u0440\u0438\u0448\u043b\u0438 \u043a \u0432\u0438\u0434\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u0438.<br \/>  \u0417\u0430\u0442\u0435\u043c, \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 Recurly \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0444\u043e\u0440\u043c\u044b, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u0432 <i>successURL<\/i> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u043c\u0438:  <\/p>\n<pre><code class=\"php\">Route::post('\/user\/register\/confirm', function() {     $recurly_token = Input::get('recurly_token');     Recurly_js::$privateKey = Config::get('recurly.private_key');     $result = Recurly_js::fetch($recurly_token);     var_dump($result); }); <\/code><\/pre>\n<p>  \u0418 \u0441\u043d\u043e\u0432\u0430 \u043c\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c Recurly.js \u0441 \u0441\u0435\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u043a\u043b\u044e\u0447\u0435\u043c \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438, \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0435\u0433\u043e \u0434\u043b\u044f \u0438\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u043e\u043a\u0435\u043d\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 Recurly \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 POST (recurly_token). \u042d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u043c <i>Recurly_Subscription<\/i>, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u042f \u0432\u044b\u0432\u043e\u0436\u0443 \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <i>var_dump()<\/i>, \u0447\u0442\u043e \u0431\u044b \u0432\u0437\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043a\u043e\u0434 \u043f\u043b\u0430\u043d\u0430, \u0447\u0442\u043e \u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c \u043d\u0430 \u0447\u0442\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043b\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c:  <\/p>\n<pre><code class=\"php\">$plan_code = $result-&gt;plan-&gt;plan_code; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0440\u043e\u043b\u044c, \u0437\u0430\u043c\u0435\u0442\u044c\u0442\u0435 \u2014 \u043c\u044b \u0434\u0430\u043b\u0438 \u0438\u043c \u0438\u043c\u0435\u043d\u0430 \u201cbronze\u201d, \u201csilver\u201d \u0438 \u201cgold\u201d.  <\/p>\n<pre><code class=\"php\">$role = Role::where('name', '=', $plan_code)-&gt;first(); <\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438\u0437 \u0441\u0435\u0441\u0441\u0438\u0438 (\u0430 \u0437\u0430\u0442\u0435\u043c \u0443\u0434\u0430\u043b\u0438\u043c \u0435\u0433\u043e \u0438\u0437 \u0441\u0435\u0441\u0441\u0438\u0438):  <\/p>\n<pre><code class=\"php\">$user = Session::get('register_user'); Session::forget('register_user'); <\/code><\/pre>\n<p>  \u0414\u0430\u043b\u0435\u0435, \u043c\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0440\u043e\u043b\u044c \u0434\u043b\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f:  <\/p>\n<pre><code class=\"php\">$user-&gt;roles()-&gt;attach($role); <\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u043e\u0442\u043b\u043e\u0436\u0435\u043d\u043d\u0443\u044e \u0440\u043e\u043b\u044c:  <\/p>\n<pre><code class=\"php\">$role_pending = $role_pending = Role::where('name', '=', 'pending')-&gt;first(); DB::table('role_user')-&gt;where('user_id', '=', $user-&gt;id)-&gt;where('role_id', '=', $role_pending-&gt;id)-&gt;delete(); <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c, \u043c\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u0435\u043c\u043e\u043c \u043f\u043b\u0430\u0442\u0435\u0436\u0435\u0439, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u043e\u043a, \u0430 \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0440\u043e\u043b\u0438 \u0434\u043b\u044f \u043d\u043e\u0432\u044b\u0445 \u0443\u0447\u0435\u0442\u043d\u044b\u0445 \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c \u043f\u043b\u0430\u043d\u0430.<\/p>\n<h4>\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0443\u0447\u0435\u0442\u043d\u044b\u043c\u0438 \u0437\u0430\u043f\u0438\u0441\u044f\u043c\u0438<\/h4>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u0441\u043c\u043e\u0433\u0443\u0442 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u0432\u043e\u0438\u043c \u0441\u0447\u0435\u0442\u043e\u043c.<br \/>  \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432\u043e\u0448\u0435\u043b \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440. <br \/>  \u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0444\u0438\u043b\u044c\u0442\u0440 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0437\u0430\u0449\u0438\u0449\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u0441\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u044b \u0432 \u0433\u0440\u0443\u043f\u043f\u0443, \u0432\u043e\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"php\">Route::group(array('before' =&gt; 'auth'), function() {     Route::get('\/user\/account', function() {         \/\/ User must be logged in     });     Route::get('user\/account\/billing', function() {         \/\/ User must be logged in     }); }); <\/code><\/pre>\n<p>  \u0412\u044b\u0437\u043e\u0432 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0440\u043e\u0441\u0442:  <\/p>\n<pre><code class=\"php\">Route::get('\/user\/account', function() {     return View::make('user\/account\/index'); }); <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0430\u0434\u0440\u0435\u0441 \u0432\u0438\u0434\u0430 <b>app\/views\/user\/account\/index.blade.php<\/b>:  <\/p>\n<pre><code class=\"php\">@extends('layouts.default')   @section('content')       &lt;h1&gt;Your Account&lt;\/h1&gt;       &lt;ul&gt;     &lt;li&gt;&lt;a href=&quot;\/user\/account\/edit&quot;&gt;Edit your account information&lt;\/a&gt;&lt;\/li&gt;     &lt;li&gt;&lt;a href=&quot;\/user\/account\/plan&quot;&gt;Update your subscription plan&lt;\/a&gt;&lt;\/li&gt;         &lt;li&gt;&lt;a href=&quot;\/user\/account\/billing&quot;&gt;Update your Billing information&lt;\/a&gt;&lt;\/li&gt;     &lt;\/ul&gt;   @stop <\/code><\/pre>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0431\u0438\u043b\u043b\u0438\u043d\u0433\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u043c\u044b \u043d\u0435 \u0445\u0440\u0430\u043d\u0438\u043c \u043f\u043b\u0430\u0442\u0435\u0436\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043b\u044e\u0434\u0435\u0439, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043e\u043f\u043b\u0430\u0442\u044b, Recurly \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0444\u043e\u0440\u043c\u0443 \u0434\u043b\u044f \u0432\u0430\u0441, \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u044f (POSTing) \u043d\u043e\u0432\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043a Recurly \u0431\u0435\u0437 \u043d\u0435\u0433\u043e \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u043d\u0435\u0434\u0430\u043b\u0435\u043a\u043e \u043e\u0442 \u0432\u0430\u0448\u0435\u0433\u043e \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.  <\/p>\n<pre><code class=\"php\">Route::get('user\/account\/billing', function() {     Recurly_js::$privateKey = Config::get('recurly.private_key');       $account_code = 'user_' . Auth::user()-&gt;id;       $signature = Recurly_js::sign(         array('account' =&gt; array('account_code' =&gt; $account_code))     );       return View::make('user\/account\/billing')-&gt;with(array(               'subdomain'     =&gt; Config::get('recurly.subdomain'),         'currency'      =&gt; Config::get('recurly.default_currency'),         'account_code'  =&gt; $account_code,         'signature'     =&gt; $signature     )); }); <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043e\u043f\u043b\u0430\u0442\u044b \u0432 \u0442\u043e\u043c \u043f\u043b\u0430\u043d\u0435, \u0447\u0442\u043e \u043c\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Recurly.js, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u043f\u043e\u0434\u043f\u0438\u0441\u0438 (\u0445\u043e\u0442\u044f \u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438) \u0438, \u043f\u0440\u043e\u0445\u043e\u0434\u044f \u0447\u0435\u0440\u0435\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435.<br \/>  \u041f\u0443\u0442\u044c <b>app\/views\/user\/account\/billing.blade.php<\/b><br \/>  \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432 \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0442\u043e\u0439 \u0436\u0435 \u0441\u0445\u0435\u043c\u0435, \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u043e\u043f\u043b\u0430\u0442\u044b:  <\/p>\n<pre><code class=\"php\">@extends('layouts.default')   @section('content')    &lt;div id=&quot;recurly-billing&quot;&gt;  &lt;\/div&gt;   @stop   @section('scripts') &lt;script&gt; Recurly.config({     subdomain: '{{ $subdomain }}',     currency: '{{ $currency }}' });   Recurly.buildBillingInfoUpdateForm({     target: '#recurly-billing',     successURL: '\/user\/account\/billing\/confirm',     accountCode: '{{ $account_code }}',     signature: '{{ $signature }}' }); &lt;\/script&gt; @stop <\/code><\/pre>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043b \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u043e\u043f\u043b\u0430\u0442\u0435:  <\/p>\n<pre><code class=\"php\">Route::post('user\/account\/billing\/confirm', function() {     return Redirect::to('\/user\/account')-&gt;with('success', 'Your billing information has been updated.'); }); <\/code><\/pre>\n<p>  \u0418 \u0432\u043e\u0442 \u043e\u043d\u043e! \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043c\u043e\u0433\u0443 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u044e \u043f\u043b\u0430\u0442\u0435\u0436\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e!<br \/>  \u042f \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u0447\u0435\u0442\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438. \u042d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e, \u0438 \u043f\u0443\u0441\u0442\u044c \u044d\u0442\u043e \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u0443\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u0435\u043c \u0434\u043b\u044f \u0432\u0430\u0441.<\/p>\n<h4>Push-\u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f<\/h4>\n<p>  \u0412 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043a \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c \u0434\u043b\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 API Recurly, \u0441\u0435\u0440\u0432\u0438\u0441 \u00abping\u00bb \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435\u043c, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043a\u0430\u043a\u043e\u0435-\u043b\u0438\u0431\u043e \u0441\u043e\u0431\u044b\u0442\u0438\u0435.<br \/>  \u042d\u0442\u0438 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043d\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043f\u0443\u0442\u0430\u0442\u044c \u0441 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u0438\u0435\u043c, \u043e\u0434\u043d\u0430\u043a\u043e \u2014 \u043e\u043d\u0438 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043d\u044b\u0435.<br \/>   \u041f\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443 \u0441\u043b\u0443\u0436\u0431\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 POST-\u0437\u0430\u043f\u0440\u043e\u0441 \u043a URI, \u0438 \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442 XML \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442 \u043a\u0430\u043a \u0442\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Recurly, \u0447\u0442\u043e \u0431\u044b \u0438\u0437\u0432\u043b\u0435\u0447\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u042d\u0442\u0438 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 Recurly. <\/p>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u043d\u0430\u0448\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430, \u043a\u043e\u0433\u0434\u0430 \u0431\u044b\u043b\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043e \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435:  <\/p>\n<pre><code class=\"php\">Route::post('recurly', function(){     $xml = file_get_contents (&quot;php:\/\/input&quot;);     $notification = new Recurly_PushNotification($xml);       switch ($notification-&gt;type) {         \/\/ ... process notification     } }); <\/code><\/pre>\n<p>  \u0412\u044b, \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435, \u043f\u043e\u043d\u044f\u043b\u0438, \u0447\u0442\u043e, \u043a\u0430\u043a \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0442\u043e-\u0442\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u043b\u0441\u044f \u0438 \u0437\u0430\u043f\u043b\u0430\u0442\u0438\u043b \u0437\u0430 \u0443\u0441\u043b\u0443\u0433\u0443, \u043e\u043d \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043f\u043e\u0434\u043f\u0438\u0441\u0447\u0438\u043a\u043e\u043c, \u0438 \u043d\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442\u0441\u044f \u043b\u0438 \u0438\u0445 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0430 \u0438\u043b\u0438 \u043d\u0435\u0442. \u0422\u0430\u043a, \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0442\u043c\u0435\u043d\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u043e\u0442 Recurly, \u0447\u0442\u043e \u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438 \u0438 \u043e\u0442\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0440\u043e\u043b\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"php\">switch ($notification-&gt;type) {     case 'canceled_subscription_notification':         \/\/ get the account code         $account_code = $notification-&gt;account-&gt;account_code;         \/\/ extract the user ID (account_code format is user_ID)         $user_id = intval(substr($account_code, (strpos($account_code, '_')+1)));            \/\/ find the user in question         $user = User::find($user_id);         \/\/ get the plan code         $plan_code = $notification-&gt;subscription-&gt;plan-&gt;plan_code;         \/\/ find the corresponding role...         $role = Role::where('name', '=', $plan_code)-&gt;first();         \/\/ ...and revoke it         DB::table('role_user')-&gt;where('user_id', '=', $user-&gt;id)-&gt;where('role_id', '=', $role)-&gt;delete();         break;       \/\/ ... process notification } <\/code><\/pre>\n<p>  \u0415\u0441\u0442\u044c \u0446\u0435\u043b\u044b\u0439 \u0440\u044f\u0434 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u0435\u0449\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f. <br \/>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043d\u043e\u0432\u044b\u0439, \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439, \u043e\u0442\u043c\u0435\u043d\u0435\u043d, \u0438 \u0442.\u0434., \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u0441\u0442\u043e\u0440\u0438\u044e \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0438, \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0447\u043b\u0435\u043d\u043e\u0432, \u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u043a\u0430\u0437\u044b. \u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u044f \u043e \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u2014 \u0431\u0443\u0434\u044c \u0442\u043e \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 (\u043f\u043b\u0430\u0442\u0435\u0436\u0438) \u0438\u043b\u0438 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 (\u0432\u043e\u0437\u0432\u0440\u0430\u0442\u044b) \u2014 \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0438 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 \u0434\u043e\u0445\u043e\u0434.<\/p>\n<p>  \u041d\u0430 \u044d\u0442\u043e\u043c <a href=\"http:\/\/www.sitepoint.com\/creating-subscription-based-website-laravel-recurly-2\/\">\u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f<\/a> \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0432\u0441\u0435\u043c, \u043a\u0442\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b \u0435\u0435. \u041c\u0435\u0441\u0442\u0430\u043c\u0438, \u044f \u043d\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043b, \u0447\u0442\u043e \u0445\u043e\u0447\u0435\u0442 \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u0440, \u0432\u044b \u043f\u043e\u0439\u043c\u0435\u0442\u0435 \u044d\u0442\u043e \u043f\u0440\u0438 \u043f\u0440\u043e\u0447\u0442\u0435\u043d\u0438\u0438. \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442, \u0442\u043e \u044f \u0432\u044b\u043b\u043e\u0436\u0443 \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431 \u0442\u043e, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0443 \u043c\u0435\u043d\u044f (\u0421\u0435\u0439\u0447\u0430\u0441, \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u043d\u0435 \u043c\u043e\u0433\u0443 \u0432\u044b\u043b\u043e\u0436\u0438\u0442\u044c \u2014 \u043d\u0435\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0434\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0443 \u043f\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438). \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0443\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f! \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/221815\/\"> http:\/\/habrahabr.ru\/post\/221815\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c, \u0425\u0430\u0431\u0440! \u041f\u043e\u0441\u043b\u0435 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u044f <a href=\"http:\/\/habrahabr.ru\/post\/195690\/\">\u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/a>, \u044f \u043d\u0430\u0447\u0430\u043b \u0438\u0441\u043a\u0430\u0442\u044c \u0432\u0442\u043e\u0440\u0443\u044e, \u043d\u043e \u0435\u0451 \u043d\u0435 \u043e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0448\u0438\u043b \u0441\u0430\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434. \u0418\u0442\u0430\u043a, \u043d\u0430\u0447\u043d\u0435\u043c.<\/p>\n<h5>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h5>\n<p>   \u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0435\u0440\u0438\u0438 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0433\u043e\u043b\u044b\u0439 \u043a\u043e\u0441\u0442\u044f\u043a \u0441\u0430\u0439\u0442\u0430 \u0441 \u043f\u043e\u0434\u043f\u0438\u0441\u043a\u0430\u043c\u0438 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 Laravel. \u0422\u0430\u043a \u0436\u0435, \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0441\u0430\u0439\u0442 \u0441 \u0440\u043e\u043b\u044f\u043c\u0438 \u0438 \u0441\u043e\u0437\u0434\u0430\u043b\u0438 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0440\u043e\u043b\u0435\u0439 \u0434\u043b\u044f \u0437\u0430\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043f\u043e\u0434\u043e\u0448\u043b\u0438 \u043a \u0442\u043e\u043c\u0443 \u043c\u043e\u043c\u0435\u043d\u0442\u0443, \u0433\u0434\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044e, \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u0432\u044b\u0445\u043e\u0434.<br \/>   \u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c Recurly \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043d\u0430\u0448\u0438\u0445 \u043f\u043b\u0430\u0442\u043d\u044b\u0445 \u043f\u043b\u0430\u043d\u043e\u0432 \u0447\u043b\u0435\u043d\u0441\u0442\u0432\u0430.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-221815","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/221815","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=221815"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/221815\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=221815"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=221815"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=221815"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}