diff --git a/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoice.php b/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoice.php
index 4175cf6d5..939618881 100644
--- a/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoice.php
+++ b/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoice.php
@@ -111,6 +111,16 @@ class PayUponInvoice {
'clear' => true,
)
);
+ woocommerce_form_field(
+ 'phone_country_code',
+ array(
+ 'type' => 'number',
+ 'label' => __('Phone country code (ex. 49)', 'woocommerce-paypal-payments'),
+ 'class' => array('form-row-wide'),
+ 'required' => true,
+ 'clear' => true,
+ )
+ );
echo '
';
_e( 'By clicking on the button, you agree to the
terms of payment and
performance of a risk check from the payment partner, Ratepay. You also agree to PayPal’s
privacy statement. If your request to purchase upon invoice is accepted, the purchase price claim will be assigned to Ratepay, and you may only pay Ratepay, not the merchant.', 'woocommerce-paypal-payments' );
diff --git a/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PaymentSourceFactory.php b/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PaymentSourceFactory.php
index 378e1e618..e1943f977 100644
--- a/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PaymentSourceFactory.php
+++ b/modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PaymentSourceFactory.php
@@ -9,6 +9,7 @@ class PaymentSourceFactory {
public function from_wc_order( WC_Order $order ) {
$address = $order->get_address();
$birth_date = filter_input( INPUT_POST, 'billing_birth_date', FILTER_SANITIZE_STRING );
+ $phone_country_code = filter_input( INPUT_POST, 'phone_country_code', FILTER_SANITIZE_STRING );
return new PaymentSource(
$address['first_name'] ?? '',
@@ -16,7 +17,7 @@ class PaymentSourceFactory {
$address['email'] ?? '',
$birth_date ?? '',
$address['phone'] ?? '',
- '49',
+ $phone_country_code ?? '',
$address['address_1'] ?? '',
$address['city'] ?? '',
$address['postcode'] ?? '',