Documentation

PaymillCCHandler extends PaymillHandler
in package

PostFinance online payment

Tags
copyright

CLOUDREXX CMS - CLOUDREXX AG

author

Thomas Däppen thomas.daeppen@comvation.com

author

ss4u ss4u.comvation@gmail.com

version
3.1.1
subpackage

module_shop

Table of Contents

Properties

$arrError  : array<string|int, mixed>
Error messages
$arrWarning  : array<string|int, mixed>
Warning messages
$paymillJsBridge  : string
Paymill JS Bridge url
$sectionName  : string
section name
$formScript  : mixed

Methods

closeElement()  : mixed
fieldset()  : mixed
getElement()  : mixed
getForm()  : string
Creates and returns the HTML Form for requesting the payment service.
getFormattedAttrbs()  : mixed
openElement()  : mixed
processRequest()  : mixed

Properties

$arrError

Error messages

public static array<string|int, mixed> $arrError = array()
Tags
access

public

$arrWarning

Warning messages

public static array<string|int, mixed> $arrWarning = array()
Tags
access

public

$paymillJsBridge

Paymill JS Bridge url

public static string $paymillJsBridge = "https://bridge.paymill.com"

$formScript

private static mixed $formScript = <<<FORMTEMPLATE \$J(document).ready(function() { // 3d secure credit card form \$J("#card-tds-form").submit(function(event) { // Deactivate submit button to avoid further clicks \$J('.submit-button').attr("disabled", "disabled"); if (false === paymill.validateHolder(\$J('.card-holdername').val())) { logResponse(cx.variables.get('invalid-card-holdername', 'shop')); \$J(".submit-button").removeAttr("disabled"); return false; } if ((false === paymill.validateCvc(\$J('.card-cvc').val()))) { if(VALIDATE_CVC){ logResponse(cx.variables.get('invalid-card-cvc', 'shop')); \$J(".submit-button").removeAttr("disabled"); return false; } else { \$J('.card-cvc').val(""); } } if (false === paymill.validateCardNumber(\$J('.card-number').val())) { logResponse(cx.variables.get('invalid-card-number', 'shop')); \$J(".submit-button").removeAttr("disabled"); return false; } if (false === paymill.validateExpiry(\$J('.card-expiry-month').val(), \$J('.card-expiry-year').val())) { logResponse(cx.variables.get('invalid-card-expiry-date', 'shop')); \$J(".submit-button").removeAttr("disabled"); return false; } event.preventDefault(); try { paymill.createToken({ number: \$J('#card-tds-form .card-number').val(), exp_month: \$J('#card-tds-form .card-expiry-month').val(), exp_year: \$J('#card-tds-form .card-expiry-year').val(), cvc: \$J('#card-tds-form .card-cvc').val(), cardholder: \$J('#card-tds-form .card-holdername').val(), }, PaymillResponseHandler); } catch(e) { logResponse(e.message); } }); \$J('.card-number').keyup(function() { var brand = detectCreditcardBranding(\$J('.card-number').val()); brand = brand.replace(' ','-'); \$J(".card-number")[0].className = \$J(".card-number")[0].className.replace(/paymill-card-number-.*/g, ''); if (brand !== 'unknown') { \$J('.card-number').addClass("paymill-card-number-" + brand); } if (brand !== 'maestro') { VALIDATE_CVC = true; } else { VALIDATE_CVC = false; } }); }); function PaymillResponseHandler(error, result) { if (error) { logResponse(error.apierror); \$J(".submit-button").removeAttr("disabled"); } else { //logResponse(result.token); var form = \$J("#card-tds-form"); // Token var token = result.token; // Insert token into form in order to submit to server form.append("<input type='hidden' name='paymillToken' value='" + token + "'/>"); form.get(0).submit(); \$J(".submit-button").removeAttr("disabled"); } } function logResponse(res) { /* // create console.log to avoid errors in old IE browsers if (!window.console) console = {log:function(){}}; console.log(res); if(PAYMILL_TEST_MODE) \$J('.debug').text(res).show().fadeOut(8000); */ \$J('.paymill-error-text').text(res).show().fadeOut(8000); } FORMTEMPLATE

Methods

fieldset()

public static fieldset([mixed $legend = false ][, mixed $selfClose = false ]) : mixed
Parameters
$legend : mixed = false
$selfClose : mixed = false

getElement()

public static getElement(mixed $elm[, mixed $attrbs = '' ][, mixed $content = '' ]) : mixed
Parameters
$elm : mixed
$attrbs : mixed = ''
$content : mixed = ''

getForm()

Creates and returns the HTML Form for requesting the payment service.

public static getForm(mixed $arrOrder[, mixed $landingPage = null ]) : string
Parameters
$arrOrder : mixed
$landingPage : mixed = null
Tags
access

public

Return values
string

The HTML form code

getFormattedAttrbs()

public static getFormattedAttrbs(mixed $attributes) : mixed
Parameters
$attributes : mixed

openElement()

public static openElement(mixed $elm[, mixed $attributes = '' ]) : mixed
Parameters
$elm : mixed
$attributes : mixed = ''

processRequest()

public static processRequest(mixed $token, mixed $arrOrder) : mixed
Parameters
$token : mixed
$arrOrder : mixed

        
On this page

Search results