Credit card type | EBANX payment type code | Credit card numbers |
---|---|---|
American Express | amex |
378282246310005 or 371449635398431 |
Aura | aura |
5078601870000127985 or 5078601800003247449 |
Diners Club | diners |
30569309025904 or 38520000023237 |
Discover | discover |
6011111111111117 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// The libxml entity loader is disabled by default | |
// even setting the libxml_disable_entity_loader to false doesn't works! | |
// | |
// @see http://uk3.php.net/manual/en/function.libxml-disable-entity-loader.php | |
// @see http://stackoverflow.com/a/10213239 | |
$dir = __DIR__; | |
$content = 'This is a remote content!'; | |
file_put_contents('content.txt', $content); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$store_url = 'http://example.com'; | |
$endpoint = '/wc-auth/v1/authorize'; | |
$params = array( | |
'app_name' => 'My App Name', | |
'scope' => 'write', | |
'user_id' => 123, | |
'return_url' => 'http://app.com', | |
'callback_url' => 'https://app.com' | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function custom_wc_ajax_variation_threshold( $qty, $product ) { | |
return 10; | |
} | |
add_filter( 'woocommerce_ajax_variation_threshold', 'custom_wc_ajax_variation_threshold', 10, 2 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function custom_wc_admin_variations_per_page( $qty ) { | |
return 20; | |
} | |
add_filter( 'woocommerce_admin_meta_boxes_variations_per_page', 'custom_wc_admin_variations_per_page' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
DocumentRoot /var/www | |
<Directory /var/www/> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride All | |
Order allow,deny | |
allow from all | |
</Directory> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cs_woocommerce_locate_template( $template, $template_name, $template_path ) { | |
global $woocommerce; | |
$_template = $template; | |
if ( ! $template_path ) { | |
$template_path = $woocommerce->template_url; | |
} | |
$plugin_path = untrailingslashit( plugin_dir_path( __FILE__ ) ) . '/templates/'; | |
// Look within passed path within the theme - this is priority |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Test cards | |
$cards = array( | |
'378282246310005', // American Express | |
'371449635398431', // American Express | |
'5078601870000127985', // Aura | |
'5078601800003247449', // Aura | |
'30569309025904', // Diners Club | |
'38520000023237', // Diners Club |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wc_mercadopago_exclude_ticket( $args ) { | |
$args['payment_methods'] = array( array( 'excluded_payment_types' => array( 'id' => 'ticket' ) ) ); | |
return $args; | |
} | |
add_filter( 'woocommerce_mercadopago_args', 'wc_mercadopago_exclude_ticket' ); |
Bin e padrões para validação de cartão de crédito.
Bandeira | Começa com | Máximo de número | Máximo de número cvc | Regex |
---|---|---|---|---|
Visa | 4 |
13,16 | 3 | ^4[0-9]{12}(?:[0-9]{3}) |
Mastercard | 5 |
16 | 3 | ^5[1-5][0-9]{14} |
Diners | 301,305,36,38 link |
14,16 | 3 | `^3(?:0[0-5] |