Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
widget
WooCommerce
Commits
0cf28e60
Commit
0cf28e60
authored
Nov 06, 2020
by
mr.amirka
Browse files
changed endpoints
parent
4fc5a653
Changes
1
Hide whitespace changes
Inline
Side-by-side
lunupayment-woocommerce/lunupayment-woocommerce.php
View file @
0cf28e60
...
...
@@ -10,16 +10,28 @@
*/
DEFINE
(
'LUNUPAYMENT_SERVER_NAME'
,
$_SERVER
[
'SERVER_NAME'
]);
DEFINE
(
'LUNUPAYMENT_VERSION_BETA'
,
'beta'
);
DEFINE
(
'LUNUPAYMENT_VERSION'
,
(
DEFINE
(
'LUNUPAYMENT_WIDGET_VERSION_SANDBOX'
,
'rc'
);
DEFINE
(
'LUNUPAYMENT_WIDGET_PROCESSING_SANDBOX'
,
'rc'
);
DEFINE
(
'LUNUPAYMENT_WIDGET_VERSION'
,
(
LUNUPAYMENT_SERVER_NAME
===
'shop.dev.lunu.io'
?
LUNUPAYMENT_VERSION_BETA
?
'beta'
:
(
LUNUPAYMENT_SERVER_NAME
===
'shop.rc.lunu.io'
?
'rc'
:
'alpha'
)
));
DEFINE
(
'LUNUPAYMENT_PROCESSING_VERSION'
,
(
LUNUPAYMENT_SERVER_NAME
===
'shop.dev.lunu.io'
?
'stage'
:
(
LUNUPAYMENT_SERVER_NAME
===
'shop.rc.lunu.io'
?
'rc'
:
'alpha'
)
));
DEFINE
(
'LUNUPAYMENT_CALLBACK_ENDPOINT'
,
'https://'
.
LUNUPAYMENT_SERVER_NAME
.
'/wp-json/lunu/payment/v1/notify'
);
...
...
@@ -194,7 +206,7 @@ if (
'release'
=>
array
(
'title'
=>
__
(
'Release(checked)/Debug'
,
LUNUPAYMENTWC
),
'type'
=>
'checkbox'
,
'default'
=>
(
LUNUPAYMENT_VERSION
==
'beta'
?
'no'
:
'yes'
)
,
'default'
=>
'yes'
,
),
'app_id'
=>
array
(
'title'
=>
__
(
'App ID'
,
LUNUPAYMENTWC
),
...
...
@@ -326,8 +338,8 @@ if (
'app_id'
=>
$app_id
,
'api_secret'
=>
$api_secret
,
'version'
=>
$this
->
release
===
'no'
?
LUNUPAYMENT_VERSION_
BETA
:
LUNUPAYMENT_VERSION
?
LUNUPAYMENT_
PROCESSING_
VERSION_
SANDBOX
:
LUNUPAYMENT_
PROCESSING_
VERSION
);
$payment
=
array
(
'id'
=>
$order_id
,
...
...
@@ -356,9 +368,9 @@ if (
update_post_meta
(
$order_id
,
'_lunupayment_status'
,
$payment_status
);
}
$
WIDGET_VERSION
=
$this
->
release
===
'no'
?
LUNUPAYMENT_VERSION_
BETA
:
LUNUPAYMENT_VERSION
;
$
widget_version
=
$this
->
release
===
'no'
?
LUNUPAYMENT_
WIDGET_
VERSION_
SANDBOX
:
LUNUPAYMENT_
WIDGET_
VERSION
;
$payment_status
=
strtolower
(
$payment_status
);
...
...
@@ -377,7 +389,7 @@ if (
s.type = 'text/javascript';
s.charset = 'utf-8';
s.async = true;
s.src = 'https://plugins.lunu.io/packages/widget-ui/"
.
$
WIDGET_VERSION
.
".js?t=' + 1 * new Date();
s.src = 'https://plugins.lunu.io/packages/widget-ui/"
.
$
widget_version
.
".js?t=' + 1 * new Date();
s.onload = function() {
new window.Lunu.widgets.Payment(
d.getElementById('payment-form'),
...
...
@@ -467,8 +479,8 @@ if (
'app_id'
=>
$this
->
app_id
,
'api_secret'
=>
$this
->
api_secret
,
'version'
=>
$this
->
release
===
'no'
?
LUNUPAYMENT_VERSION_
BETA
:
LUNUPAYMENT_VERSION
?
LUNUPAYMENT_
PROCESSING_
VERSION_
SANDBOX
:
LUNUPAYMENT_
PROCESSING_
VERSION
),
$payment_id
);
$currency
=
true
===
version_compare
(
WOOCOMMERCE_VERSION
,
'3.0'
,
'<'
)
...
...
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