class PaymentService implements PaymentServiceInterface

PaymentService class

Properties

private ConfigServiceInterface $configService Stores ConfigServiceInterface
private EntityManagerInterface $em Stores EntityManagerInterface
private Request $request Stores current Request
private PaymentEmailInterface $paymentEmail Stores PaymentEmailInterface
private PaymentFormFactoryInterface $paymentFormFactory Stores PaymentFormFactoryInterface
private PaymentStripeInterface $paymentStripe Stores PaymentStripeInterface
private ServiceToolsInterface $serviceTools Stores ServiceToolsInterface

Methods

__construct(ConfigServiceInterface $configService, EntityManagerInterface $em, RequestStack $requestStack, PaymentEmailInterface $paymentEmail, PaymentFormFactoryInterface $paymentFormFactory, PaymentStripeInterface $paymentStripe, ServiceToolsInterface $serviceTools)

No description

string|false
charge(string $service, Payment $paymentSession)

Charges the payment server

create(array $paymentData)

Creates the payment

Form
createForm(string $name, Payment $payment)

Shortcut to call PaymentFormFactory to create Form

createFreeAmount(Payment $payment)

Creates the payment for a free amount

createDefinedAmount($user, string $text, int $amount, string $currency)

Creates the payment for a defined amount

array
defineFreeAmount($user)

Defines the data to use for a free amount Payment

error(Payment $payment)

An error has occured after the Payment (Sends email to site + flash)

mixed
getAll()

Gets all the Payment

Payment|null
getFromSession(string $kind)

Gets the Payment from session

mixed
getParameter(string $parameter)

Returns the value of parameter

register(Payment $payment)

Registers the Payment in DB + Session

array|null
setDataFromSession(string $kind)

Defines PaymentData from session

Details

at line 71
__construct(ConfigServiceInterface $configService, EntityManagerInterface $em, RequestStack $requestStack, PaymentEmailInterface $paymentEmail, PaymentFormFactoryInterface $paymentFormFactory, PaymentStripeInterface $paymentStripe, ServiceToolsInterface $serviceTools)

Parameters

ConfigServiceInterface $configService
EntityManagerInterface $em
RequestStack $requestStack
PaymentEmailInterface $paymentEmail
PaymentFormFactoryInterface $paymentFormFactory
PaymentStripeInterface $paymentStripe
ServiceToolsInterface $serviceTools

at line 93
string|false charge(string $service, Payment $paymentSession)

Charges the payment server

Parameters

string $service
Payment $paymentSession

Return Value

string|false

at line 154
create(array $paymentData)

Creates the payment

Parameters

array $paymentData

at line 174
Form createForm(string $name, Payment $payment)

Shortcut to call PaymentFormFactory to create Form

Parameters

string $name
Payment $payment

Return Value

Form

at line 182
createFreeAmount(Payment $payment)

Creates the payment for a free amount

Parameters

Payment $payment

at line 192
createDefinedAmount($user, string $text, int $amount, string $currency)

Creates the payment for a defined amount

Parameters

$user
string $text
int $amount
string $currency

at line 210
array defineFreeAmount($user)

Defines the data to use for a free amount Payment

Parameters

$user

Return Value

array

at line 227
error(Payment $payment)

An error has occured after the Payment (Sends email to site + flash)

Parameters

Payment $payment

at line 239
mixed getAll()

Gets all the Payment

Return Value

mixed

at line 250
Payment|null getFromSession(string $kind)

Gets the Payment from session

Parameters

string $kind

Return Value

Payment|null

at line 258
mixed getParameter(string $parameter)

Returns the value of parameter

Parameters

string $parameter

Return Value

mixed

Exceptions

LogicException

at line 266
register(Payment $payment)

Registers the Payment in DB + Session

Parameters

Payment $payment

at line 279
array|null setDataFromSession(string $kind)

Defines PaymentData from session

Parameters

string $kind

Return Value

array|null