Skip to content

Commit

Permalink
Merge pull request #36 from OXID-eSales/STRIP-47-customer-email-overr…
Browse files Browse the repository at this point in the history
…ide-on-off-setting

Setting to override Stripe Customer email with shop customer address
  • Loading branch information
mariolorenz authored Nov 28, 2024
2 parents 47f0a2b + 8602821 commit cc09bc7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Application/Model/Request/PaymentIntent.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

namespace OxidSolutionCatalysts\Stripe\Application\Model\Request;

use OxidEsales\EshopCommunity\Core\Registry;
use OxidSolutionCatalysts\Stripe\Application\Helper\Order as OrderHelper;
use OxidSolutionCatalysts\Stripe\Application\Helper\Payment as PaymentHelper;
use OxidSolutionCatalysts\Stripe\Application\Helper\User as UserHelper;
Expand Down Expand Up @@ -48,7 +49,10 @@ public function addRequestParameters(CoreOrder $oOrder, $dAmount, $sReturnUrl, $
$this->addParameter('customer', $sStripeCustomerId);
}

$this->addParameter('receipt_email', $this->getCustomerEmail($oCoreUser));
//task STRIP-47, overriding customer email only if module setting is enabled
if (Registry::getConfig()->getShopConfVar('blStripeProvideCustomerEmailAddress')) {
$this->addParameter('receipt_email', $this->getCustomerEmail($oCoreUser));
}

if ($oPaymentModel->isRedirectUrlNeeded($oOrder) === true) {
$this->addParameter('return_url', $sReturnUrl);
Expand Down
2 changes: 2 additions & 0 deletions Application/views/admin/de/stripe_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
'SHOP_MODULE_sStripeCronSecureKey' => 'Cronjob Sicherheits-Schlüssel',
'SHOP_MODULE_GROUP_STRIPE_WEBHOOKS' => 'Webhooks',
'SHOP_MODULE_sStripeWebhookEndpoint' => 'Webhook Endpoint',
'SHOP_MODULE_blStripeProvideCustomerEmailAddress' => 'Kunden-E-Mail-Adresse an Stripe senden',

'HELP_SHOP_MODULE_sStripeTestKey' => 'Geben Sie Ihren persönlichen privaten TEST-API-Schlüssel ein, der zum Einrichten des Webhook-Endpunkts verwendet wird.',
'HELP_SHOP_MODULE_sStripeLiveKey' => 'Geben Sie Ihren persönlichen privaten LIVE-API-Schlüssel ein, der zum Einrichten des Webhook-Endpunkts verwendet wird.',
Expand All @@ -52,6 +53,7 @@
'HELP_SHOP_MODULE_sStripeCronSecondChanceActive' => 'Damit dieser Cronjob arbeitet, müssen Sie zusätzlich zu dieser Checkbox noch sicherstellen dass der Stripe Cronjob eingerichtet ist. Mehr dazu erfahren Sie in der README.md Datei des Moduls.',
'HELP_SHOP_MODULE_sStripeCronOrderShipmentActive' => 'Dieser Cronjob ist nur notwendig, wenn der Versandstatus in Ihrem Shop über ein externes System gesetzt wird und NICHT über den "Jetzt versenden" Button im Oxid-Admin. Damit dieser Cronjob arbeitet, müssen Sie zusätzlich zu dieser Checkbox noch sicherstellen dass der Stripe Cronjob eingerichtet ist. Mehr dazu erfahren Sie in der README.md Datei des Moduls.',
'HELP_SHOP_MODULE_sStripeCronSecureKey' => 'Diese Option benötigen Sie nur, wenn Sie den Cronjob per URL aufrufen müssen anstelle von dem Aufruf über die php cli. Konfigurieren Sie hier einen Sicherheitsschlüssel, den Sie über den GET-Parameter "secureKey" an den Aufruf des Cronjobs anfügen. Bsp.: https://YOUR-SHOP-URL-HERE/modules/fc/stripe/cron.php?secureKey=YOUR-SECURE-KEY',
'HELP_SHOP_MODULE_blStripeProvideCustomerEmailAddress' => 'Ist diese Option aktiviert so, wird bei einer Stripe-Bestellung die Kunden-EMailadresse ebenfalls übergeben. Das überschreibt die Standard-E-Mail-Einstellungen im Stripe-Account für diese Bestellung. Somit werden die Benachrichtigungen zu dieser Bestellung an die Kunden-EMail-Adresse gesendet, statt an die Stripe-Account-EMail-Adresse.',

'STRIPE_YES' => 'Ja',
'STRIPE_NO' => 'Nein',
Expand Down
2 changes: 2 additions & 0 deletions Application/views/admin/en/stripe_lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
'SHOP_MODULE_sStripeCronSecureKey' => 'Cronjob secure key',
'SHOP_MODULE_GROUP_STRIPE_WEBHOOKS' => 'Webhooks',
'SHOP_MODULE_sStripeWebhookEndpoint' => 'Webhook Endpoint',
'SHOP_MODULE_blStripeProvideCustomerEmailAddress' => 'Send customer email address to Stripe',

'HELP_SHOP_MODULE_sStripeTestKey' => 'Fill in your personal TEST private API key that will be used to set up the webhook endpoint.',
'HELP_SHOP_MODULE_sStripeLiveKey' => 'Fill in your personal LIVE private API key that will be used to set up the webhook endpoint.',
Expand All @@ -52,6 +53,7 @@
'HELP_SHOP_MODULE_sStripeCronSecondChanceActive' => 'For this cronjob to work, in addition to this checkbox you have to ensure that the Stripe cronjob is set up properly. You can find information on how to set up the cronjob in the README.md of this module.',
'HELP_SHOP_MODULE_sStripeCronOrderShipmentActive' => 'This cronjob is only needed if the shipping status in your shop is set by an external service and NOT by the "Ship Now" button. For this cronjob to work, in addition to this checkbox you have to ensure that the Stripe cronjob is set up properly. You can find information on how to set up the cronjob in the README.md of this module.',
'HELP_SHOP_MODULE_sStripeCronSecureKey' => 'This option is only needed if you have to call the cronjob via URL instead of the php cli. Configure your secure key here, which you have to add to the cronjob call as the GET parameter "secureKey". Example: https://YOUR-SHOP-URL-HERE/modules/fc/stripe/cron.php?secureKey=YOUR-SECURE-KEY',
'HELP_SHOP_MODULE_blStripeProvideCustomerEmailAddress' => 'If this option is activated, the customer email address will also be passed on for a Stripe order. This overwrites the standard email settings in the Stripe account for this order. This means that notifications for this order are sent to the customer email address instead of to the Stripe account email address.',

'STRIPE_YES' => 'Yes',
'STRIPE_NO' => 'No',
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Fixed

- [0007731](https://bugs.oxid-esales.com/view.php?id=7731): More Errorcodes
- Submitting the customer email address is optional

## [1.0.6] - 2024-11-15

Expand Down
3 changes: 2 additions & 1 deletion metadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
'en' => 'This module integrates STRIPE as payment provider in your OXID Shop.',
],
'thumbnail' => 'stripe_logo.png',
'version' => '1.0.7-rc2',
'version' => '1.0.7-rc3',
'author' => 'OXID eSales AG',
'url' => 'https://www.oxid-esales.com',
'email' => '[email protected]',
Expand Down Expand Up @@ -118,6 +118,7 @@
['group' => 'STRIPE_GENERAL', 'name' => 'blStripeLogTransactionInfo', 'type' => 'bool', 'value' => '1', 'position' => 34],
['group' => 'STRIPE_GENERAL', 'name' => 'blStripeRemoveByBillingCountry', 'type' => 'bool', 'value' => '1', 'position' => 35],
['group' => 'STRIPE_GENERAL', 'name' => 'blStripeRemoveByBasketCurrency', 'type' => 'bool', 'value' => '1', 'position' => 36],
['group' => 'STRIPE_GENERAL', 'name' => 'blStripeProvideCustomerEmailAddress','type' => 'bool', 'value' => '0', 'position' => 37],
['group' => 'STRIPE_STATUS_MAPPING', 'name' => 'sStripeStatusPending', 'type' => 'select', 'value' => '', 'position' => 50],
['group' => 'STRIPE_STATUS_MAPPING', 'name' => 'sStripeStatusProcessing', 'type' => 'select', 'value' => '', 'position' => 60],
['group' => 'STRIPE_STATUS_MAPPING', 'name' => 'sStripeStatusCancelled', 'type' => 'select', 'value' => '', 'position' => 70],
Expand Down

0 comments on commit cc09bc7

Please sign in to comment.