Skip to content

Commit

Permalink
Merge pull request #26 from checkout/dev
Browse files Browse the repository at this point in the history
1.0.6
  • Loading branch information
aquila-freitas-cko authored Jun 12, 2019
2 parents ee0a47d + 5209c45 commit 095a097
Show file tree
Hide file tree
Showing 7 changed files with 246 additions and 4 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "checkout/checkout-sdk-php",
"description": "Checkout.com SDK for PHP",
"homepage": "https://github.com/checkout/checkout-sdk-php",
"version": "1.0.5",
"version": "1.0.6",
"type": "library",
"license": "MIT",
"keywords": ["checkout.com","payment","gateway","checkout","checkoutcom","GW3","CKO", "Reboot", "SDK", "Library", "PHP", "API"],
Expand All @@ -27,6 +27,6 @@
}
},
"require-dev": {
"phpunit/phpunit": "^4.0"
"phpunit/phpunit": "^6"
}
}
26 changes: 26 additions & 0 deletions examples/Payments/alternative_payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,29 @@
$eps = new Payment(new EpsSource(), 'EUR');
$eps->amount = 999;
$payment = $checkout->payments()->request($eps);



// Fawry
$product = new Product();
$product->product_id = 'id';
$product->quantity = 1;
$product->price = 999;
$product->description = 'description';
$fawry = new Payment(new FawrySource('customer_email', 'customer_mobile', 'description', array($product)), 'EGP');
$fawry->amount = 999;
$payment = $checkout->payments()->request($fawry);



// Bancontact
$bancontact = new Payment(new BancontactSource('account_holder_name', 'payment_country'), 'EUR');
$bancontact->amount = 999;
$payment = $checkout->payments()->request($bancontact);



// KNet
$knet = new Payment(new KnetSource('en'), 'KWD');
$knet->amount = 999;
$payment = $checkout->payments()->request($knet);
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
stopOnFailure="false">
<testsuites>
<testsuite name="Checkout.com PHP SDK Test Suite">
<directory>./tests</directory>
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<filter>
Expand Down
2 changes: 1 addition & 1 deletion src/CheckoutApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ final class CheckoutApi
*
* @var string
*/
const VERSION = '1.0.5';
const VERSION = '1.0.6';

/**
* Channel section.
Expand Down
72 changes: 72 additions & 0 deletions src/Models/Payments/BancontactSource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php

/**
* Checkout.com
* Authorised and regulated as an electronic money institution
* by the UK Financial Conduct Authority (FCA) under number 900816.
*
* PHP version 7
*
* @category SDK
* @package Checkout.com
* @author Platforms Development Team <[email protected]>
* @copyright 2010-2019 Checkout.com
* @license https://opensource.org/licenses/mit-license.html MIT License
* @link https://docs.checkout.com/
*/

namespace Checkout\Models\Payments;

/**
* Payment method Bancontact.
*
* @category SDK
* @package Checkout.com
* @author Platforms Development Team <[email protected]>
* @license https://opensource.org/licenses/mit-license.html MIT License
* @link https://docs.checkout.com/
*/
class BancontactSource extends IdSource
{

/**
* Qualified name of the class.
*
* @var string
*/
const QUALIFIED_NAME = __CLASS__;

/**
* Qualified namespace of the class.
*
* @var string
*/
const QUALIFIED_NAMESPACE = __NAMESPACE__;

/**
* Name of the model.
*
* @var string
*/
const MODEL_NAME = 'bancontact';


/**
* Magic Methods
*/

/**
* Initialise bancontact.
*
* @param string $name The account_holder_name
* @param string $country The payment_country
* @param string $descriptor The billing_descriptor
*/
public function __construct($name, $country, $descriptor = '')
{
$this->type = static::MODEL_NAME;
$this->account_holder_name = $name;
$this->payment_country = $country;
$this->billing_descriptor = $descriptor;
}
}
76 changes: 76 additions & 0 deletions src/Models/Payments/FawrySource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?php

/**
* Checkout.com
* Authorised and regulated as an electronic money institution
* by the UK Financial Conduct Authority (FCA) under number 900816.
*
* PHP version 7
*
* @category SDK
* @package Checkout.com
* @author Platforms Development Team <[email protected]>
* @copyright 2010-2019 Checkout.com
* @license https://opensource.org/licenses/mit-license.html MIT License
* @link https://docs.checkout.com/
*/

namespace Checkout\Models\Payments;

use Checkout\Models\Address;

/**
* Payment method Fawry.
*
* @category SDK
* @package Checkout.com
* @author Platforms Development Team <[email protected]>
* @license https://opensource.org/licenses/mit-license.html MIT License
* @link https://docs.checkout.com/
*/
class FawrySource extends IdSource
{

/**
* Qualified name of the class.
*
* @var string
*/
const QUALIFIED_NAME = __CLASS__;

/**
* Qualified namespace of the class.
*
* @var string
*/
const QUALIFIED_NAMESPACE = __NAMESPACE__;

/**
* Name of the model.
*
* @var string
*/
const MODEL_NAME = 'fawry';


/**
* Magic Methods
*/

/**
* Initialise payment Fawry.
*
* @param string $email The customer's email address
* @param string $mobile The customer's mobile number
* @param string $description The description of the payment
* @param Product[] $products This object is passed directly to Fawry as products.
*/
public function __construct($email, $mobile, $description, array $products)
{
$this->type = static::MODEL_NAME;
$this->customer_email = $email;
$this->customer_mobile = $mobile;
$this->description = $description;
$this->products = $products;
}
}
68 changes: 68 additions & 0 deletions src/Models/Payments/KnetSource.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php

/**
* Checkout.com
* Authorised and regulated as an electronic money institution
* by the UK Financial Conduct Authority (FCA) under number 900816.
*
* PHP version 7
*
* @category SDK
* @package Checkout.com
* @author Platforms Development Team <[email protected]>
* @copyright 2010-2019 Checkout.com
* @license https://opensource.org/licenses/mit-license.html MIT License
* @link https://docs.checkout.com/
*/

namespace Checkout\Models\Payments;

/**
* Payment method KNET.
*
* @category SDK
* @package Checkout.com
* @author Platforms Development Team <[email protected]>
* @license https://opensource.org/licenses/mit-license.html MIT License
* @link https://docs.checkout.com/
*/
class KnetSource extends IdSource
{

/**
* Qualified name of the class.
*
* @var string
*/
const QUALIFIED_NAME = __CLASS__;

/**
* Qualified namespace of the class.
*
* @var string
*/
const QUALIFIED_NAMESPACE = __NAMESPACE__;

/**
* Name of the model.
*
* @var string
*/
const MODEL_NAME = 'knet';


/**
* Magic Methods
*/

/**
* Initialise KNET.
*
* @param string $purpose 2-letter language code in accordance with ISO 639-1
*/
public function __construct($language)
{
$this->type = static::MODEL_NAME;
$this->language = $language;
}
}

0 comments on commit 095a097

Please sign in to comment.