{"id":13560339,"url":"https://github.com/harrypujianto/Veritrans-Codeigniter","last_synced_at":"2025-04-03T15:32:10.493Z","repository":{"id":36287924,"uuid":"40592445","full_name":"harrypujianto/Veritrans-Codeigniter","owner":"harrypujianto","description":null,"archived":false,"fork":false,"pushed_at":"2019-04-16T09:06:11.000Z","size":193,"stargazers_count":15,"open_issues_count":9,"forks_count":65,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-08-01T13:18:10.399Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/harrypujianto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-12T09:33:55.000Z","updated_at":"2021-11-30T01:36:45.000Z","dependencies_parsed_at":"2022-07-29T21:09:51.212Z","dependency_job_id":null,"html_url":"https://github.com/harrypujianto/Veritrans-Codeigniter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harrypujianto%2FVeritrans-Codeigniter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harrypujianto%2FVeritrans-Codeigniter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harrypujianto%2FVeritrans-Codeigniter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harrypujianto%2FVeritrans-Codeigniter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harrypujianto","download_url":"https://codeload.github.com/harrypujianto/Veritrans-Codeigniter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222985861,"owners_count":17068797,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:00:42.144Z","updated_at":"2024-11-04T11:31:11.727Z","avatar_url":"https://github.com/harrypujianto.png","language":"PHP","readme":"Midtrans Codeigniter library\n=======================================================\nMIdtrans :heart: CI!\n\nVeritrans now is Midtrans\n\nThis is the all new Codeigniter client library for Veritrans 2.0. Visit [https://www.midtrans.com](https://www.veritrans.co.id) for more information about the product and see documentation at [http://docs.midtrans.com](http://docs.veritrans.co.id) for more technical details. \n\n### What's new?\nSNAP! for technical info Visit [https://snap-docs.midtrans.com](https://snap-docs.midtrans.com)\n\n### Requirements\nThe following plugin is tested under following environment:\n* PHP v5.4.x or greater\n* Codeigniter v2.2.x\n\n## Installation\n* Download the library and extract the .zip \n* Merge all the files to your codeigniter directory\n\n## Using Veritrans Library\n\n### load library\n```php\n//set production to true for production environment\n$params = array('server_key' =\u003e '\u003cyour server key\u003e', 'production' =\u003e false);\n$this-\u003eload-\u003elibrary('veritrans');\n$this-\u003everitrans-\u003econfig($params);\n```\n\n### SNAP\n\nFor more info please open dan read [snap docs](https://snap-docs.midtrans.com/)\n\nSee the snap example [here](https://github.com/harrypujianto/Veritrans-Codeigniter/blob/master/application/controllers/snap.php)\n\n#### frontend requirement\n```\n\u003ctitle\u003eCheckout\u003c/title\u003e\n  \u003chead\u003e\n    \u003cscript type=\"text/javascript\"\n            src=\"https://app.sandbox.midtrans.com/snap/snap.js\"\n            data-client-key=\"\u003cCLIENT-KEY\u003e\"\u003e\u003c/script\u003e\n    \u003cscript src=\"//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n```\nChange `src=\"https://app.sandbox.midtrans.com/snap/snap.js\"` into `src=\"https://app.midtrans.com/snap/snap.js\"`\n\n#### initialize\n```\n$params = array('server_key' =\u003e '\u003cyour server key\u003e', 'production' =\u003e false);\n$this-\u003eload-\u003elibrary('midtrans');\n$this-\u003emidtrans-\u003econfig($params);\n```\nset ``production =\u003etrue`` for production environment.\n\n\n#### Get Snap Token\n\nWhen button is clicked, call an ajax to the server. Located on\n[here](https://github.com/harrypujianto/Veritrans-Codeigniter/blob/master/application/views/checkout_snap.php#L12-L26)\n```\n \u003cform id=\"payment-form\" method=\"post\" action=\"\u003c?=site_url()?\u003e/snap/finish\"\u003e\n      \u003cinput type=\"hidden\" name=\"result_type\" id=\"result-type\" value=\"\"\u003e\u003c/div\u003e\n      \u003cinput type=\"hidden\" name=\"result_data\" id=\"result-data\" value=\"\"\u003e\u003c/div\u003e\n    \u003c/form\u003e\n    \n    \u003cbutton id=\"pay-button\"\u003ePay!\u003c/button\u003e\n    \u003cscript type=\"text/javascript\"\u003e\n  \n    $('#pay-button').click(function (event) {\n      event.preventDefault();\n      $(this).attr(\"disabled\", \"disabled\");\n    \n    $.ajax({\n      url: '\u003c?=site_url()?\u003e/snap/token', //calling this function\n      cache: false,\n```\nCalling this [function](https://github.com/harrypujianto/Veritrans-Codeigniter/blob/master/application/controllers/snap.php#L36).\n```php\npublic function token()\n    {\n\t\t\n\t\t// Required\n\t\t$transaction_details = array(\n\t\t  'order_id' =\u003e rand(),\n\t\t  'gross_amount' =\u003e 94000, // no decimal allowed for creditcard\n\t\t);\n\n\t\t// Optional\n\t\t$item1_details = array(\n\t\t  'id' =\u003e 'a1',\n\t\t  'price' =\u003e 18000,\n\t\t  'quantity' =\u003e 3,\n\t\t  'name' =\u003e \"Apple\"\n\t\t);\n\n\t\t// Optional\n\t\t$item2_details = array(\n\t\t  'id' =\u003e 'a2',\n\t\t  'price' =\u003e 20000,\n\t\t  'quantity' =\u003e 2,\n\t\t  'name' =\u003e \"Orange\"\n\t\t);\n\n\t\t// Optional\n\t\t$item_details = array ($item1_details, $item2_details);\n\n\t\t// Optional\n\t\t$billing_address = array(\n\t\t  'first_name'    =\u003e \"Andri\",\n\t\t  'last_name'     =\u003e \"Litani\",\n\t\t  'address'       =\u003e \"Mangga 20\",\n\t\t  'city'          =\u003e \"Jakarta\",\n\t\t  'postal_code'   =\u003e \"16602\",\n\t\t  'phone'         =\u003e \"081122334455\",\n\t\t  'country_code'  =\u003e 'IDN'\n\t\t);\n\n\t\t// Optional\n\t\t$shipping_address = array(\n\t\t  'first_name'    =\u003e \"Obet\",\n\t\t  'last_name'     =\u003e \"Supriadi\",\n\t\t  'address'       =\u003e \"Manggis 90\",\n\t\t  'city'          =\u003e \"Jakarta\",\n\t\t  'postal_code'   =\u003e \"16601\",\n\t\t  'phone'         =\u003e \"08113366345\",\n\t\t  'country_code'  =\u003e 'IDN'\n\t\t);\n\n\t\t// Optional\n\t\t$customer_details = array(\n\t\t  'first_name'    =\u003e \"Andri\",\n\t\t  'last_name'     =\u003e \"Litani\",\n\t\t  'email'         =\u003e \"andri@litani.com\",\n\t\t  'phone'         =\u003e \"081122334455\",\n\t\t  'billing_address'  =\u003e $billing_address,\n\t\t  'shipping_address' =\u003e $shipping_address\n\t\t);\n\n\t\t// Fill transaction details\n\t\t$transaction = array(\n\t\t  'transaction_details' =\u003e $transaction_details,\n\t\t  'customer_details' =\u003e $customer_details,\n\t\t  'item_details' =\u003e $item_details,\n\t\t);\n\t\t//error_log(json_encode($transaction));\n\t\t$snapToken = $this-\u003emidtrans-\u003egetSnapToken($transaction);\n\t\terror_log($snapToken);\n\t\techo $snapToken;\n    }\n```\n\n\nif succesfully get token then this script executed, to open snap on the screen\n```\n success: function(data) {\n        //location = data;\n        console.log('token = '+data);\n        \n        var resultType = document.getElementById('result-type');\n        var resultData = document.getElementById('result-data');\n        function changeResult(type,data){\n          $(\"#result-type\").val(type);\n          $(\"#result-data\").val(JSON.stringify(data));\n          //resultType.innerHTML = type;\n          //resultData.innerHTML = JSON.stringify(data);\n        }\n        snap.pay(data, {\n...      \n```\n\n\n\n####Open \n\n```\n\u003ctitle\u003eCheckout\u003c/title\u003e\n  \u003chead\u003e\n    \u003cscript type=\"text/javascript\"\n            src=\"https://app.sandbox.midtrans.com/snap/snap.js\"\n            data-client-key=\"\u003cCLIENT-KEY\u003e\"\u003e\u003c/script\u003e\n    \u003cscript src=\"//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js\"\u003e\u003c/script\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n```\nChange `src=\"https://app.sandbox.midtrans.com/snap/snap.js\"` into `src=\"https://app.midtrans.com/snap/snap.js\"`\n\n### VT-Web\n\nYou can see some VT-Web examples [here](https://github.com/harrypujianto/Veritrans-Codeigniter/blob/master/application/controllers/vtweb.php).\n\n#### Get Redirection URL of a Charge\n```php\n//you don't have to use the function name 'vtweb_charge', it's just an example\npublic function vtweb_charge()\n{\n    $params = array(\n        'transaction_details' =\u003e array(\n          'order_id' =\u003e rand(),\n          'gross_amount' =\u003e 10000,\n        ),\n        'vtweb' =\u003e array()\n      );\n    \n    try {\n      // Redirect to Veritrans VTWeb page\n      header('Location: ' . $this-\u003everitrans-\u003evtweb_charge($params));\n    }\n    catch (Exception $e) {\n      echo $e-\u003egetMessage();\n    }\n}\n```\n\n#### Handle Notification Callback\nYou can see notification handler examples [here](https://github.com/harrypujianto/Veritrans-Codeigniter/blob/master/application/controllers/vtweb.php).\n```php\n//you don't have to use the function name 'notification', it's just an example\npublic function notificarion()\n{\n        $json_result = file_get_contents('php://input');\n\t\t$result = json_decode($json_result);\n\t\tif($result){\n\t\t$notif = $this-\u003everitrans-\u003estatus($result-\u003eorder_id);\n\t\t}\n\t\t\n\t\t$transaction = $notif-\u003etransaction_status;\n\t\t$type = $notif-\u003epayment_type;\n\t\t$order_id = $notif-\u003eorder_id;\n\t\t$fraud = $notif-\u003efraud_status;\n\t\tif ($transaction == 'capture') {\n\t\t  // For credit card transaction, we need to check whether transaction is challenge by FDS or not\n\t\t  if ($type == 'credit_card'){\n\t\t    if($fraud == 'challenge'){\n\t\t      // TODO set payment status in merchant's database to 'Challenge by FDS'\n\t\t      // TODO merchant should decide whether this transaction is authorized or not in MAP\n\t\t      echo \"Transaction order_id: \" . $order_id .\" is challenged by FDS\";\n\t\t      } \n\t\t      else {\n\t\t      // TODO set payment status in merchant's database to 'Success'\n\t\t      echo \"Transaction order_id: \" . $order_id .\" successfully captured using \" . $type;\n\t\t      }\n\t\t    }\n\t\t  }\n\t\telse if ($transaction == 'settlement' \u0026\u0026 $type != 'credit_card'){\n\t\t  // TODO set payment status in merchant's database to 'Settlement'\n\t\t  echo \"Transaction order_id: \" . $order_id .\" successfully transfered using \" . $type;\n\t\t  } \n\t\t  else if($transaction == 'pending'){\n\t\t  // TODO set payment status in merchant's database to 'Pending'\n\t\t  echo \"Waiting customer to finish transaction order_id: \" . $order_id . \" using \" . $type;\n\t\t  } \n\t\t  else if ($transaction == 'deny') {\n\t\t  // TODO set payment status in merchant's database to 'Denied'\n\t\t  echo \"Payment using \" . $type . \" for transaction order_id: \" . $order_id . \" is denied.\";\n\t\t}\n```\n\n### VT-Direct\nYou can see VT-Direct form [here](https://github.com/harrypujianto/Veritrans-Codeigniter/blob/master/application/views/checkout_with_3ds.php).\n\nyou can see VT-Direct process [here](https://github.com/harrypujianto/Veritrans-Codeigniter/blob/master/application/controllers/vtdirect.php).\n\n#### Checkout Page\n\n```html\n\u003chtml\u003e\n\u003chead\u003e\n\t\u003ctitle\u003eCheckout\u003c/title\u003e\n\t\u003c!-- Include PaymentAPI  --\u003e\n\t\u003clink rel=\"stylesheet\" href=\"\u003c?php echo base_url();?\u003easset/css/jquery.fancybox.css\"\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\t\u003cscript type=\"text/javascript\" src=\"https://api.sandbox.veritrans.co.id/v2/assets/js/veritrans.min.js\"\u003e\u003c/script\u003e\n\t\u003cscript src=\"//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js\"\u003e\u003c/script\u003e\n\t\u003cscript type=\"text/javascript\" src=\"\u003c?php echo base_url();?\u003easset/js/jquery.fancybox.pack.js\"\u003e\u003c/script\u003e\n\n\t\u003ch1\u003eCheckout\u003c/h1\u003e\n\t\u003cform action=\"\u003c?php echo site_url()?\u003e/vtdirect/vtdirect_cc_charge\" method=\"POST\" id=\"payment-form\"\u003e\n\t\t\u003cfieldset\u003e\n\t\t\t\u003clegend\u003eCheckout\u003c/legend\u003e\n\t\t\t\u003cp\u003e\n\t\t\t\t\u003clabel\u003eCard Number\u003c/label\u003e\n\t\t\t\t\u003cinput class=\"card-number\" value=\"4811111111111114\" size=\"20\" type=\"text\" autocomplete=\"off\"/\u003e\n\t\t\t\u003c/p\u003e\n\t\t\t\u003cp\u003e\n\t\t\t\t\u003clabel\u003eExpiration (MM/YYYY)\u003c/label\u003e\n\t\t\t\t\u003cinput class=\"card-expiry-month\" value=\"12\" placeholder=\"MM\" size=\"2\" type=\"text\" /\u003e\n\t\t    \t\u003cspan\u003e / \u003c/span\u003e\n\t\t    \t\u003cinput class=\"card-expiry-year\" value=\"2018\" placeholder=\"YYYY\" size=\"4\" type=\"text\" /\u003e\n\t\t\t\u003c/p\u003e\n\t\t\t\u003cp\u003e\n\t\t    \t\u003clabel\u003eCVV\u003c/label\u003e\n\t\t    \t\u003cinput class=\"card-cvv\" value=\"123\" size=\"4\" type=\"password\" autocomplete=\"off\"/\u003e\n\t\t\t\u003c/p\u003e\n\n\t\t\t\u003cp\u003e\n\t\t    \t\u003clabel\u003eSave credit card\u003c/label\u003e\n\t\t    \t\u003cinput type=\"checkbox\" name=\"save_cc\" value=\"true\"\u003e\n\t\t\t\u003c/p\u003e\n\n\t\t\t\u003cinput id=\"token_id\" name=\"token_id\" type=\"hidden\" /\u003e\n\t\t\t\u003cbutton class=\"submit-button\" type=\"submit\"\u003eSubmit Payment\u003c/button\u003e\n\t\t\u003c/fieldset\u003e\n\t\u003c/form\u003e\n\n\t\u003c!-- Javascript for token generation --\u003e\n\t\u003cscript type=\"text/javascript\"\u003e\n\t$(function(){\n\t\t// Sandbox URL\n\t\tVeritrans.url = \"https://api.sandbox.veritrans.co.id/v2/token\";\n\t\t// TODO: Change with your client key.\n\t\tVeritrans.client_key = \"\u003cyour client key\u003e\";\n\t\t\n\t\t//Veritrans.client_key = \"d4b273bc-201c-42ae-8a35-c9bf48c1152b\";\n\t\tvar card = function(){\n\t\t\treturn { \t'card_number'\t\t: $(\".card-number\").val(),\n\t\t\t\t\t\t'card_exp_month'\t: $(\".card-expiry-month\").val(),\n\t\t\t\t\t\t'card_exp_year'\t\t: $(\".card-expiry-year\").val(),\n\t\t\t\t\t\t'card_cvv'\t\t\t: $(\".card-cvv\").val(),\n\t\t\t\t\t\t'secure'\t\t\t: true,\n\t\t\t\t\t\t'bank'\t\t\t\t: 'bni',\n\t\t\t\t\t\t'gross_amount'\t\t: 10000\n\t\t\t\t\t\t }\n\t\t};\n\n\t\tfunction callback(response) {\n\t\t\tif (response.redirect_url) {\n\t\t\t\t// 3dsecure transaction, please open this popup\n\t\t\t\topenDialog(response.redirect_url);\n\n\t\t\t} else if (response.status_code == '200') {\n\t\t\t\t// success 3d secure or success normal\n\t\t\t\tcloseDialog();\n\t\t\t\t// submit form\n\t\t\t\t$(\".submit-button\").attr(\"disabled\", \"disabled\"); \n\t\t\t\t$(\"#token_id\").val(response.token_id);\n\t\t\t\t$(\"#payment-form\").submit();\n\t\t\t} else {\n\t\t\t\t// failed request token\n\t\t\t\tconsole.log('Close Dialog - failed');\n\t\t\t\t//closeDialog();\n\t\t\t\t//$('#purchase').removeAttr('disabled');\n\t\t\t\t// $('#message').show(FADE_DELAY);\n\t\t\t\t// $('#message').text(response.status_message);\n\t\t\t\t//alert(response.status_message);\n\t\t\t}\n\t\t}\n\n\t\tfunction openDialog(url) {\n\t\t\t$.fancybox.open({\n\t\t        href: url,\n\t\t        type: 'iframe',\n\t\t        autoSize: false,\n\t\t        width: 700,\n\t\t        height: 500,\n\t\t        closeBtn: false,\n\t\t        modal: true\n\t\t    });\n\t\t}\n\n\t\tfunction closeDialog() {\n\t\t\t$.fancybox.close();\n\t\t}\n\t\t\n\t\t$('.submit-button').click(function(event){\n\t\t\tevent.preventDefault();\n\t\t\t//$(this).attr(\"disabled\", \"disabled\"); \n\t\t\tVeritrans.token(card, callback);\n\t\t\treturn false;\n\t\t});\n\t});\n\n\t\u003c/script\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### Checkout Process\n\n##### 1. Create Transaction Details\n\n```php\n$transaction_details = array(\n  'order_id'    =\u003e time(),\n  'gross_amount'  =\u003e 10000\n);\n```\n\n##### 2. Create Item Details, Billing Address, Shipping Address, and Customer Details (Optional)\n\n```php\n// Populate items\n$items = array(\n    array(\n      'id'       =\u003e 'item1',\n      'price'    =\u003e 5000,\n      'quantity' =\u003e 1,\n      'name'     =\u003e 'Adidas f50'\n    ),\n    array(\n      'id'       =\u003e 'item2',\n      'price'    =\u003e 2500,\n      'quantity' =\u003e 2,\n      'name'     =\u003e 'Nike N90'\n    ));\n\n// Populate customer's billing address\n$billing_address = array(\n    'first_name'   =\u003e \"Andri\",\n    'last_name'    =\u003e \"Setiawan\",\n    'address'      =\u003e \"Karet Belakang 15A, Setiabudi.\",\n    'city'         =\u003e \"Jakarta\",\n    'postal_code'  =\u003e \"51161\",\n    'phone'        =\u003e \"081322311801\",\n    'country_code' =\u003e 'IDN'\n  );\n\n// Populate customer's shipping address\n$shipping_address = array(\n    'first_name'   =\u003e \"John\",\n    'last_name'    =\u003e \"Watson\",\n    'address'      =\u003e \"Bakerstreet 221B.\",\n    'city'         =\u003e \"Jakarta\",\n    'postal_code'  =\u003e \"51162\",\n    'phone'        =\u003e \"081322311801\",\n    'country_code' =\u003e 'IDN'\n  );\n\n// Populate customer's info\n$customer_details = array(\n    'first_name'       =\u003e \"Andri\",\n    'last_name'        =\u003e \"Setiawan\",\n    'email'            =\u003e \"andri@email.co\",\n    'phone'            =\u003e \"081322311801\",\n    'billing_address'  =\u003e $billing_address,\n    'shipping_address' =\u003e $shipping_address\n  );\n```\n\n##### 3. Get Token ID from Checkout Page\n\n```php\n// Token ID from checkout page\n$token_id = $_POST['token_id'];\n```\n##### 4. Create Transaction Data\n\n```php\n// Transaction data to be sent\n$transaction_data = array(\n    'payment_type' =\u003e 'credit_card',\n    'credit_card'  =\u003e array(\n      'token_id'      =\u003e $token_id,\n      'bank'          =\u003e 'bni',\n      'save_token_id' =\u003e isset($_POST['save_cc'])\n    ),\n    'transaction_details' =\u003e $transaction_details,\n    'item_details'        =\u003e $items,\n    'customer_details'    =\u003e $customer_details\n  );\n```\n\n##### 5. Charge\n\n```php\n$response= $this-\u003everitrans-\u003evtdirect_charge($transaction_data);\n```\n\n##### 6. Handle Transaction Status\n\n```php\n// Success\nif($response-\u003etransaction_status == 'capture') {\n  echo \"\u003cp\u003eTransaksi berhasil.\u003c/p\u003e\";\n  echo \"\u003cp\u003eStatus transaksi untuk order id $response-\u003eorder_id: \" .\n      \"$response-\u003etransaction_status\u003c/p\u003e\";\n\n  echo \"\u003ch3\u003eDetail transaksi:\u003c/h3\u003e\";\n  echo \"\u003cpre\u003e\";\n  var_dump($response);\n  echo \"\u003c/pre\u003e\";\n}\n// Deny\nelse if($response-\u003etransaction_status == 'deny') {\n  echo \"\u003cp\u003eTransaksi ditolak.\u003c/p\u003e\";\n  echo \"\u003cp\u003eStatus transaksi untuk order id .$response-\u003eorder_id: \" .\n      \"$response-\u003etransaction_status\u003c/p\u003e\";\n\n  echo \"\u003ch3\u003eDetail transaksi:\u003c/h3\u003e\";\n  echo \"\u003cpre\u003e\";\n  var_dump($response);\n  echo \"\u003c/pre\u003e\";\n}\n// Challenge\nelse if($response-\u003etransaction_status == 'challenge') {\n  echo \"\u003cp\u003eTransaksi challenge.\u003c/p\u003e\";\n  echo \"\u003cp\u003eStatus transaksi untuk order id $response-\u003eorder_id: \" .\n      \"$response-\u003etransaction_status\u003c/p\u003e\";\n\n  echo \"\u003ch3\u003eDetail transaksi:\u003c/h3\u003e\";\n  echo \"\u003cpre\u003e\";\n  var_dump($response);\n  echo \"\u003c/pre\u003e\";\n}\n// Error\nelse {\n  echo \"\u003cp\u003eTerjadi kesalahan pada data transaksi yang dikirim.\u003c/p\u003e\";\n  echo \"\u003cp\u003eStatus message: [$response-\u003estatus_code] \" .\n      \"$response-\u003estatus_message\u003c/p\u003e\";\n\n  echo \"\u003cpre\u003e\";\n  var_dump($response);\n  echo \"\u003c/pre\u003e\";\n}\n```\n\n#### Process Transaction\n\n##### Get a Transaction Status\n\n```php\n$status = $this-\u003everitrans-\u003estatus($order_id);\nvar_dump($status);\n```\n##### Approve a Transaction\n\n```php\n$approve = $this-\u003everitrans-\u003eapprove($order_id);\nvar_dump($approve);\n```\n\n##### Cancel a Transaction\n\n```php\n$cancel = $this-\u003everitrans-\u003ecancel($order_id);\nvar_dump($cancel);\n```","funding_links":[],"categories":["Web Services","E-commerce"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharrypujianto%2FVeritrans-Codeigniter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharrypujianto%2FVeritrans-Codeigniter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharrypujianto%2FVeritrans-Codeigniter/lists"}