Skip to content

Commit

Permalink
Merge branch 'hotfix' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jimyhuang committed Apr 8, 2024
2 parents 1e15c58 + fd9725b commit 0b46390
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 13 deletions.
3 changes: 1 addition & 2 deletions CRM/Core/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,7 @@ static function getInfo() {
$block[$id] = array(
'info' => $value['info'],
'cache' => $value['cache'],
'status' => $value['active'],
'region' => $value['region'],
'region' => !empty($value['region']) ? $value['region'] : NULL,
'visibility' => $value['visibility'],
'pages' => $value['pages'],
'status' => $value['status'],
Expand Down
20 changes: 18 additions & 2 deletions CRM/Core/Payment/BaseIPN.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,15 @@ function completeTransaction(&$input, &$ids, &$objects, &$transaction, $recur =
$contribution->source = !empty($contribution->source) ? $contribution->source : $values['title'];

if ($values['is_email_receipt'] || $values['is_send_sms']) {
$contribution->receipt_date = self::$_now;
// only override receipt_date when necessary
if (empty($contribution->receipt_date)) {
$contribution->receipt_date = self::$_now;
}
else {
if (is_string($contribution->receipt_date) && strtotime($contribution->receipt_date) <= 10000) {
$contribution->receipt_date = self::$_now;
}
}
}

if ($membership) {
Expand Down Expand Up @@ -540,7 +548,15 @@ function completeTransaction(&$input, &$ids, &$objects, &$transaction, $recur =
$contribution->source = !empty($contribution->source) ? $contribution->source : ts('Online Event Registration') . ':' . $values['event']['title'];

if ($values['event']['is_email_confirm']) {
$contribution->receipt_date = self::$_now;
// only override receipt_date when necessary
if (empty($contribution->receipt_date)) {
$contribution->receipt_date = self::$_now;
}
else {
if (is_string($contribution->receipt_date) && strtotime($contribution->receipt_date) <= 10000) {
$contribution->receipt_date = self::$_now;
}
}
}

$participant->status_id = 1;
Expand Down
23 changes: 16 additions & 7 deletions CRM/Core/Payment/LinePay.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,13 @@ function doRequest(&$params){
static function confirm($url_params, $get = array()){
if(empty($get)){
foreach ($_GET as $key => $value) {
if($key == 'q')continue;
if ($key == 'q') continue;
if ($key == 'qfKey') {
$value = CRM_Utils_Type::escape($value, 'String', FALSE);
}
else {
$value = CRM_Utils_Type::escape($value, 'Integer', FALSE);
}
$params[$key] = $value;
}
}
Expand All @@ -147,6 +153,7 @@ function doConfirm($params){
$result = $this->_linePayAPI->request($requestParams);

// Timeout condition.
$triedTimes = 0;
while (!empty($this->_linePayAPI->_curlError[28]) && $triedTimes < 2) {
sleep(10);
$paymentProcessorId = $this->_paymentProcessId;
Expand All @@ -155,8 +162,8 @@ function doConfirm($params){
'transactionId' => $params['transactionId'],
'orderId' => $params['cid'],
);
$result = $this->_linePayAPI->request($params);
$triedTimes += 1;
$this->_linePayAPI->request($params);
$triedTimes++;
}
$is_success = $this->_linePayAPI->_success;
$thankYouPath = 'civicrm/contribute/transact';
Expand All @@ -183,12 +190,13 @@ function doConfirm($params){
$transaction = new CRM_Core_Transaction();
if($is_success){
$input['payment_instrument_id'] = $contribution->payment_instrument_id;
$input['amount'] = $contribution->amount;
$input['amount'] = $contribution->total_amount;
$objects['contribution']->receive_date = date('YmdHis');
$transaction_result = $ipn->completeTransaction($input, $ids, $objects, $transaction);
$thankyou_url = self::prepareThankYouUrl($thankYouPath, $params['qfKey']);
}
else{
$error = '';
$ipn->failed($objects, $transaction, $error);
$this->addResponseMessageToNote($contribution);
$thankyou_url = self::prepareThankYouUrl($thankYouPath, $params['qfKey'], True);
Expand Down Expand Up @@ -236,7 +244,7 @@ static function query($url_params, $get = array()){
}

// record original cancel_date, status_id data.
$origin_cancel_date = $contribution->cancel_date;
$origin_cancel_date = (string) $contribution->cancel_date;
$origin_cancel_date = date('YmdHis', strtotime($origin_cancel_date));
$origin_status_id = $contribution->contribution_status_id;

Expand Down Expand Up @@ -275,7 +283,7 @@ static function query($url_params, $get = array()){

$query = http_build_query($get);
$redirect = CRM_Utils_System::url('civicrm/contact/view/contribution', $query);
return CRM_Core_Error::statusBounce($result_note, $redirect);
return CRM_Core_Error::statusBounce($result_note, $redirect);
}else{
CRM_Core_Error::fatal(ts('Wrong contribution ID in url query'));
}
Expand All @@ -286,8 +294,9 @@ private function addResponseMessageToNote($contribution){
$contribution = self::prepareContribution($contribution);
}
$errorMessage = CRM_Core_Payment_LinePayAPI::errorMessage($this->_linePayAPI->_response->returnCode);
$note = '';
$note .= "Error, return code is ".$this->_linePayAPI->_response->returnCode.": ".$errorMessage;
CRM_Core_Payment_Mobile::addNote($note, $contribution);
CRM_Core_Payment_Mobile::addNote($note, $contribution);
}

private static function prepareContribution($contributionId){
Expand Down
1 change: 1 addition & 0 deletions css/civicrm.css
Original file line number Diff line number Diff line change
Expand Up @@ -5557,6 +5557,7 @@ ul.ui-sortable {
#activity-content td {
padding: 4px;
vertical-align: top;
height: auto;
}

.crm-container tr.even-row td,
Expand Down
3 changes: 3 additions & 0 deletions l10n/pot/civicrm.pot
Original file line number Diff line number Diff line change
Expand Up @@ -49440,4 +49440,7 @@ msgid "Notice: If you are already logged in, clicking the above link will take y
msgstr ""

msgid "While general users who have not logged in, clicking the link will simply take them to the completed personal fundraising page where they can proceed to fill out the donation form as usual."
msgstr ""

msgid "To enable 3D Secure, you must add a TapPay Merchant ID and Partner Key that supports this feature. If you need 3D Secure, please contact customer service."
msgstr ""
Binary file modified l10n/zh_TW/LC_MESSAGES/civicrm.mo
Binary file not shown.
8 changes: 7 additions & 1 deletion l10n/zh_TW/civicrm.po
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ msgid ""
msgstr ""
"Project-Id-Version: netiCRM\n"
"PO-Revision-Date: 2013-07-25 09:19+0000\n"
"Last-Translator: jimyhuang <jimmy@netivism.com.tw>, 2013,2015-2024\n"
"Last-Translator: Chang Shu-huai <junsuwhy@gmail.com>, 2016-2024\n"
"Language-Team: Chinese (Taiwan) (http://app.transifex.com/netivism-tw/neticrm/language/zh_TW/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
Expand Down Expand Up @@ -49985,3 +49985,9 @@ msgid ""
"take them to the completed personal fundraising page where they can proceed "
"to fill out the donation form as usual."
msgstr "若是一般未登入的使用者,點入連結後,會正常前往已公開的個人募款頁、可直接進行填表捐款。"

msgid ""
"To enable 3D Secure, you must add a TapPay Merchant ID and Partner Key that"
" supports this feature. If you need 3D Secure, please contact customer "
"service."
msgstr "若要啟用 3D 驗證,必須新增有支援此功能的 TapPay 商店 Merchant ID 與帳號金鑰,若需要 3D 驗證請洽客服。"
41 changes: 40 additions & 1 deletion packages/mailingEditor/mailingEditor.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,40 @@ img {
position: relative;
}

a.btn:hover {
.btn,
.button,
.form-submit,
a.btn,
a.button,
input.form-submit {
display: inline-block;
margin: .5em 1em .5em 0;
padding: 6px 10px;
text-decoration: none;
font-size: .9375rem;
line-height: 1.2;
color: #fff;
cursor: pointer;
border: none;
border-radius: 0;
background-color: #333;
transition: border .2s linear, color .2s linear, background-color .2s linear;
-webkit-font-smoothing: subpixel-antialiased;
}
.btn:hover,
.btn:focus,
.button:hover,
.button:focus,
.form-submit:hover,
.form-submit:focus {
text-decoration: none;
color: #fff;
background-color: #555;
}
.btn:active,
.button:active,
.form-submit:active {
background-color: #111;
}

.online-template-link { display: none; }
Expand Down Expand Up @@ -776,6 +808,13 @@ ul.nme-setting-panels-tabs li a.is-active {
.nme-container table[width="100%"] {
width: 100%;
}
.nme-container tr,
.nme-container tr:hover {
background: none;
}
.nme-container td {
height: auto;
}
.nme-mail-container {
max-width: 680px;
border-collapse: collapse;
Expand Down

0 comments on commit 0b46390

Please sign in to comment.