-
Notifications
You must be signed in to change notification settings - Fork 38
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
Frantisek Sichinger
committed
Feb 13, 2017
1 parent
02608e8
commit 35fd946
Showing
8 changed files
with
234 additions
and
5 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 |
---|---|---|
|
@@ -3,4 +3,8 @@ | |
/bin/ | ||
!/bin/jenkins.sh | ||
/var/ | ||
/phpunit.xml | ||
/phpunit.xml | ||
.idea | ||
/vendor | ||
composer.phar | ||
composer.sh |
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,182 @@ | ||
<?php | ||
|
||
require_once __DIR__ . '/../vendor/autoload.php'; | ||
|
||
use GoPay\Definition\Language; | ||
use GoPay\Definition\Payment\Currency; | ||
use GoPay\Definition\Payment\PaymentInstrument; | ||
use GoPay\Definition\Payment\BankSwiftCode; | ||
use GoPay\Definition\Payment\VatRate; | ||
use GoPay\Definition\Payment\PaymentItemType; | ||
|
||
$gopay = GoPay\payments([ | ||
'goid' => '8761908826', | ||
'clientId' => '[email protected]', | ||
'clientSecret' => 'VpnJVcTn', | ||
'isProductionMode' => false, | ||
'language' => Language::CZECH | ||
]); | ||
|
||
$response = $gopay->createPayment([ | ||
'payer' => [ | ||
'default_payment_instrument' => PaymentInstrument::BANK_ACCOUNT, | ||
'allowed_payment_instruments' => [PaymentInstrument::BANK_ACCOUNT], | ||
'default_swift' => BankSwiftCode::FIO_BANKA,'FIOBCZPP', | ||
'allowed_swifts' => [BankSwiftCode::FIO_BANKA, BankSwiftCode::MBANK], | ||
'contact' => ['first_name' => 'Zbynek', | ||
'last_name' => 'Zak', | ||
'email' => '[email protected]', | ||
'phone_number' => '+420777456123', | ||
'city' => 'C.Budejovice', | ||
'street' => 'Plana 67', | ||
'postal_code' => '373 01', | ||
'country_code' => 'CZE' | ||
] | ||
], | ||
'target' => [ | ||
'type' => 'ACCOUNT', | ||
'goid' => '8123456789' | ||
], | ||
'amount' => '1000', | ||
'currency' => Currency::CZECH_CROWNS, | ||
'order_number' => '001', | ||
'order_description' => 'obuv', | ||
'items' => [[ | ||
'type' => 'ITEM', | ||
'name' => 'obuv', | ||
'product_url' => 'https://www.eshop.cz/boty/lodicky', | ||
'ean' => 1234567890123, | ||
'amount' => 119990, | ||
'count' => 1, | ||
'vat_rate' => VatRate::RATE_4 | ||
], | ||
[ | ||
'type' => PaymentItemType::ITEM, | ||
'name' => 'oprava podpatku', | ||
'product_url' => 'https://www.eshop.cz/boty/opravy', | ||
'ean' => 1234567890189, | ||
'amount' => 19960, | ||
'count' => 1, | ||
'vat_rate' => VatRate::RATE_3 | ||
]], | ||
'eet' => [ | ||
'celk_trzba' => 139950, | ||
'zakl_dan1' => 99165, | ||
'dan1' => 20825, | ||
'zakl_dan2' => 17357, | ||
'dan2' => 2604, | ||
'mena' => Currency::CZECH_CROWNS | ||
], | ||
'additional_params' => [['name' => 'invoicenumber', | ||
'value' => '2015001003' | ||
]], | ||
'callback' => [ | ||
'return_url' => 'https=>//www.eshop.cz/return', | ||
'notification_url' => 'https=>//www.eshop.cz/notify' | ||
], | ||
'lang' => Language::CZECH | ||
]); | ||
|
||
$response = $gopay->refundPayment(3000006620, [ | ||
'amount' => 119990, | ||
'items' => [ | ||
[ | ||
'type' => PaymentItemType::ITEM, | ||
'name' => 'lodicky', | ||
'product_url' => 'https://www.eshop.cz/boty/damske/lodicky-cervene', | ||
'ean' => 1234567890123, | ||
'amount' => -119990, | ||
'count' => 1, | ||
'vat_rate' => VatRate::RATE_4 | ||
]], | ||
'eet' => [ | ||
'celk_trzba' => -119990, | ||
'zakl_dan1' => -99165, | ||
'dan1' => -20825, | ||
'dan2' => -2604 | ||
] | ||
]); | ||
|
||
$response = $gopay->createPayment([ | ||
'payer' => [ | ||
'contact' => ['first_name' => 'Zbynek', | ||
'last_name' => 'Zak', | ||
'email' => '[email protected]', | ||
'phone_number' => '+420777456123', | ||
'city' => 'C.Budejovice', | ||
'street' => 'Plana 67', | ||
'postal_code' => '373 01', | ||
'country_code' => 'CZE' | ||
] | ||
], | ||
'target' => ['type' => 'ACCOUNT', | ||
'goid' => '8123456789' | ||
], | ||
'amount' => '1000', | ||
'currency' => Currency::CZECH_CROWNS, | ||
'order_number' => '001', | ||
'order_description' => 'obuv', | ||
'items' => [[ | ||
'type' => 'ITEM', | ||
'name' => 'obuv', | ||
'product_url' => 'https=>//www.eshop.cz/boty/lodicky', | ||
'ean' => 1234567890123, | ||
'amount' => 119990, | ||
'count' => 1, | ||
'vat_rate' => VatRate::RATE_4 | ||
], | ||
[ | ||
'type' => PaymentItemType::ITEM, | ||
'name' => 'oprava podpatku', | ||
'product_url' => 'https=>//www.eshop.cz/boty/opravy', | ||
'ean' => 1234567890189, | ||
'amount' => 19960, | ||
'count' => 1, | ||
'vat_rate' => VatRate::RATE_3 | ||
]], | ||
'eet' => [ | ||
'celk_trzba' => 139950, | ||
'zakl_dan1' => 99165, | ||
'dan1' => 20825, | ||
'zakl_dan2' => 17357, | ||
'dan2' => 2604, | ||
'mena' => Currency::CZECH_CROWNS | ||
], | ||
'recurrence' => ['recurrence_cycle' => 'DAY', | ||
'recurrence_period' => '7', | ||
'recurrence_date_to' => '2015-12-31'], | ||
'additional_params' => [['name' => 'invoicenumber', | ||
'value' => '2015001003' | ||
]], | ||
'callback' => [ | ||
'return_url' => 'http=>//www.eshop.cz/return', | ||
'notification_url' => 'http=>//www.eshop.cz/notify' | ||
] | ||
]); | ||
|
||
$response = $gopay->createRecurrence(3000006620, [ | ||
'amount' => '500', | ||
'currency' => Currency::CZECH_CROWNS, | ||
'order_number' => 'Nakup', | ||
'order_description' => '2016-0001254', | ||
'items' => [ | ||
[ | ||
'type' => PaymentItemType::ITEM, | ||
'name' => 'lodicky', | ||
'product_url' => 'https://www.eshop.cz/boty//lodicky', | ||
'ean' => 1234567890123, | ||
'amount' => 119990, | ||
'count' => 1, | ||
'vat_rate' => VatRate::RATE_4 | ||
]], | ||
'eet' => [ | ||
'celk_trzba' => 119990, | ||
'zakl_dan1' => 99165, | ||
'dan1' => 20825, | ||
'mena' => Currency::CZECH_CROWNS | ||
], | ||
'additional_params' => [[ | ||
'name' => 'invoicenumber', | ||
'value' => '2016001004' | ||
]] | ||
]); |
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,10 @@ | ||
<?php | ||
|
||
namespace GoPay\Definition\Payment; | ||
|
||
class PaymentItemType | ||
{ | ||
const ITEM = 'ITEM'; | ||
const DISCOUNT = 'DISCOUNT'; | ||
const DELIVERY = 'DELIVERY'; | ||
} |
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,11 @@ | ||
<?php | ||
|
||
namespace GoPay\Definition\Payment; | ||
|
||
class VatRate | ||
{ | ||
const RATE_1 = 0; | ||
const RATE_2 = 10; | ||
const RATE_3 = 15; | ||
const RATE_4 = 21; | ||
} |
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