Version 5.0.0 beta 9
This commit is contained in:
1 parent
214f649f1d
commit
56979f8ee8
202 files changed
+4403
-1123
No files matched your search
@@ -53,6 +53,11 @@ class BusinessAddress extends Address
|
||||
'requireFullAddress' => TRUE,
|
||||
'vat' => FALSE
|
||||
);
|
||||
|
||||
/**
|
||||
* @brief Country codes that require a business name
|
||||
*/
|
||||
protected static array $vatCountries = array( 'AT','BE','BG','HR','CY','CZ','DK','EE','FI','FR','DE','GR','HU','IE','IT','LV','LT','LU','MT','NL','PL','PT','RO','SK','SI','ES','SE','GB','GP','MQ','RE','BL','GF','MF','NC','PF','PM','TF','YT','WF' );
|
||||
|
||||
/**
|
||||
* Get HTML
|
||||
@@ -101,7 +106,7 @@ class BusinessAddress extends Address
|
||||
{
|
||||
$value->business = Request::i()->$name['business'];
|
||||
|
||||
if ( $this->options['vat'] and in_array( $value->country, array('AT','BE','BG','HR','CY','CZ','DK','EE','FI','FR','DE','GR','HU','IE','IT','LV','LT','LU','MT','NL','PL','PT','RO','SK','SI','ES','SE','GB') ) and Request::i()->$name['vat'] )
|
||||
if ( $this->options['vat'] and in_array( $value->country, static::$vatCountries ) and Request::i()->$name['vat'] )
|
||||
{
|
||||
$value->vat = Request::i()->$name['vat'];
|
||||
}
|
||||
@@ -133,7 +138,7 @@ class BusinessAddress extends Address
|
||||
|
||||
if( $this->value )
|
||||
{
|
||||
if ( $this->value->business === '' )
|
||||
if ( $this->options['vat'] and in_array( $this->value->country, static::$vatCountries ) and $this->value->business === '' )
|
||||
{
|
||||
throw new DomainException('cm_business_name_required');
|
||||
}
|
||||
|
||||
@@ -1092,7 +1092,9 @@ class Stripe extends Gateway
|
||||
|
||||
$form->addHeader('stripe_webhook');
|
||||
$form->addMessage('stripe_webhook_blurb');
|
||||
Member::loggedIn()->language()->words["stripe_webhook_blurb"] = sprintf( Member::loggedIn()->language()->get('stripe_webhook_blurb'), (string) Url::internal( 'applications/nexus/interface/gateways/stripe.php', 'interface' ) );
|
||||
Member::loggedIn()->language()->words["stripe_webhook_blurb"] = sprintf( Member::loggedIn()->language()->get('stripe_webhook_blurb'),
|
||||
(string) Url::internal( 'applications/nexus/interface/gateways/stripe.php', 'interface' ),
|
||||
Member::loggedIn()->language()->formatList( $this->webhookEvents ) );
|
||||
$form->add( new Text( 'stripe_webhook_secret', $settings['webhook_secret'] ?? NULL, TRUE ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -2622,6 +2622,11 @@ class Package extends Model
|
||||
return (string) $form;
|
||||
|
||||
case 'reactivate':
|
||||
if( !$purchase->cancelled OR ( $purchase->cancelled AND !$purchase->can_reactivate ) )
|
||||
{
|
||||
\IPS\Output::i()->error( 'package_cannot_reactivate_error', '2S437/1', 403, '' );
|
||||
}
|
||||
|
||||
$currency = $purchase->original_invoice->currency;
|
||||
$renewalOptions = json_decode( $this->renew_options, TRUE );
|
||||
$noOptions = count( $renewalOptions ) === 1;
|
||||
|
||||
Reference in new issue
Block a user