Deployment Day: Version 1.6.0 is all about payments
Version 1.6.X will be about integrations!
In this first 1.6 release we have opensourced our PHPpayments library.
The idea of PHPpayments is to have one checkout object that maps to different kinds of payment gateways. This way you can easily switch between gateways and you don’t have to rewrite all of your code. Each supported gateway also has it’s own example file.
By using our library you can easily add a new payment method to SolidShops or use our supported payment gateways in your own PHP applications.
A special thanks to the people from MultisafePay and Mollie, who have already contributed to our repository over the last few months!
Installation
You can download the latest version from github or use composer:
{ "require": { "solidshops/phppayments": "dev-master"; } }
Supported payment providers
Offline:
- Banktransfer
- Cash on delivery
- Cheque
- Pickup
Integration:
Usage
$paymentmethod = "Payment_Integration_Paypalwebsitepaymentsstandard"; $obj_payment = \PHPpayments\Loader::load ( $paymentmethod ); //set credentials $obj_payment->addFieldSetting ( "account", "yourpaypalemail@domain.com" ); //set order data $obj_payment->addFieldOrder ( "guid", "123132123132123" ); $obj_payment->addFieldOrder ( "id", "1000" ); $obj_payment->addFieldOrder ( "currency", "EUR" ); $obj_payment->addFieldOrder ( "total", 100 ); $obj_payment->addFieldOrder ( "email", "name@domain.com"); //set billing data $obj_payment->addFieldBilling ( "firstname", "John" ); $obj_payment->addFieldBilling ( "lastname", "Doe " ); $obj_payment->addFieldBilling ( "companyname", "Billing company" ); $obj_payment->addFieldBilling ( "address1", "Billing street1" ); $obj_payment->addFieldBilling ( "address2", "Billing street2" ); $obj_payment->addFieldBilling ( "city","Billing city" ); $obj_payment->addFieldBilling ( "state", "Billing state"); $obj_payment->addFieldBilling ( "zip", "Billing zip" ); $obj_payment->addFieldBilling ( "country", "Billing country" ); $obj_payment->addFieldBilling ( "phone", "Billing phone"); //set shipping data if available $obj_payment->addFieldShipping ( "firstname", "Jane" ); $obj_payment->addFieldShipping ( "lastname", "Doe " ); $obj_payment->addFieldShipping ( "companyname", "Shipping company" ); $obj_payment->addFieldShipping ( "address1", "Shipping street1" ); $obj_payment->addFieldShipping ( "address2", "Shipping street2" ); $obj_payment->addFieldShipping ( "city", "Shipping city" ); $obj_payment->addFieldShipping ( "state", "Shipping state" ); $obj_payment->addFieldShipping ( "zip", "Shipping zip" ); $obj_payment->addFieldShipping ( "country", "Shipping country" ); $obj_payment->addFieldShipping ( "phone", "Shipping phone" ); //set urls for after payment $domain = "http://www.domain.com"; $obj_payment->setUrlSite ( $domain ); $obj_payment->setUrlSuccess ( $domain . "/aftersuccess" ); $obj_payment->setUrlCancel ( $domain . "/aftercancel" ); $obj_payment->setUrlCallback ( $domain . "/callback" ); //enable sandbox environment $obj_payment->enableTestMode (); //map our data structure with payment providers structure $obj_payment->preparePayment (); //redirect to payment provider $obj_payment->processPayment ();
Please contact us If you have any questions about the PHPpayments library.
Enjoy the updates everyone and let us know if you have an idea that can improve our application and our service to you. We’d love to know!
Let's get social shall we?
We'd love to know what you think. Join the conversation about your hosted e-commerce solution.