Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Extensions
Redsys Payment Processor
Commits
91897482
Commit
91897482
authored
May 09, 2022
by
rubofvil
Committed by
sluc23
May 09, 2022
Browse files
2.x dev webform civicrm drupal 9
parent
ccf94776
Changes
2
Hide whitespace changes
Inline
Side-by-side
CRM/Core/Payment/Redsys.php
View file @
91897482
<?php
use
CRM_Redsys_ExtensionUtil
as
E
;
require_once
'includes/apiRedsys.php'
;
...
...
@@ -24,7 +25,7 @@ class CRM_Core_Payment_Redsys extends CRM_Core_Payment {
static
private
$_singleton
=
NULL
;
/**
*
m
ode of operation: live or test
*
M
ode of operation: live or test
.
*
* @var object
*/
...
...
@@ -42,10 +43,12 @@ class CRM_Core_Payment_Redsys extends CRM_Core_Payment {
public
$_processorName
=
NULL
;
/**
* Constructor
* Constructor
.
*
* @param string $mode the mode of operation: live or test
* @param int $paymentProcessor paymentProcessor id
* @param string $mode
* the mode of operation: live or test.
* @param int $paymentProcessor
* paymentProcessor id.
*
* @return void
*/
...
...
@@ -56,14 +59,16 @@ class CRM_Core_Payment_Redsys extends CRM_Core_Payment {
}
/**
* Singleton function used to manage this object
* Singleton function used to manage this object
.
*
* @param string $mode the mode of operation: live or test
* @param int $paymentProcessor paymentProcessor id
* @param string $mode
* the mode of operation: live or test.
* @param int $paymentProcessor
* paymentProcessor id.
*
* @return object
* @static
*
* @static
*/
public
static
function
&
singleton
(
$mode
,
&
$paymentProcessor
)
{
$processorName
=
$paymentProcessor
[
"name"
];
...
...
@@ -74,13 +79,13 @@ class CRM_Core_Payment_Redsys extends CRM_Core_Payment {
}
/**
* This function checks to see if we have the right config values
* This function checks to see if we have the right config values
.
*
* @return string the error message if any
*
* @public
*/
public
function
checkConfig
()
{
$config
=
CRM_Core_Config
::
singleton
();
$error
=
[];
if
(
empty
(
$this
->
_paymentProcessor
[
"user_name"
]))
{
...
...
@@ -102,7 +107,7 @@ class CRM_Core_Payment_Redsys extends CRM_Core_Payment {
* This function is not implemented, as long as this payment
* procesor is notify mode only.
*
* @param
type
$params
* @param
mixed
$params
*/
public
function
doDirectPayment
(
&
$params
)
{
CRM_Core_Error
::
fatal
(
E
::
ts
(
"This function is not implemented"
));
...
...
@@ -114,17 +119,22 @@ class CRM_Core_Payment_Redsys extends CRM_Core_Payment {
*/
public
function
doTransferCheckout
(
&
$params
,
$component
=
'contribute'
)
{
$config
=
CRM_Core_Config
::
singleton
();
if
(
$component
!=
'contribute'
&&
$component
!=
'event'
)
{
CRM_Core_Error
::
fatal
(
E
::
ts
(
'Component is invalid'
));
}
if
(
array_key_exists
(
'webform_redirect_success'
,
$params
))
{
$returnURL
=
$params
[
'webform_redirect_success'
];
$cancelURL
=
$params
[
'webform_redirect_cancel'
];
$returnURL
=
$this
->
successUrl
??
$params
[
'webform_redirect_success'
];
$cancelURL
=
$this
->
cancelUrl
??
$params
[
'webform_redirect_cancel'
];
// Drupal Webform CiviCRM workflow.
if
(
$returnURL
&&
$cancelURL
)
{
// Avoid issues with relative paths.
$config
=
CRM_Core_Config
::
singleton
();
$returnURL
=
(
strpos
(
$returnURL
,
'/'
)
===
0
)
?
$config
->
userFrameworkBaseURL
.
$returnURL
:
$returnURL
;
$cancelURL
=
(
strpos
(
$cancelURL
,
'/'
)
===
0
)
?
$config
->
userFrameworkBaseURL
.
$cancelURL
:
$cancelURL
;
}
else
{
// CiviCRM Core Workflow, Contribution Pages / Events
elseif
(
!
$returnURL
&&
!
$cancelURL
)
{
$url
=
(
$component
==
'event'
)
?
'civicrm/event/register'
:
'civicrm/contribute/transact'
;
$cancel
=
(
$component
==
'event'
)
?
'_qf_Register_display'
:
'_qf_Main_display'
;
$returnURL
=
CRM_Utils_System
::
url
(
$url
,
...
...
@@ -143,6 +153,9 @@ class CRM_Core_Payment_Redsys extends CRM_Core_Payment {
TRUE
,
NULL
,
FALSE
);
}
else
{
throw
new
CRM_Core_Exception
(
E
::
ts
(
"Redsys payment processor - Missing vars to launch full process of redirects."
));
}
$merchantUrlParams
=
"contactID=
{
$params
[
'contactID'
]
}
&contributionID=
{
$params
[
'contributionID'
]
}
"
;
if
(
$component
==
'event'
)
{
...
...
info.xml
View file @
91897482
...
...
@@ -14,8 +14,8 @@
<author>
iXiam Global Solutions
</author>
<email>
info@ixiam.com
</email>
</maintainer>
<releaseDate>
202
1-10-14
</releaseDate>
<version>
2.4.
1
</version>
<releaseDate>
202
2-05-09
</releaseDate>
<version>
2.4.
2
</version>
<develStage>
stable
</develStage>
<compatibility>
<ver>
5.35
</ver>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment