Version 4.7.0
This commit is contained in:
1 parent
517a5e1f70
commit
8ba7d43898
1933 files changed
+65613
-11332
No files matched your search
@@ -314,14 +314,6 @@ class _Stripe extends \IPS\nexus\Gateway
|
||||
'member' => $member,
|
||||
) ) );
|
||||
}
|
||||
elseif ( $settings['type'] === 'amex' )
|
||||
{
|
||||
return array( 'card' => new \IPS\Helpers\Form\Custom( $this->id . '_card', NULL, FALSE, array(
|
||||
'rowHtml' => function( $field ) use ( $settings ) {
|
||||
return \IPS\Theme::i()->getTemplate( 'forms', 'nexus', 'global' )->amexExpressCheckout( $field, $this, $settings['amex_client_id'] );
|
||||
}
|
||||
) ) );
|
||||
}
|
||||
elseif ( $settings['type'] === 'sofort' and \IPS\NEXUS_TEST_GATEWAYS )
|
||||
{
|
||||
return array(
|
||||
@@ -608,12 +600,6 @@ class _Stripe extends \IPS\nexus\Gateway
|
||||
'phone' => isset( $transaction->invoice->member->cm_phone ) ? $transaction->invoice->member->cm_phone : NULL
|
||||
);
|
||||
}
|
||||
|
||||
/* Amex Express Checkout */
|
||||
if ( $settings['type'] === 'amex' )
|
||||
{
|
||||
$data['card'] = $values[ $this->id . '_card' ];
|
||||
}
|
||||
|
||||
/* Source-based */
|
||||
elseif ( \is_string( $card ) )
|
||||
@@ -851,9 +837,9 @@ class _Stripe extends \IPS\nexus\Gateway
|
||||
{
|
||||
$response = $charge;
|
||||
$response['source'] = $response['payment_method_details'];
|
||||
foreach ( array( 'cvc_check', 'address_line1_check', 'address_zip_check' ) as $k )
|
||||
foreach ( array( 'cvc_check', 'address_line1_check', 'address_postal_code_check' ) as $k )
|
||||
{
|
||||
$response['source']['card'][ $k ] = isset( $response['payment_method_details']['checks'][ $k ] ) ? $response['payment_method_details']['checks'][ $k ] : 'unavailable';
|
||||
$response['source']['card'][ $k ] = isset( $response['payment_method_details']['card']['checks'][ $k ] ) ? $response['payment_method_details']['card']['checks'][ $k ] : 'unavailable';
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -975,7 +961,7 @@ class _Stripe extends \IPS\nexus\Gateway
|
||||
public function form( &$form )
|
||||
{
|
||||
$form->addHeader('stripe_basic_settings');
|
||||
$form->add( new \IPS\Helpers\Form\Translatable( 'paymethod_name', NULL, TRUE, array( 'app' => 'nexus', 'key' => "nexus_paymethod_{$this->id}" ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Translatable( 'paymethod_name', NULL, TRUE, array( 'app' => 'nexus', 'key' => $this->id ? "nexus_paymethod_{$this->id}" : NULL ) ) );
|
||||
$form->add( new \IPS\Helpers\Form\Select( 'paymethod_countries', ( $this->id and $this->countries !== '*' ) ? explode( ',', $this->countries ) : '*', FALSE, array( 'options' => array_map( function( $val )
|
||||
{
|
||||
return "country-{$val}";
|
||||
@@ -1002,7 +988,6 @@ class _Stripe extends \IPS\nexus\Gateway
|
||||
'card' => 'stripe_type_card',
|
||||
'native' => 'stripe_type_native',
|
||||
'alipay' => 'stripe_type_alipay',
|
||||
'amex' => 'stripe_type_amex',
|
||||
'bancontact'=> 'stripe_type_bancontact',
|
||||
'giropay' => 'stripe_type_giropay',
|
||||
'ideal' => 'stripe_type_ideal',
|
||||
@@ -1010,11 +995,17 @@ class _Stripe extends \IPS\nexus\Gateway
|
||||
),
|
||||
'toggles' => array(
|
||||
'card' => array( 'stripe_cards' ),
|
||||
'amex' => array( 'stripe_amex_client_id' )
|
||||
'native' => array( 'stripe_apple_pay_file')
|
||||
)
|
||||
) ) );
|
||||
$form->add( new \IPS\Helpers\Form\YesNo( 'stripe_cards', $settings ? $settings['cards'] : TRUE, FALSE, array(), NULL, NULL, NULL, 'stripe_cards' ) );
|
||||
$form->add( new \IPS\Helpers\Form\Text( 'stripe_amex_client_id', ( $settings and isset( $settings['amex_client_id'] ) ) ? $settings['amex_client_id'] : NULL, NULL, array(), NULL, NULL, \IPS\Member::loggedIn()->language()->addToStack('stripe_amex_client_id_gen'), 'stripe_amex_client_id' ) );
|
||||
|
||||
if ( \IPS\CIC )
|
||||
{
|
||||
$form->add( new \IPS\Helpers\Form\Upload( 'm_validationfile', $this->validationfile ? \IPS\File::get( 'nexus_Gateways', $this->validationfile ) : '', FALSE, array( 'storageExtension' => 'nexus_Gateways' ), NULL, NULL, NULL, 'stripe_apple_pay_file' ) );
|
||||
\IPS\Member::loggedIn()->language()->words[ 'm_validationfile'] = \IPS\Member::loggedIn()->language()->addToStack('stripe_apple_verificationfile');
|
||||
}
|
||||
|
||||
$form->addHeader('stripe_webhook');
|
||||
$form->addMessage('stripe_webhook_blurb');
|
||||
\IPS\Member::loggedIn()->language()->words["stripe_webhook_blurb"] = sprintf( \IPS\Member::loggedIn()->language()->get('stripe_webhook_blurb'), (string) \IPS\Http\Url::internal( 'applications/nexus/interface/gateways/stripe.php', 'interface' ) );
|
||||
@@ -1058,7 +1049,7 @@ class _Stripe extends \IPS\nexus\Gateway
|
||||
}
|
||||
if ( !$webhookId )
|
||||
{
|
||||
throw new \DomainException( \IPS\Member::loggedIn()->language()->addToStack( 'stripe_webhook_invalid', FALSE, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->formatList( $this->webhookEvents ) ) ) ) );
|
||||
throw new \InvalidArgumentException( \IPS\Member::loggedIn()->language()->addToStack( 'stripe_webhook_invalid', FALSE, array( 'sprintf' => array( \IPS\Member::loggedIn()->language()->formatList( $this->webhookEvents ) ) ) ) );
|
||||
}
|
||||
$settings['webhook_id'] = $webhookId;
|
||||
|
||||
|
||||
Reference in new issue
Block a user