Skip to content

Instantly share code, notes, and snippets.

View casperbakker's full-sized avatar

Casper Bakker casperbakker

View GitHub Profile
<?php
class AddressSplitter {
/**
* Splits an address line in to array of street, houseNumber, houseNumberExtension and additionToAddress
* @param $address
* @return array
*/
public static function splitAddress($address)
@casperbakker
casperbakker / CurlException.php
Created June 7, 2017 20:07
Easy PHP curl request
<?php
namespace Picqer\Services\Curl;
use Throwable;
class CurlException extends \Exception
{
protected $response = null;
protected $headers = [];
@casperbakker
casperbakker / purchase-order.html
Last active March 28, 2019 08:06
Picqer purchase order PDF HTML
<!doctype html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body class="purchaseorder-pdf">
<div id="header">
<div class="barcode barcode-purchaseorder"><img src="example.png"></div>
<div class="document-title">Purchase order {purchaseorderid}</div>
@casperbakker
casperbakker / order-confirmation.html
Created April 30, 2019 08:01
Picqer order confirmation PDF HTML
<!doctype html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body class="order-pdf">
<div id="header">
<div class="document-title">Order confirmation {orderid}</div>
</div>
@casperbakker
casperbakker / server-example.php
Created April 30, 2021 15:00
Picqer example external shipping provider server
<?php
/**
* Test server for Picqer external shipping provider
* Config endpoint: server-example.php?action=config-options
* Label endpoint: server-example.php?action=label
*/
if (! isset($_GET['action']) || ! in_array($_GET['action'], ['config-options', 'label'])) {
echo 'action not understood';