Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
C
commerce_winbank_redirect
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
commerce_winbank_redirect
Commits
8da8824e
Commit
8da8824e
authored
Apr 11, 2019
by
GiorgosK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add auto redirect option on settings page
parent
5715320a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
0 deletions
+16
-0
config/schema/commerce_winbank.schema.yml
config/schema/commerce_winbank.schema.yml
+3
-0
src/Plugin/Commerce/PaymentGateway/WinbankPaymentRedirect.php
...Plugin/Commerce/PaymentGateway/WinbankPaymentRedirect.php
+10
-0
src/PluginForm/OffsiteRedirect/WinbankPaymentRedirectForm.php
...PluginForm/OffsiteRedirect/WinbankPaymentRedirectForm.php
+3
-0
No files found.
config/schema/commerce_winbank.schema.yml
View file @
8da8824e
...
...
@@ -40,6 +40,9 @@ commerce_payment.commerce_payment_gateway.plugin.winbankpayment_redirect:
request_type
:
type
:
string
label
:
'
RequestType'
auto_redirect
:
type
:
boolean
label
:
'
Auto
Redirect'
...
...
src/Plugin/Commerce/PaymentGateway/WinbankPaymentRedirect.php
View file @
8da8824e
...
...
@@ -46,6 +46,7 @@ class WinbankPaymentRedirect extends OffsitePaymentGatewayBase {
'request_type'
=>
'02'
,
'currency_code'
=>
'978'
,
'language_code'
=>
'en-US'
,
'auto_redirect'
=>
1
,
]
+
parent
::
defaultConfiguration
();
}
...
...
@@ -159,6 +160,14 @@ class WinbankPaymentRedirect extends OffsitePaymentGatewayBase {
'#default_value'
=>
$this
->
configuration
[
'language_code'
],
];
$form
[
'auto_redirect'
]
=
[
'#type'
=>
'checkbox'
,
'#required'
=>
FALSE
,
'#title'
=>
$this
->
t
(
'Auto Redirect'
),
'#description'
=>
$this
->
t
(
'Should the user be automatically redirected to bank ?'
),
'#default_value'
=>
$this
->
configuration
[
'auto_redirect'
],
];
return
$form
;
}
...
...
@@ -182,6 +191,7 @@ class WinbankPaymentRedirect extends OffsitePaymentGatewayBase {
$this
->
configuration
[
'currency_code'
]
=
$values
[
'currency_code'
];
$this
->
configuration
[
'language_code'
]
=
$values
[
'language_code'
];
$this
->
configuration
[
'request_type'
]
=
$values
[
'request_type'
];
$this
->
configuration
[
'auto_redirect'
]
=
$values
[
'auto_redirect'
];
}
}
...
...
src/PluginForm/OffsiteRedirect/WinbankPaymentRedirectForm.php
View file @
8da8824e
...
...
@@ -71,6 +71,9 @@ class WinbankPaymentRedirectForm extends BasePaymentOffsiteForm {
];
$form
=
$this
->
buildRedirectForm
(
$form
,
$form_state
,
$config
[
'paycenter_url'
],
$data
,
'post'
);
if
(
$config
[
'auto_redirect'
]){
unset
(
$form
[
'#attached'
][
'library'
]);
}
return
$form
;
}
...
...
Write
Preview
Markdown
is supported
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