Download the PHP package issei-m/spike-php without Composer
On this page you can find all versions of the php package issei-m/spike-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package spike-php
Spike for PHP
[ABANDONED]
This project is already abandoned due to SPIKE payment service close, and you can no longer access to their api endpoint anymore.
Latest release: v1.0-BETA5
The client of https://spike.cc REST api for PHP (5.4+, 7+, HHVM).
Basic Usage
First, initialize the Spike
object with your api secret key. It's the entry point for accessing the all api interfaces:
Create a new charge
To create a new charge, you have to build a ChargeRequest
object. It can be specified card token
, amount
, currency
and some related products. Next, call charge()
method with it. If charge succeeded this method will return the new Charge
object generated by REST api:
Tips: You can pass the Token
's id directly instead of generating the new Token
object:
NOTE: If you want to know how to get a card token
, read Request a token section.
Find a charge
Call getCharge()
method with charge id:
Capture the charge
If you have a charge which has not been captured, you can use capture()
method to capture it:
Refund the charge
Call refund()
method with the Charge
object that you want to refund:
Tips: You can pass the Charge
's id directly instead of generating/retrieving the Charge
object:
Retrieve the all charges
Call getCharges()
method. it returns an array containing the Charge
objects.
Paging
You can specify the limit of number of records at 1st argument (10 records by default):
If you pass a Charge
object (or ID as a string directly) into 2nd argument, you can retrieve charges that older than (passed charge is NOT included to list):
At 3rd argument, you can also specify the charge (or ID as a string directly) object if you want to retrieve charges that newer than (passed charge is NOT included to list):
Request a token
If you have contracted with https://spike.cc to request a new token, you can get a new token by requestToken()
method with TokenRequest
:
Of course, you can create a new charge with it:
Find a token
Call getToken()
method with token id:
Installation
Use Composer to install the package:
Contributing
- Fork it
- Create your feature branch
- Commit your change and push it
- Create a new pull request