Skip to content

Commit

Permalink
Examples fix (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
krzGablo authored Apr 9, 2024
1 parent 444e7c2 commit efa9c09
Show file tree
Hide file tree
Showing 18 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion examples/BankSelection.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
include_once 'config.php';
include_once 'loader.php';

class BankSelectionExample extends PaymentBasicForms
final class BankSelectionExample extends PaymentBasicForms
{
public function __construct()
{
Expand Down
2 changes: 1 addition & 1 deletion examples/BankSelectionAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
include_once 'config.php';
include_once 'loader.php';

class BankSelectionAPIExample extends PaymentBasicForms
final class BankSelectionAPIExample extends PaymentBasicForms
{
public function __construct()
{
Expand Down
2 changes: 1 addition & 1 deletion examples/BasicPaymentForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
include_once 'config.php';
include_once 'loader.php';

class TpayBasicExample extends PaymentBasicForms
final class TpayBasicExample extends PaymentBasicForms
{
public function __construct()
{
Expand Down
2 changes: 1 addition & 1 deletion examples/BlikTransactionExample.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
include_once 'config.php';
include_once 'loader.php';

class BlikTransactionExample extends PaymentBlik
final class BlikTransactionExample extends PaymentBlik
{
public function __construct()
{
Expand Down
2 changes: 1 addition & 1 deletion examples/CardBasic.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
include_once 'config.php';
include_once 'loader.php';

class CardBasic extends PaymentCardForms
final class CardBasic extends PaymentCardForms
{
public function __construct()
{
Expand Down
2 changes: 1 addition & 1 deletion examples/CardGate.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
include_once 'config.php';
include_once 'loader.php';

class CardGate extends PaymentCardForms
final class CardGate extends PaymentCardForms
{
public function __construct()
{
Expand Down
4 changes: 2 additions & 2 deletions examples/CardGateExtended.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
include_once 'config.php';
include_once 'loader.php';

class CardGateExtended extends PaymentCardForms
final class CardGateExtended extends PaymentCardForms
{
const SUPPORTED_CARD_VENDORS = [
'visa',
Expand All @@ -32,7 +32,7 @@ public function init()
{
if (isset($_POST['carddata'])) {
$this->setPaymentParameters();
if (isset($_POST['card_vendor']) && in_array($_POST['card_vendor'], static::SUPPORTED_CARD_VENDORS)) {
if (isset($_POST['card_vendor']) && in_array($_POST['card_vendor'], self::SUPPORTED_CARD_VENDORS)) {
$this->saveUserCardVendor($_POST['card_vendor']);
}
// Try to sale with provided card data
Expand Down
2 changes: 1 addition & 1 deletion examples/CardNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
include_once 'config.php';
include_once 'loader.php';

class CardNotification extends CardNotificationHandler
final class CardNotification extends CardNotificationHandler
{
public function __construct()
{
Expand Down
8 changes: 4 additions & 4 deletions examples/CardPaymentLinkBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
include_once 'config.php';
include_once 'loader.php';

class CardPaymentLinkBuilder extends PaymentCardForms
final class CardPaymentLinkBuilder extends PaymentCardForms
{
const REQUIRED_FIELDS = [
'name',
Expand Down Expand Up @@ -63,16 +63,16 @@ public function init()

public function showBuilderForm()
{
$data['currencies'] = static::ALLOWED_CURRENCIES;
$data['languages'] = static::ALLOWED_LANGUAGES;
$data['currencies'] = self::ALLOWED_CURRENCIES;
$data['languages'] = self::ALLOWED_LANGUAGES;
$data['actionPath'] = '';
echo $this->getCardPaymentLinkBuilderForm($data);
}

public function getCardPaymentLink()
{
try {
foreach (static::REQUIRED_FIELDS as $fieldName) {
foreach (self::REQUIRED_FIELDS as $fieldName) {
if (!isset($_POST[$fieldName])) {
throw new TException(sprintf('Required field %s is missing', $fieldName));
}
Expand Down
2 changes: 1 addition & 1 deletion examples/CardRefundExample.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
include_once 'config.php';
include_once 'loader.php';

class CardRefundExample extends CardRefunds
final class CardRefundExample extends CardRefunds
{
public function __construct()
{
Expand Down
4 changes: 2 additions & 2 deletions examples/MassPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
include_once 'config.php';
include_once 'loader.php';

class MassPaymentExample extends MassPayments
final class MassPaymentExample extends MassPayments
{
const TRID = 'TR-C4Y-HJVWYX';

Expand Down Expand Up @@ -44,7 +44,7 @@ public function transferMassPayment()
* Masspayment transfer
*/
$packId = '123123';
$transactionId = static::TRID;
$transactionId = self::TRID;
try {
$result = $this->massPaymentTransfers($packId, $transactionId);
print_r($result);
Expand Down
2 changes: 1 addition & 1 deletion examples/RecurrentPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
include_once 'config.php';
include_once 'loader.php';

class RecurrentPayment extends PaymentCard
final class RecurrentPayment extends PaymentCard
{
private $transactionId;

Expand Down
2 changes: 1 addition & 1 deletion examples/SmsNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
include_once 'config.php';
include_once 'loader.php';

class SmsNotification extends PaymentSMS
final class SmsNotification extends PaymentSMS
{
public function __construct()
{
Expand Down
2 changes: 1 addition & 1 deletion examples/TransactionApiExample.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
include_once 'config.php';
include_once 'loader.php';

class TransactionApiExample extends TransactionApi
final class TransactionApiExample extends TransactionApi
{
private $trId;

Expand Down
2 changes: 1 addition & 1 deletion examples/TransactionNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
include_once 'config.php';
include_once 'loader.php';

class TransactionNotification extends BasicNotificationHandler
final class TransactionNotification extends BasicNotificationHandler
{
public function __construct()
{
Expand Down
6 changes: 3 additions & 3 deletions examples/TransactionRefund.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
include_once 'config.php';
include_once 'loader.php';

class TransactionRefund extends BasicRefunds
final class TransactionRefund extends BasicRefunds
{
const TRID = 'TR-C4Y-HKR3HX';

Expand All @@ -29,7 +29,7 @@ public function refundAnyTransaction()
$amount = 100.00;

try {
$this->transactionID = static::TRID;
$this->transactionID = self::TRID;
$result = $this->refundAny($amount);
print_r($result);
} catch (TException $e) {
Expand All @@ -41,7 +41,7 @@ public function refundTransaction()
{
// Refund transaction
try {
$this->transactionID = static::TRID;
$this->transactionID = self::TRID;
$result = $this->refund();
print_r($result);
} catch (TException $e) {
Expand Down
4 changes: 2 additions & 2 deletions examples/TransactionRefundStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
include_once 'config.php';
include_once 'loader.php';

class TransactionRefundStatus extends BasicReports
final class TransactionRefundStatus extends BasicReports
{
const TRID = 'TR-BRA-KGZK0X';

Expand All @@ -24,7 +24,7 @@ public function __construct()
public function getTransactionRefundsStatuses()
{
try {
$this->transactionID = static::TRID;
$this->transactionID = self::TRID;
$result = $this->transactionRefundStatus();
var_dump($result);
} catch (TException $e) {
Expand Down
2 changes: 1 addition & 1 deletion examples/TransactionReportsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
include_once 'config.php';
include_once 'loader.php';

class TransactionReportsApi extends BasicReports
final class TransactionReportsApi extends BasicReports
{
public function __construct()
{
Expand Down

0 comments on commit efa9c09

Please sign in to comment.