This is the PHP wrapper for the Paylike sdk
Sign up for a free merchant account (free and instant)
- Table of contents
An API key can be obtained by creating a merchant and adding an app through our dashboard.
PHP 5.3.3 and later.
Examples are available in the examples.php file.
Download the latest release and include the Client.php file in your php application.
require_once('/path/to/Paylike/Client.php'); $privateAppKey = 'your-private-key-goes-here'; \Paylike\Client::setKey( $privateAppKey );Every operation requires a transaction id that is obtained by using the javascript sdk.
$data = array( 'amount' => $amount, //value must be in cents 'currency' => $currency //see available formats https://github.com/paylike/currencies ); $transaction = \Paylike\Transaction::capture( $transactionId, $data ); // you will now have the transaction data in the $transaction variable.Every operation requires a transaction id that is obtained by using the javascript sdk.
$data = array( 'amount' => $amount, //value must be in cents 'descriptor' => $reason //is optional see https://github.com/paylike/descriptor for format and restrictions. ); $transaction = \Paylike\Transaction::refund( $transactionId, $data ); // you will now have the transaction data in the $transaction variable.Every operation requires a transaction id that is obtained by using the javascript sdk.
$data = array( 'amount' => $amount //value must be in cents ); $transaction = \Paylike\Transaction::void( $transactionId, $data ); // you will now have the transaction data in the $transaction variable.Every operation requires a transaction id that is obtained by using the javascript sdk.
$transaction = \Paylike\Transaction::fetch( $transactionId); // you will now have the transaction data in the $transaction variable.Every operation requires a transaction id that is obtained by using the javascript sdk.
$data = array( 'amount' => $amount, //value must be in cents 'currency' => $currency //see available formats https://github.com/paylike/currencies ); $transaction = \Paylike\Transaction::create( $transactionId, $data ); // you will now have the transaction data in the $transaction variable.Every operation requires a card id that is obtained by using the javascript sdk.
$card = \Paylike\Card::fetch( $cardId ); // you will now have the card data in the $card variable.