shopp_payment_cards

filter the payment card lookup table of PayCard objects.

add_filter( 'shopp_payment_cards', [callback] )

@param array $cards payment card lookup table of PayCard objects.

Description

filter the payment card lookup table of PayCard objects.

The payment cards lookup table is used to construct the payment card inputs on the checkout.

Example

// register filter callback
add_filter('shopp_payment_cards', 'shopp_payment_cards_filter');

// create filter function
function shopp_payment_cards_filter( $cards ) {

    $cards['visa'] = // index is used by payment gateways $cards property
    new PayCard (
        'Visa', // name
        'Visa', // symbol

        // Regex card number pattern
        // for cardnumber validation
        '/^4\d{15}$/',
        3 // number of security code digits
    );

    $_['solo'] =
    new PayCard(
        'Solo',
        'Solo',
        '/^(6334|6767)(\d{12}|\d{14,15})$/',
        3, 
        array( // special payment card inputs
            'start' => 5, // name and # of digits
            'issue' = >3
        )
    );

    return $cards;
}

See Also

You must be logged in to post a comment.

© Ingenesis Limited. Shopp™ is a registered trademark of Ingenesis Limited.

Skip to toolbar