Skip to content

Commit 96fcfbb

Browse files
Use merchant email for notification for subscription follow-up orders (#104)
1 parent a964555 commit 96fcfbb

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,17 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
89
## [1.15.2]
910

1011
### Fixed
1112

1213
- Same order transaction_id before and after complete
14+
- Subscription transaction created with incorect payer email
15+
16+
### Added
17+
18+
- Exclusion of processing notifications for transaction made in `test_mode`
1319

1420
## [1.15.1]
1521

includes/TpaySF.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ public function scheduled_subscription_payment($chargeAmount, $order)
6868
$use_card = $card;
6969
}
7070

71+
$merchant_email = get_option('admin_email');
72+
73+
if (tpayOption('global_merchant_email')) {
74+
$merchant_email = tpayOption('global_merchant_email');
75+
}
76+
7177
$payer_data = $this->gateway_helper->payer_data($order, tpayOption('global_tax_id_meta_field_name'));
7278
$payment_data = [
7379
'description' => __('Order', 'tpay').' #'.$order->get_id(),
@@ -83,7 +89,7 @@ public function scheduled_subscription_payment($chargeAmount, $order)
8389
],
8490
'notification' => [
8591
'url' => add_query_arg('wc-api', $this->gateway_data('api'), home_url('/')),
86-
'email' => $payer_data['email'],
92+
'email' => $merchant_email,
8793
],
8894
],
8995
];

0 commit comments

Comments
 (0)