-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
1,615 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
vendor | ||
.idea | ||
composer.lock | ||
composer.lock | ||
pay.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
/* | ||
* This file is part of the WayForPay project. | ||
* | ||
* @link https://github.com/wayforpay/php-sdk | ||
* | ||
* @author Vladislav Lyshenko <vladdnepr1989@gmail.com> | ||
* @copyright Copyright 2019 WayForPay | ||
* @license https://opensource.org/licenses/MIT | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
require_once __DIR__ . '/../vendor/autoload.php'; | ||
|
||
use WayForPay\SDK\Collection\ProductCollection; | ||
use WayForPay\SDK\Credential\AccountSecretTestCredential; | ||
use WayForPay\SDK\Domain\Client; | ||
use WayForPay\SDK\Domain\Product; | ||
use WayForPay\SDK\Wizard\PurchaseWizard; | ||
|
||
// Use test credential or yours | ||
$credential = new AccountSecretTestCredential(); | ||
//$credential = new AccountSecretCredential('account', 'secret'); | ||
|
||
$form = PurchaseWizard::get($credential) | ||
->setOrderReference(sha1(microtime(true))) | ||
->setAmount(0.01) | ||
->setCurrency('USD') | ||
->setOrderDate(new \DateTime()) | ||
->setMerchantDomainName('https://google.com') | ||
->setClient(new Client( | ||
'John', | ||
'Dou', | ||
'john.dou@gmail.com', | ||
'+12025550152', | ||
'USA' | ||
)) | ||
->setProducts(new ProductCollection(array( | ||
new Product('test', 0.01, 1) | ||
))) | ||
->getForm() | ||
->getAsString(); | ||
|
||
echo '<html><body><h1>Pay Form</h1>' . $form . '</body></html>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<?php | ||
/* | ||
* This file is part of the WayForPay project. | ||
* | ||
* @link https://github.com/wayforpay/php-sdk | ||
* | ||
* @author Vladislav Lyshenko <vladdnepr1989@gmail.com> | ||
* @copyright Copyright 2019 WayForPay | ||
* @license https://opensource.org/licenses/MIT | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace WayForPay\SDK\Domain; | ||
|
||
use DateTime; | ||
|
||
class Avia | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
private $departureDate; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $locationNumber; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $locationCodes; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $nameFirst; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $nameLast; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
private $reservationCode; | ||
|
||
public function __construct( | ||
DateTime $departureDate = null, | ||
$locationNumber = null, | ||
$locationCodes = null, | ||
$nameFirst = null, | ||
$nameLast = null, | ||
$reservationCode = null | ||
) { | ||
$this->departureDate = $departureDate; | ||
$this->locationNumber = strval($locationNumber); | ||
$this->locationCodes = strval($locationCodes); | ||
$this->nameFirst = strval($nameFirst); | ||
$this->nameLast = strval($nameLast); | ||
$this->reservationCode = strval($reservationCode); | ||
} | ||
|
||
/** | ||
* @return DateTime | ||
*/ | ||
public function getDepartureDate() | ||
{ | ||
return $this->departureDate; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getLocationNumber() | ||
{ | ||
return $this->locationNumber; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getLocationCodes() | ||
{ | ||
return $this->locationCodes; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getNameFirst() | ||
{ | ||
return $this->nameFirst; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getNameLast() | ||
{ | ||
return $this->nameLast; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getReservationCode() | ||
{ | ||
return $this->reservationCode; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.