Skip to content

Commit

Permalink
Merge pull request #4 from nicomollet/patch-4
Browse files Browse the repository at this point in the history
Sanitize phone number field
  • Loading branch information
PaylineGitHub authored Jun 1, 2017
2 parents 74ed2dd + 6975b26 commit e6ee813
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions class-wc-gateway-payline.php
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ function generate_payline_form($order_id) {
$doWebPaymentRequest['buyer']['customerId'] = $order->billing_email;
$doWebPaymentRequest['buyer']['email'] = $doWebPaymentRequest['buyer']['customerId'];
$doWebPaymentRequest['buyer']['ip'] = $_SERVER['REMOTE_ADDR'];
$doWebPaymentRequest['buyer']['mobilePhone'] = $order->billing_phone;
$doWebPaymentRequest['buyer']['mobilePhone'] = preg_replace("/[^0-9.]/", '', $order->billing_phone);

// BILLING ADDRESS
$doWebPaymentRequest['billingAddress']['name'] = $order->billing_first_name." ".$order->billing_last_name;
Expand All @@ -609,7 +609,7 @@ function generate_payline_form($order_id) {
$doWebPaymentRequest['billingAddress']['cityName'] = $order->billing_city;
$doWebPaymentRequest['billingAddress']['zipCode'] = $order->billing_postcode;
$doWebPaymentRequest['billingAddress']['country'] = $order->billing_country;
$doWebPaymentRequest['billingAddress']['phone'] = $order->billing_phone;
$doWebPaymentRequest['billingAddress']['phone'] = preg_replace("/[^0-9.]/", '', $order->billing_phone);

// SHIPPING ADDRESS
$doWebPaymentRequest['shippingAddress']['name'] = $order->shipping_first_name ." ".$order->shipping_last_name;
Expand Down

0 comments on commit e6ee813

Please sign in to comment.