Skip to content

totansilviu/php-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Paylike PHP Api Wrapper

This is the PHP wrapper for the Paylike sdk

Sign up for a free merchant account (free and instant)

Getting an API key

An API key can be obtained by creating a merchant and adding an app through our dashboard.

Requirements

PHP 5.3.3 and later.

Examples

Examples are available in the examples.php file.

Getting started

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 );

Capturing a transaction

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.

Refund a transaction

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.

Void a transaction

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.

Fetch a transaction

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.

Create a transaction

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.

Fetch a card

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.

About

A PHP client for accessing the API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • PHP 75.4%
  • CSS 24.6%