PHP code example of noetix / pin-php

1. Go to this page and download the library: Download noetix/pin-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

noetix / pin-php example snippets






// create our request handler
$service = new Pin\Handler(array('key' => 'secret_API_key'));

// build a new charge request
$request = new Pin\Charge\Create(array(
    'amount'      => 400,
    'description' => 'test charge',
    'email'       => '[email protected]',
    'ip_address'  => '203.192.1.172',
    'card'        => array(
        'number'           => '5520000000000000',
        'expiry_month'     => '05',
        'expiry_year'      => '2013',
        'cvc'              => '123',
        'name'             => 'Roland Robot',
        'address_line1'    => '42 Sevenoaks St',
        'address_city'     => 'Lathlain',
        'address_postcode' => '6454',
        'address_state'    => 'WA',
        'address_country'  => 'AU'),
));

// send it
$response = $service->submit($request);

$request = new Pin\Charge\Refund('charge_token_here', array('amount'=>'900'));



$service = new Pin\Handler(array('key' => 'secret_API_key', 'test' => true));