{"action":"created","comment":{"url":"https://api.github.com/repos/PayU/alu-client-php/pulls/comments/63132676","id":63132676,"diff_hunk":"@@ -0,0 +1,150 @@\n+<?php\n+/**\n+ * Include composer class autoloader\n+ */\n+require_once dirname(__FILE__) . '/../vendor/autoload.php';\n+\n+use PayU\\Alu\\Billing;\n+use PayU\\Alu\\CardToken;\n+use PayU\\Alu\\Client;\n+use PayU\\Alu\\Delivery;\n+use PayU\\Alu\\MerchantConfig;\n+use PayU\\Alu\\Order;\n+use PayU\\Alu\\Product;\n+use PayU\\Alu\\Request;\n+use PayU\\Alu\\User;\n+use PayU\\Alu\\Exceptions\\ConnectionException;\n+use PayU\\Alu\\Exceptions\\ClientException;\n+\n+/**\n+ * Create configuration with params:\n+ *\n+ * Merchant Code - Your PayU Merchant Code\n+ * Secret Key - Your PayU Secret Key\n+ * Platform - RO | RU | UA | TR | HU\n+ */\n+$cfg = new MerchantConfig('MERCHANT_CODE', 'SECRET_KEY', 'TR');\n+\n+/**\n+ * Create user with params:\n+ *\n+ * User IP - User's IP address\n+ * User Time  - Time of user computer - optional\n+ *\n+ */\n+$user = new User('127.0.0.1');\n+\n+/**\n+ * Create new order\n+ */\n+$order = new Order();\n+\n+/**\n+ * Setup the order params\n+ *\n+ * Full params available in the documentation\n+ */\n+$order->withBackRef('http://path/to/your/returnUrlScript')\n+    ->withOrderRef('MerchantOrderRef')\n+    ->withCurrency('TRY')\n+    ->withOrderDate(gmdate('Y-m-d H:i:s'))\n+    ->withOrderTimeout(1000)\n+    ->withPayMethod('BKM');\n+\n+/**\n+ * Create new product\n+ */\n+$product = new Product();\n+\n+/**\n+ * Setup the product params\n+ *\n+ * Full params available in the documentation\n+ */\n+$product->withCode('PCODE01')\n+    ->withName('PNAME01')\n+    ->withPrice(100.0)\n+    ->withVAT(24.0)\n+    ->withQuantity(1);\n+\n+/**\n+ * Add the product to the order\n+ */\n+$order->addProduct($product);\n+\n+/**\n+ * Create new billing address\n+ */\n+$billing = new Billing();\n+\n+/**\n+ * Setup the billing address params\n+ *\n+ * Full params available in the documentation\n+ */\n+$billing->withAddressLine1('Address1')\n+    ->withAddressLine2('Address2')\n+    ->withCity('City')\n+    ->withCountryCode('RO')\n+    ->withEmail('john.doe@mail.com')\n+    ->withFirstName('FirstName')\n+    ->withLastName('LastName')\n+    ->withPhoneNumber('40123456789')\n+    ->withIdentityCardNumber('111222');\n+\n+/**\n+ * Create new delivery address\n+ *\n+ * If you want to have the same delivery as billing, skip these two steps\n+ * and pass the Billing $billing object to the request twice\n+ */\n+$delivery = new Delivery();\n+\n+/**\n+ * Setup the delivery address params\n+ *\n+ * Full params available in the documentation\n+ */\n+$delivery->withAddressLine1('Address1')\n+    ->withAddressLine2('Address2')\n+    ->withCity('City')\n+    ->withCountryCode('RO')\n+    ->withEmail('john.doe@mail.com')\n+    ->withFirstName('FirstName')\n+    ->withLastName('LastName')\n+    ->withPhoneNumber('40123456789');\n+\n+/**\n+ * Create new Request with params:\n+ *\n+ * Config object\n+ * Order object\n+ * Billing object\n+ * Delivery (or Billing object again, if you want to have the delivery address the same as the billing address)\n+ * User object\n+ */\n+$request = new Request($cfg, $order, $billing, $delivery, $user);\n+\n+/**\n+ * Create new API Client, passing the Config object as parameter\n+ */\n+$client = new Client($cfg);\n+\n+/**\n+ * Will throw different Exceptions on errors\n+ */\n+try {\n+    /**\n+     * Sends the Request to ALU and returns a Response\n+     *\n+     * See documentation for Response params\n+     */\n+    $response = $client->pay($request);\n+    echo $response->getReturnMessage();","path":"examples/payByLink.php","position":143,"original_position":143,"commit_id":"0e9b3c1416c3add6486d3d159d9c32a8b4f7ec5b","original_commit_id":"0e9b3c1416c3add6486d3d159d9c32a8b4f7ec5b","user":{"login":"drealecs","id":209984,"avatar_url":"https://avatars.githubusercontent.com/u/209984?v=3","gravatar_id":"","url":"https://api.github.com/users/drealecs","html_url":"https://github.com/drealecs","followers_url":"https://api.github.com/users/drealecs/followers","following_url":"https://api.github.com/users/drealecs/following{/other_user}","gists_url":"https://api.github.com/users/drealecs/gists{/gist_id}","starred_url":"https://api.github.com/users/drealecs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/drealecs/subscriptions","organizations_url":"https://api.github.com/users/drealecs/orgs","repos_url":"https://api.github.com/users/drealecs/repos","events_url":"https://api.github.com/users/drealecs/events{/privacy}","received_events_url":"https://api.github.com/users/drealecs/received_events","type":"User","site_admin":false},"body":"please add some spacing... echoing string one immediately after another is not helping","created_at":"2016-05-13T04:38:16Z","updated_at":"2016-05-13T04:38:16Z","html_url":"https://github.com/PayU/alu-client-php/pull/15#discussion_r63132676","pull_request_url":"https://api.github.com/repos/PayU/alu-client-php/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/PayU/alu-client-php/pulls/comments/63132676"},"html":{"href":"https://github.com/PayU/alu-client-php/pull/15#discussion_r63132676"},"pull_request":{"href":"https://api.github.com/repos/PayU/alu-client-php/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/PayU/alu-client-php/pulls/15","id":69800130,"html_url":"https://github.com/PayU/alu-client-php/pull/15","diff_url":"https://github.com/PayU/alu-client-php/pull/15.diff","patch_url":"https://github.com/PayU/alu-client-php/pull/15.patch","issue_url":"https://api.github.com/repos/PayU/alu-client-php/issues/15","number":15,"state":"open","locked":false,"title":"pay by link implementation and example added","user":{"login":"silviusomesan","id":5611563,"avatar_url":"https://avatars.githubusercontent.com/u/5611563?v=3","gravatar_id":"","url":"https://api.github.com/users/silviusomesan","html_url":"https://github.com/silviusomesan","followers_url":"https://api.github.com/users/silviusomesan/followers","following_url":"https://api.github.com/users/silviusomesan/following{/other_user}","gists_url":"https://api.github.com/users/silviusomesan/gists{/gist_id}","starred_url":"https://api.github.com/users/silviusomesan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silviusomesan/subscriptions","organizations_url":"https://api.github.com/users/silviusomesan/orgs","repos_url":"https://api.github.com/users/silviusomesan/repos","events_url":"https://api.github.com/users/silviusomesan/events{/privacy}","received_events_url":"https://api.github.com/users/silviusomesan/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-12T08:51:47Z","updated_at":"2016-05-13T04:38:16Z","closed_at":null,"merged_at":null,"merge_commit_sha":"845a4e8a4d6401518462b8e8ec6fbb596efe308b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/PayU/alu-client-php/pulls/15/commits","review_comments_url":"https://api.github.com/repos/PayU/alu-client-php/pulls/15/comments","review_comment_url":"https://api.github.com/repos/PayU/alu-client-php/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PayU/alu-client-php/issues/15/comments","statuses_url":"https://api.github.com/repos/PayU/alu-client-php/statuses/0e9b3c1416c3add6486d3d159d9c32a8b4f7ec5b","head":{"label":"silviusomesan:bkm_integration","ref":"bkm_integration","sha":"0e9b3c1416c3add6486d3d159d9c32a8b4f7ec5b","user":{"login":"silviusomesan","id":5611563,"avatar_url":"https://avatars.githubusercontent.com/u/5611563?v=3","gravatar_id":"","url":"https://api.github.com/users/silviusomesan","html_url":"https://github.com/silviusomesan","followers_url":"https://api.github.com/users/silviusomesan/followers","following_url":"https://api.github.com/users/silviusomesan/following{/other_user}","gists_url":"https://api.github.com/users/silviusomesan/gists{/gist_id}","starred_url":"https://api.github.com/users/silviusomesan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silviusomesan/subscriptions","organizations_url":"https://api.github.com/users/silviusomesan/orgs","repos_url":"https://api.github.com/users/silviusomesan/repos","events_url":"https://api.github.com/users/silviusomesan/events{/privacy}","received_events_url":"https://api.github.com/users/silviusomesan/received_events","type":"User","site_admin":false},"repo":{"id":52012321,"name":"alu-client-php","full_name":"silviusomesan/alu-client-php","owner":{"login":"silviusomesan","id":5611563,"avatar_url":"https://avatars.githubusercontent.com/u/5611563?v=3","gravatar_id":"","url":"https://api.github.com/users/silviusomesan","html_url":"https://github.com/silviusomesan","followers_url":"https://api.github.com/users/silviusomesan/followers","following_url":"https://api.github.com/users/silviusomesan/following{/other_user}","gists_url":"https://api.github.com/users/silviusomesan/gists{/gist_id}","starred_url":"https://api.github.com/users/silviusomesan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/silviusomesan/subscriptions","organizations_url":"https://api.github.com/users/silviusomesan/orgs","repos_url":"https://api.github.com/users/silviusomesan/repos","events_url":"https://api.github.com/users/silviusomesan/events{/privacy}","received_events_url":"https://api.github.com/users/silviusomesan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/silviusomesan/alu-client-php","description":"Automatic Live Update Client","fork":true,"url":"https://api.github.com/repos/silviusomesan/alu-client-php","forks_url":"https://api.github.com/repos/silviusomesan/alu-client-php/forks","keys_url":"https://api.github.com/repos/silviusomesan/alu-client-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/silviusomesan/alu-client-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/silviusomesan/alu-client-php/teams","hooks_url":"https://api.github.com/repos/silviusomesan/alu-client-php/hooks","issue_events_url":"https://api.github.com/repos/silviusomesan/alu-client-php/issues/events{/number}","events_url":"https://api.github.com/repos/silviusomesan/alu-client-php/events","assignees_url":"https://api.github.com/repos/silviusomesan/alu-client-php/assignees{/user}","branches_url":"https://api.github.com/repos/silviusomesan/alu-client-php/branches{/branch}","tags_url":"https://api.github.com/repos/silviusomesan/alu-client-php/tags","blobs_url":"https://api.github.com/repos/silviusomesan/alu-client-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/silviusomesan/alu-client-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/silviusomesan/alu-client-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/silviusomesan/alu-client-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/silviusomesan/alu-client-php/statuses/{sha}","languages_url":"https://api.github.com/repos/silviusomesan/alu-client-php/languages","stargazers_url":"https://api.github.com/repos/silviusomesan/alu-client-php/stargazers","contributors_url":"https://api.github.com/repos/silviusomesan/alu-client-php/contributors","subscribers_url":"https://api.github.com/repos/silviusomesan/alu-client-php/subscribers","subscription_url":"https://api.github.com/repos/silviusomesan/alu-client-php/subscription","commits_url":"https://api.github.com/repos/silviusomesan/alu-client-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/silviusomesan/alu-client-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/silviusomesan/alu-client-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/silviusomesan/alu-client-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/silviusomesan/alu-client-php/contents/{+path}","compare_url":"https://api.github.com/repos/silviusomesan/alu-client-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/silviusomesan/alu-client-php/merges","archive_url":"https://api.github.com/repos/silviusomesan/alu-client-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/silviusomesan/alu-client-php/downloads","issues_url":"https://api.github.com/repos/silviusomesan/alu-client-php/issues{/number}","pulls_url":"https://api.github.com/repos/silviusomesan/alu-client-php/pulls{/number}","milestones_url":"https://api.github.com/repos/silviusomesan/alu-client-php/milestones{/number}","notifications_url":"https://api.github.com/repos/silviusomesan/alu-client-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/silviusomesan/alu-client-php/labels{/name}","releases_url":"https://api.github.com/repos/silviusomesan/alu-client-php/releases{/id}","deployments_url":"https://api.github.com/repos/silviusomesan/alu-client-php/deployments","created_at":"2016-02-18T14:18:04Z","updated_at":"2016-02-18T14:18:05Z","pushed_at":"2016-05-12T08:49:32Z","git_url":"git://github.com/silviusomesan/alu-client-php.git","ssh_url":"git@github.com:silviusomesan/alu-client-php.git","clone_url":"https://github.com/silviusomesan/alu-client-php.git","svn_url":"https://github.com/silviusomesan/alu-client-php","homepage":"https://secure.payu.ro/docs/alu/v3/","size":60,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"PayU:master","ref":"master","sha":"944b7f6611b7cdfaed3dd3c22d72079ef2409bd2","user":{"login":"PayU","id":1117999,"avatar_url":"https://avatars.githubusercontent.com/u/1117999?v=3","gravatar_id":"","url":"https://api.github.com/users/PayU","html_url":"https://github.com/PayU","followers_url":"https://api.github.com/users/PayU/followers","following_url":"https://api.github.com/users/PayU/following{/other_user}","gists_url":"https://api.github.com/users/PayU/gists{/gist_id}","starred_url":"https://api.github.com/users/PayU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PayU/subscriptions","organizations_url":"https://api.github.com/users/PayU/orgs","repos_url":"https://api.github.com/users/PayU/repos","events_url":"https://api.github.com/users/PayU/events{/privacy}","received_events_url":"https://api.github.com/users/PayU/received_events","type":"Organization","site_admin":false},"repo":{"id":24221094,"name":"alu-client-php","full_name":"PayU/alu-client-php","owner":{"login":"PayU","id":1117999,"avatar_url":"https://avatars.githubusercontent.com/u/1117999?v=3","gravatar_id":"","url":"https://api.github.com/users/PayU","html_url":"https://github.com/PayU","followers_url":"https://api.github.com/users/PayU/followers","following_url":"https://api.github.com/users/PayU/following{/other_user}","gists_url":"https://api.github.com/users/PayU/gists{/gist_id}","starred_url":"https://api.github.com/users/PayU/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PayU/subscriptions","organizations_url":"https://api.github.com/users/PayU/orgs","repos_url":"https://api.github.com/users/PayU/repos","events_url":"https://api.github.com/users/PayU/events{/privacy}","received_events_url":"https://api.github.com/users/PayU/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PayU/alu-client-php","description":"Automatic Live Update Client","fork":false,"url":"https://api.github.com/repos/PayU/alu-client-php","forks_url":"https://api.github.com/repos/PayU/alu-client-php/forks","keys_url":"https://api.github.com/repos/PayU/alu-client-php/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PayU/alu-client-php/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PayU/alu-client-php/teams","hooks_url":"https://api.github.com/repos/PayU/alu-client-php/hooks","issue_events_url":"https://api.github.com/repos/PayU/alu-client-php/issues/events{/number}","events_url":"https://api.github.com/repos/PayU/alu-client-php/events","assignees_url":"https://api.github.com/repos/PayU/alu-client-php/assignees{/user}","branches_url":"https://api.github.com/repos/PayU/alu-client-php/branches{/branch}","tags_url":"https://api.github.com/repos/PayU/alu-client-php/tags","blobs_url":"https://api.github.com/repos/PayU/alu-client-php/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PayU/alu-client-php/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PayU/alu-client-php/git/refs{/sha}","trees_url":"https://api.github.com/repos/PayU/alu-client-php/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PayU/alu-client-php/statuses/{sha}","languages_url":"https://api.github.com/repos/PayU/alu-client-php/languages","stargazers_url":"https://api.github.com/repos/PayU/alu-client-php/stargazers","contributors_url":"https://api.github.com/repos/PayU/alu-client-php/contributors","subscribers_url":"https://api.github.com/repos/PayU/alu-client-php/subscribers","subscription_url":"https://api.github.com/repos/PayU/alu-client-php/subscription","commits_url":"https://api.github.com/repos/PayU/alu-client-php/commits{/sha}","git_commits_url":"https://api.github.com/repos/PayU/alu-client-php/git/commits{/sha}","comments_url":"https://api.github.com/repos/PayU/alu-client-php/comments{/number}","issue_comment_url":"https://api.github.com/repos/PayU/alu-client-php/issues/comments{/number}","contents_url":"https://api.github.com/repos/PayU/alu-client-php/contents/{+path}","compare_url":"https://api.github.com/repos/PayU/alu-client-php/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PayU/alu-client-php/merges","archive_url":"https://api.github.com/repos/PayU/alu-client-php/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PayU/alu-client-php/downloads","issues_url":"https://api.github.com/repos/PayU/alu-client-php/issues{/number}","pulls_url":"https://api.github.com/repos/PayU/alu-client-php/pulls{/number}","milestones_url":"https://api.github.com/repos/PayU/alu-client-php/milestones{/number}","notifications_url":"https://api.github.com/repos/PayU/alu-client-php/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PayU/alu-client-php/labels{/name}","releases_url":"https://api.github.com/repos/PayU/alu-client-php/releases{/id}","deployments_url":"https://api.github.com/repos/PayU/alu-client-php/deployments","created_at":"2014-09-19T07:49:17Z","updated_at":"2016-04-27T12:23:32Z","pushed_at":"2016-05-13T04:19:42Z","git_url":"git://github.com/PayU/alu-client-php.git","ssh_url":"git@github.com:PayU/alu-client-php.git","clone_url":"https://github.com/PayU/alu-client-php.git","svn_url":"https://github.com/PayU/alu-client-php","homepage":"https://secure.payu.ro/docs/alu/v3/","size":78,"stargazers_count":11,"watchers_count":11,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":2,"forks":12,"open_issues":2,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PayU/alu-client-php/pulls/15"},"html":{"href":"https://github.com/PayU/alu-client-php/pull/15"},"issue":{"href":"https://api.github.com/repos/PayU/alu-client-php/issues/15"},"comments":{"href":"https://api.github.com/repos/PayU/alu-client-php/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/PayU/alu-client-php/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/PayU/alu-client-php/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PayU/alu-client-php/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/PayU/alu-client-php/statuses/0e9b3c1416c3add6486d3d159d9c32a8b4f7ec5b"}}}}