PayTabs Node.js Package makes integration with the PayTabs payment gateway very easy by providing a ready-made payment class that handles the card entry, and billing & shipping information and completes the missing details. 

This article is dedicated to walking you through how to manage/manipulate both shipping and billing/customer information in this packageThe following string values can be passed within the "customer_details" and "shipping_address" arrays, which are passed as the fourth and fifth parameters in sequence to the "createPaymentPage" function, as shown below:


Through out the article we will use the same concepet clarified in our How to remove/hide the billing/shipping information?  solution article.




The following parameters are required to be sent within both parameters, as shown below:


let customer = {
    name:"Mohammed ELRayes",
    email:"[email protected]",
    phone:"+201234567890",
    street1:"dummy street, dummy building, dummy apt",
    city:"Heliopolis",
    state:"CAI",
    country:"EG",
    zip:"52121",
    IP:"10.0.0.1"
}


let customer_details = [
    customer.name,
    customer.email,
    customer.phone,
    customer.street1,
    customer.city,
    customer.state,
    customer.country,
    customer.zip,
    customer.IP
];

let shipping_address = customer_details;


paytabs.createPaymentPage(
    paymentMethods,
    transaction_details,
    cart_details,
    customer_details,            // billing address array
    shipping_address,            // shipping address array
    response_URLs,
    lang,
    paymentPageCreated
);


This "customer_details" and "shipping_details" parameters are Mandatory, not passing them would throw an exception.


The customer details are still required and must be passed, in case any of the details are missing or passed with invalid values; the cardholder will be required to enter any of the missing details on the payment page



Name


The Parameter Tag/Namename
Data TypeSTRING
PurposeIndicates the customer's valid name.
Min3
Max128
Required✔   
 



Email


The Parameter Tag/Nameemail
Data TypeSTRING
Validation RulesValid email format
PurposeIndicates the customer's valid email address. Preferred not to pass the same email with every transaction, as blocking any for a fraud attempt will cause blocking your payments at all.
Min-
Max-
Required✔  
 



Phone


The Parameter Tag/Namephone
Data TypeSTRING
Validation Rules

Valid number + country code prefix

PurposeIndicates the customer's valid phone number
Min-
Max-
Required✔   
 



Street1


The Parameter Tag/Namestreet1
Data TypeSTRING
PurposeIndicates the customer's valid address.
Min3
Max128
Required✔  
 



City


The Parameter Tag/Namecity
Data TypeSTRING
PurposeIndicates the customer's valid city name.
Min3
Max128
Required✔  
 



State


The Parameter Tag/Namestate
Data TypeSTRING
Validation Rules

ISO 3166-1 alpha-2 code (two-letter state codes)

PurposeIndicates the customer's valid state name.
Min2
Max2
Required✔  
 



Country


The Parameter Tag/Namecountry
Data TypeSTRING
Validation Rules

ISO 3166-1 alpha-2 code (two-letter state codes)

PurposeIndicates the customer's valid state name.
Min2
Max2
Required✔   
 



Zip


The Parameter Tag/Namezip
Data TypeSTRING
Validation Rules

Valid/related zip code

PurposeIndicates the customer's valid zip code.
Min-
Max-
Required✔   
 


IP


The Parameter Tag/Nameip
Data TypeSTRING
Validation Rules

Valid IP address

PurposeIndicates the customer's valid IP address.
Min-
Max-
Required
 






⌂ To get familiar with the whole process and the other steps, kindly navigate to our "The Node.js Packge Integration Manual" solution article. 
		
        
And to get familiar with the rest of the steps regarding the previous step
"Step 2 - Configure the integration method" kindly click here. And to get familiar with the rest of the steps regarding the current step "Step 3 - Initiating the payment" click here.

 And to navigate to the next step in the integration process "Step 4 - Accepting the payment" kindly click here.