Download the PHP package alxmsl/paymentninjaclient without Composer
On this page you can find all versions of the php package alxmsl/paymentninjaclient. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package paymentninjaclient
PaymentNinjaClient
Powerful client for Payment.Ninja REST API
Usage flow
- User inputs and submits data
- Merchant calls method card/getToken via JSONP or AJAX and receives a temporary token for 10 minutes
- Merchant submits credit card token to a server with other payment data
- Merchant calls method card/process with credit card token
- If
success
istrue
and ACS object is returned- Merchant POSTs ACS parameters
PaReq
,MD
,TermUrl
to aACS url in a browser - User inputs and submits his 3DSecure password
- ACS POSTs parameters
PaRes
,MD
back to merchant's ACS return url - Merchant calls method card/authenticate passing
PaRes
andMD
parameters - If
success
istrue
then merchant can provide a service to a user
- Merchant POSTs ACS parameters
- If success is
true
and ACS object is not returned, then merchant can show a success page to user - If
remember
was passed, merchant will receive apermanentToken
parameter with card/authenticate method responses. You can usepermanentToken
without requiring a user to input the credit card data again - If
recurring
was passed, merchant will receive a recurring object, containing recurring frequency and ending date. Merchant can create new payments for a user calling the card/processRecurring method - If
verify_card
was passed, then transaction price will be set to €1, that will be put on hold and then instantly returned verify_card
can be effectively used withrecurring
,recurring_interval
,recurring_trial
orremember
parameters as it checks the validity of a card via money hold/return- Merchant receives asynchronous callback with transaction details and can provide aservice to a user if status is completed
Installation
For simplified usage all what you need is require packet via composer
In third-party projects, require packet in your composer.json
...and update composer: composer update
Usages
Firstly, create client instance with public and private key, that was provided in your account
Now you can create request for REST API methods
user/resolve
viaClient::userResolve()
user/changeRecurring
viaClient::userChangeRecurring()
user/cancelRecurring
viaClient::userCancelRecurring()
card/getToken
viaClient::cardGetToken()
card/process
viaClient::cardProcess()
card/authenticate
viaClient::cardAuthenticate()
card/processRecurring
viaClient::cardProcessRecurring()
For request execution you should call Request::execute()
method. For example below code
...going to follow output
Console usage
Surely, you can use simple CLI utilities for calling REST API methods
user/resolve
via./bin/user/resolve
user/changeRecurring
via./bin/user/changeRecurring
user/cancelRecurring
via./bin/user/cancelRecurring
card/getToken
via./bin/card/getToken
card/process
via./bin/card/process
card/authenticate
via./bin/card/authenticate
card/processRecurring
via./bin/card/processRecurring
So, user resolving example must be present as
Each utility supports their quick help page
Tests
For completely tests running just call phpunit
command
License
Copyright 2015 Alexey Maslov [email protected]
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.