PayTabs Laravel 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 package, 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 the "sendCustomerDetails" function but optional to be sent within the "sendShippingDetails" function, as shown below:
sendCustomerDetails($name, $email, $phone, $street1, $city, $state, $country, $zip, $ip)
sendShippingDetails($same_as_billing, $name = null, $email = null, $phone = null, $street1 = null, $city = null, $state = null, $country = null, $zip = null, $ip = null)
Those two methods indicate the customer/billing details and shipping details for the initiated payment. Only if provided the payment page will be prefilled with these data.
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
SameAsBilling
The Parameter Tag/Name | same_as_billing |
Data Type | BOOLEAN |
Purpose | Indicates whether to use the same details as on customer/billing details or not |
Required | ❌ |
Name
The Parameter Tag/Name | name |
Data Type | STRING |
Purpose | Indicates the customer's valid name. |
Min | 3 |
Max | 128 |
Required | ✔ for billing details❌ for shipping details |
Email
The Parameter Tag/Name | |
Data Type | STRING |
Validation Rules | Valid email format |
Purpose | Indicates 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 | ✔ for billing details❌ for shipping details |
Phone
The Parameter Tag/Name | phone |
Data Type | STRING |
Validation Rules | Valid number + country code prefix |
Purpose | Indicates the customer's valid phone number |
Min | - |
Max | - |
Required | ✔ for billing details❌ for shipping details |
Street1
The Parameter Tag/Name | street1 |
Data Type | STRING |
Purpose | Indicates the customer's valid address. |
Min | 3 |
Max | 128 |
Required | ✔ for billing details❌ for shipping details |
City
The Parameter Tag/Name | city |
Data Type | STRING |
Purpose | Indicates the customer's valid city name. |
Min | 3 |
Max | 128 |
Required | ✔ for billing details❌ for shipping details |
State
The Parameter Tag/Name | state |
Data Type | STRING |
Validation Rules | ISO 3166-1 alpha-2 code (two-letter state codes) |
Purpose | Indicates the customer's valid state name. |
Min | 2 |
Max | 2 |
Required | ✔ for billing details❌ for shipping details |
Country
The Parameter Tag/Name | country |
Data Type | STRING |
Validation Rules | ISO 3166-1 alpha-2 code (two-letter state codes) |
Purpose | Indicates the customer's valid state name. |
Min | 2 |
Max | 2 |
Required | ✔ for billing details❌ for shipping details |
Zip
The Parameter Tag/Name | zip |
Data Type | STRING |
Validation Rules | Valid/related zip code |
Purpose | Indicates the customer's valid zip code. |
Min | - |
Max | - |
Required | ✔ for billing details❌ for shipping details |
IP
The Parameter Tag/Name | ip |
Data Type | STRING |
Validation Rules | Valid IP address |
Purpose | Indicates 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 Laravel Packge Integration Manual" solution article.
⇦ And to get familiar with the rest of the steps regarding the previuos 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.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article