IPSP PHP (SDK)
Original author(s) | Stepan Kosatyi |
---|---|
Developer(s) | Stepan Kosatyi |
Initial release | 5 August 2015 |
Stable release | 1.1.5
|
Repository | github |
Written in | PHP |
Engine | |
Operating system | Linux, OS X, Windows, FreeBSD |
Size | ~1 MB |
Type | Payment gateway |
License | MIT License |
Website | ipsp-php |
Search IPSP PHP (SDK) on Amazon.
IPSP PHP SDK is a free and open-source software development kit written in PHP and distributed under the MIT License. IPSP PHP SDK is a wrapper of Fondy payment protocol REST API, uses object-oriented programming (OOP) techniques and several design pattern: Command [1], Chain of Responsibility[2], Proxy[3]. SDK covers e-commerce for businesses of all types and support popular CMS modules for fast integration in existing software architecture.
How Does it Work?[edit]
Payment Service Providers partner with Acquiring Banks to offer Merchants the capability to accept payments. Payment Service Providers often offer services in addition to processing transactions. These services include Payment Card Industry and Data Security Standard (PCI) compliance, fraud protection and the ability to process different currencies and translate different languages.
Brief history[edit]
Project started on 5 August 2015GitHub project. After almost 2 years, the project has its own website. The development of new releases and bug fixes started after code coverage with unit tests. In the future, support will be added for new versions of PHP and PSR-2[4] coding style guide and PSR-4[5] autoloader specification.
asKey features[edit]
- Quick installation[6] [7]
- Client side instruction and best practicies[8]
- Host-to-host and vendor side checkout page
- Multiple payment methods credit card, internet banking.
- Multiple data formats (JSON, XML, form-urlencoded)
- Payment details for testing scope
- Hidden server callback for sign responses
- Integration with CMS modules.
API methods[edit]
All API methods executes in the same way. Use $ipsp (Ipsp_Api instance) method call() and pass two parameters: method name and parameters as associative array.
Example:
<?php
$data = $ipsp->call('method name',array(
...
'param' => 'value',
...
));
?>
Name | Description | Mandatory parameters | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
checkout | Hosted payment page | signature[9] | merchant_id | order_id | currency | amount | order_desc | |||||||||||||||||||
recurring | Purchase using card token | rectoken | ||||||||||||||||||||||||
verification | Card verification | verification, verification_type | ||||||||||||||||||||||||
reverse | Order Refund | |||||||||||||||||||||||||
capture | Order capture | |||||||||||||||||||||||||
status | Payment status | |||||||||||||||||||||||||
reports | Payment reports | date_from, date_to |
Name | Description | Mandatory parameters | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
pcidss | Merchant payment page | signature[9] | merchant_id | order_id | order_desc | currency | amount | card_number, cvv2, expiry_date | ||||||||||||||||||
p2pcredit | Peer-to-Peer card credit | receiver_card_number, receiver_rectoken |
Client side integration[edit]
To provide more flexibility for developers, server-side code must deliver secure information (commonly token like UUID) to front-end application, and handle signed responses from payment gateway for payment completion. All other things covered by client-side developers and UX designers.
Embedded checkout page[edit]
To load checkout page on merchant site using IPSP.JS[10] API, developer should first receive this url using checkout api method [11]. Then using example below just replace variable CHECKOUT_URL with api response variable checkout_url.
Example:
<div id="checkout"></div>
<script src="https://api.fondy.eu/static_common/v1/checkout/ipsp.js"></script>
<script>
$ipsp.get('checkout').config({'wrapper':'#checkout'}).scope(function(){
this.loadUrl(CHECKOUT_URL);
});
</script>
Styling checkout page[edit]
IPSP.JS support embedded css rules to override the default checkout page design (hide general shop info section, style form controls etc.)
<script>
$ipsp.get('checkout').config({
'wrapper': '#frameholder' ,
'styles' : {
'body':{
'overflow':'hidden'
},
'.page-section-shopinfo':{
display:'none'
},
'.page-section-footer':{
display:'none'
}
}
})
</script>
Donate button[edit]
Online donation on web-site is an important thing in open source project or non-commercial organization. [12] In this case payment service providers bring to their clients features like:
This payment type is less secure for using in e-commerce project, but ideal for Personal web page, open source project or Nonprofit organization. [13]
Example:
<script src="https://api.fondy.eu/static_common/v1/checkout/ipsp.js"></script>
function getCheckoutUrl(amount,order_desc) {
var button = $ipsp.get('button');
button.setMerchantId(1396424);
button.setAmount(amount,'USD');
button.setResponseUrl('http://example.com/result/');
button.setHost('api.fondy.eu');
button.addField({
label: 'Payment Description',
name: 'order_desc',
value: order_desc,
readonly:true
});
return button.getUrl();
};
<button onclick="location.href=getCheckoutUrl('','Open source project support')">Donate an arbitrary amount</button>
<button onclick="location.href=getCheckoutUrl(10,'10$ Donation')">Donate $10</button>
See also[edit]
References and notes[edit]
- ↑ "PHP Design Patterns Command". FluffyCat. 2005. Retrieved 29 June 2017.
... In the Command Pattern an object encapsulates everything needed to execute a method in another object. ...
- ↑ "PHP Design Patterns Chain of Responsibility". FluffyCat. 2005. Retrieved 29 June 2017.
... A method called in one object will move up a chain of objects until one is found that can properly handle the call ...
- ↑ "PHP Design Patterns Proxy". FluffyCat. 2005. Retrieved 29 June 2017.
... one class stands in for and handles all access to another class ...
- ↑ "PSR-2: Coding Style Guide". PHP FIG. 2016. Retrieved 28 June 2017.
...The intent of this guide is to reduce cognitive friction when scanning code from different authors...
- ↑ "PSR-4: Autoloader". PHP FIG. 2016. Retrieved 28 June 2017.
...This PSR describes a specification for autoloading classes from file paths...
- ↑ "Installation and requirements". IPSP PHP SDK. 2017. Retrieved 28 June 2017.
- ↑ "Quick Start". IPSP PHP SDK. 2017. Retrieved 28 June 2017.
- ↑ Top 5 Principles for an Improved Checkout Design
- ↑ 9.0 9.1 "Generate Signature". IPSP PHP. 2017. Retrieved 29 June 2017.
- ↑ Fondy JavaScript API
- ↑ Hosted payment page
- ↑
"Payment / donate button". Fondy. 2015. Retrieved 27 June 2017.
...Payment button is a simple HTML code, wich can be place on any web page: on site, blog, internet-shop basket...'
- ↑ JSFiddle Example
External Links[edit]
Some use of "" in your query was not closed by a matching "".Some use of "" in your query was not closed by a matching "".
This article "IPSP PHP (SDK)" is from Wikipedia. The list of its authors can be seen in its historical. Articles copied from Draft Namespace on Wikipedia could be seen on the Draft Namespace of Wikipedia and not main one.