Version 5.0.6
This commit is contained in:
1 parent
a3a4a9ccbd
commit
b89858b2ff
1214 files changed
+92828
-14859
No files matched your search
@@ -55,6 +55,7 @@ use function in_array;
|
||||
use function intval;
|
||||
use function is_numeric;
|
||||
use function is_string;
|
||||
use function str_starts_with;
|
||||
use function strlen;
|
||||
use const IPS\CIC;
|
||||
use const IPS\LONG_REQUEST_TIMEOUT;
|
||||
@@ -89,6 +90,19 @@ class Stripe extends Gateway
|
||||
{
|
||||
$settings = json_decode( $this->settings, TRUE );
|
||||
|
||||
/* Check if we are using test or live keys */
|
||||
if( \IPS\NEXUS_TEST_GATEWAYS )
|
||||
{
|
||||
if( !str_starts_with( $settings['secret_key'], 'sk_test_' ) or !str_starts_with( $settings['publishable_key'], 'pk_test_' ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
elseif( !str_starts_with( $settings['secret_key'], 'sk_live_' ) or !str_starts_with( $settings['publishable_key'], 'pk_live_' ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Stripe has a minimum transaction fee. This is based on the businesses currency, but as we don't know what the transaction rate is
|
||||
we'll do this check only in the transactions we know - anything else will be rejected when the user tries to pay */
|
||||
switch ( $amount->currency )
|
||||
|
||||
Reference in new issue
Block a user