Download the PHP package smiftakhairul/sslcommerz without Composer
On this page you can find all versions of the php package smiftakhairul/sslcommerz. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download smiftakhairul/sslcommerz
More information about smiftakhairul/sslcommerz
Files in smiftakhairul/sslcommerz
Package sslcommerz
Short Description SSLCommerz Payment Gateway Package for Laravel.
License MIT
Informations about the package sslcommerz
SSLCommerz
SSLCommerz is the first payment gateway in Bangladesh opening doors for merchants to receive payments on the internet via their online stores.
Official documentation here.
Installation
Vendor
A file sslcommerz.php
will be added to config
directory after running above command. We need to setup our configuration to .env
file as follows:
For deveopment mode we need to set IS_PRODUCTION=false
, and for production mode IS_PRODUCTION=true
. Please go through the official docs of SSLCommerz for further information.
Usage
Initiate a payment
Set store information dynamically
Response
You will get a response after initiating a payment by which you can deal with. You can see a sample response format in the official documentation.
Hosted Payment Integration
Easy Checkout Integration
Disable CSRF Protection
Disable CSRF
protection for the following URL's.
init-payment-via-ajax
urlsuccess
urlfail
urlcancel
urlipn
url
Disable them from VerifyCsrfToken
middleware.
Order Validation
Transaction Query
Refund
Available Env's & API's
Environments: getApiEnvironment()
- sandbox (
IS_PRODUCTION
false) - production (
IS_PRODUCTION
true)
Domains: getApiDomain()
- sandbox (https://sandbox.sslcommerz.com)
- production (https://securepay.sslcommerz.com)
APIs:
getApiUrl()
([api_domain]/gwprocess/v4/api.php)getOrderValidateApiUrl()
([api_domain]/validator/api/validationserverAPI.php)getTransactionStatusApiUrl()
([api_domain]/validator/api/merchantTransIDvalidationAPI.php)getRefundPaymentApiUrl()
([api_domain]/validator/api/merchantTransIDvalidationAPI.php)getRefundStatusApiUrl()
([api_domain]/validator/api/merchantTransIDvalidationAPI.php)
Available Methods
Environment & domain related configuration:
Method Name | Param Info | Description |
---|---|---|
getApiEnvironment() |
API environment: sandbox or production. | |
setApiEnvironment() |
string |
Set API environment: sandbox or production only. |
getApiDomain() |
API domain: for example https://sandbox.sslcommerz.com or https://securepay.sslcommerz.com |
|
isProductionMode() |
Get production_mode. | |
setProductionMode() |
boolean |
Set production_mode. By default, production_mode sets by IS_PRODUCTION value. |
API url configuration:
Method Name | Param Info | Description |
---|---|---|
getApiUrl() |
Get payment initiate api url. | |
setApiUrl() |
string |
Set payment initiate api url. By default, api url sets based on IS_PRODUCTION value. If IS_PRODUCTION = true , live api url will be set and for IS_PRODUCTION = false sandbox api url will be set. |
getTransactionStatusApiUrl() |
Get transaction status api url. | |
setTransactionStatusApiUrl() |
string |
Set transaction status api url. |
getOrderValidateApiUrl() |
Get order validation api url. | |
setOrderValidateApiUrl() |
string |
Set order validation api url. |
getRefundPaymentApiUrl() |
Get refund payment api url. | |
setRefundPaymentApiUrl() |
string |
Set refund payment api url. |
getRefundStatusApiUrl() |
Get refund status api url. | |
setRefundStatusApiUrl() |
string |
Set refund status api url. |
Set information as a compact:
Method Name | Param Info | Description |
---|---|---|
getPrimaryInformation() |
Get primary information such as:
store_id, store_passwd, total_amount, currency, tran_id, success_url, fail_url, cancel_url and other optional information. |
|
setPrimaryInformation() |
array() |
Set primary information.
Required parameter key elements:
|
getCustomerInformation() |
Get customer information such as:
cus_name, cus_email, cus_add1, cus_add2, cus_city, cus_postcode, cus_country, cus_phone and other optional information. |
|
setCustomerInformation() |
array() |
Set customer information.
Required parameter key elements:
|
getProductInformation() |
Get product information such as:
product_name, product_category, product_profile and other optional information. |
|
setProductInformation() |
array() |
Set product information.
Required parameter key elements:
|
getShipmentInformation() |
Get shipment information such as:
shipping_method, num_of_item and other optional information. |
|
setShipmentInformation() |
array() |
Set shipment information.
Required parameter key elements:
|
getEmiInformation() |
Get EMI information such as:
emi_option and other optional information. |
|
setEmiInformation() |
array() |
Set EMI information.
Required parameter key elements:
|
getAdditionalInformation() |
Get additional information such as:
value_a, value_b, value_c, value_d. |
|
setAdditionalInformation() |
array() |
Set additional information.
Optional parameter key elements:
|
Other getters and setters:
Method Name | Param Info | Description |
---|---|---|
getPaymentDisplayType() |
Get payment display type. | |
setPaymentDisplayType() * |
enum('hosted', 'checkout') |
Set payment display type. Default value is checkout. |
getStoreId() |
Get SSLCommerz store_id. | |
setStoreId() * |
string |
Set SSLCommerz store_id. Default value sets by STORE_ID value. |
getStorePassword() |
Get SSLCommerz store_passwd. | |
setStorePassword() * |
string |
Set SSLCommerz store_passwd. Default value sets by STORE_PASSWORD value. |
getTotalAmount() |
Get total_amount of transaction. | |
setTotalAmount() * |
decimal |
Set total_amount of transaction. The transaction amount must be from 10.00 BDT to 500000.00 BDT |
getCurrency() |
Get currency type. Example: BDT, USD, EUR, SGD, INR, MYR, etc | |
setCurrency() * |
string |
Set currency type. |
getTranId() |
Get unique tran_id to identify order. | |
setTranId() * |
string |
Set tran_id to unify your order. |
getSuccessUrl() |
Get callback success_url. | |
setSuccessUrl() * |
string |
Set callback success_url where user will redirect after successful payment. |
getFailUrl() |
Get callback fail_url. | |
setFailUrl() * |
string |
Set callback fail_url where user will redirect after any failure occurs during payment. |
getCancelUrl() |
Get callback cancel_url. | |
setCancelUrl() * |
string |
Set callback cancel_url where user will redirect if user cancels the transaction. |
getIpnUrl() |
Get Instant Payment Notification ipn_url. | |
setIpnUrl() |
string |
Set ipn_url. Enable instant payment notification option so that SSLCommerz can send the transaction's status to ipn_url. |
getMultiCardName() |
Get multi_card_name. | |
setMultiCardName() |
string |
Set multi_card_name. Use it only if gateway list needs to be customized. |
getAllowedBin() |
Get allowed_bin. | |
setAllowedBin() |
string |
Set allowed_bin. Use it only if transaction needs to be controlled. |
getCustomerName() |
Get cus_name. | |
setCustomerName() * |
string |
Set cus_name. |
getCustomerEmail() |
Get cus_email. | |
setCustomerEmail() * |
string |
Set cus_email. |
getCustomerAddress1() |
Get cus_add1. | |
setCustomerAddress1() * |
string |
Set cus_add1. |
getCustomerAddress2() |
Get cus_add2. | |
setCustomerAddress2() |
string |
Set cus_add2. |
getCustomerCity() |
Get cus_city. | |
setCustomerCity() * |
string |
Set cus_city. |
getCustomerState() |
Get cus_state. | |
setCustomerState() |
string |
Set cus_state. |
getCustomerPostCode() |
Get cus_postcode. | |
setCustomerPostCode() * |
string |
Set cus_postcode. |
getCustomerCountry() |
Get cus_country. | |
setCustomerCountry() * |
string |
Set cus_country. |
getCustomerPhone() |
Get cus_phone. | |
setCustomerPhone() * |
string |
Set cus_phone. |
getCustomerFax() |
Get cus_fax. | |
setCustomerFax() |
string |
Set cus_fax. |
getProductName() |
Get product_name. | |
setProductName() * |
string |
Set product_name. |
getProductCategory() |
Get product_category. | |
setProductCategory() * |
string |
Set product_category. |
getProductProfile() |
Get product_profile. | |
setProductProfile() * |
string |
Set product_profile.
Available keys:
|
getProductHoursTillDeparture() |
Get hours_till_departure. | |
setProductHoursTillDeparture() ** |
string |
Set hours_till_departure. Required if product_profile is airline-tickets. |
getProductFlightType() |
Get flight_type. | |
setProductFlightType() ** |
string |
Set flight_type. Required if product_profile is airline-tickets. |
getProductPnr() |
Get pnr. | |
setProductPnr() ** |
string |
Set pnr. Required if product_profile is airline-tickets. |
getProductJourneyFromTo() |
Get journey_from_to. | |
setProductJourneyFromTo() ** |
string |
Set journey_from_to. Required if product_profile is airline-tickets. |
getProductThirdPartyBooking() |
Get third_party_booking. | |
setProductThirdPartyBooking() ** |
string |
Set third_party_booking. Required if product_profile is airline-tickets. |
getProductHotelName() |
Get hotel_name. | |
setProductHotelName() ** |
string |
Set hotel_name. Required if product_profile is travel-vertical. |
getProductLengthOfStay() |
Get length_of_stay. | |
setProductLengthOfStay() ** |
string |
Set length_of_stay. Required if product_profile is travel-vertical. |
getProductCheckInTime() |
Get check_in_time. | |
setProductCheckInTime() ** |
string |
Set check_in_time. Required if product_profile is travel-vertical. |
getProductHotelCity() |
Get hotel_city. | |
setProductHotelCity() ** |
string |
Set hotel_city. Required if product_profile is travel-vertical. |
getProductType() |
Get product_type. | |
setProductType() ** |
string |
Set product_type. Required if product_profile is telecom-vertical. |
getProductTopUpNumber() |
Get topup_number. | |
setProductTopUpNumber() ** |
string |
Set topup_number. Required if product_profile is telecom-vertical. |
getProductCountryTopUp() |
Get country_topup. | |
setProductCountryTopUp() ** |
string |
Set country_topup. Required if product_profile is telecom-vertical. |
getCart() |
Get cart. | |
setCart() |
json |
Set cart. JSON data with two elements. product: Max 255 characters, quantity: Quantity in numeric value and amount: Decimal (12,2). Example: [{"product":"DHK TO BRS AC A1","quantity":"1","amount":"200.00"},{"product":"DHK TO BRS AC A2","quantity":"1","amount":"200.00"},{"product":"DHK TO BRS AC A3","quantity":"1","amount":"200.00"},{"product":"DHK TO BRS AC A4","quantity":"2","amount":"200.00"}] |
getProductAmount() |
Get product_amount. | |
setProductAmount() |
decimal |
Set product_amount. |
getVat() |
Get vat. | |
setVat() |
decimal |
Set vat. |
getDiscountAmount() |
Get discount_amount. | |
setDiscountAmount() |
decimal |
Set discount_amount. |
getConvenienceFee() |
Get convenience_fee. | |
setConvenienceFee() |
decimal |
Set convenience_fee. |
getShippingMethod() |
Get shipping_method of the order. | |
setShippingMethod() * |
string |
Set shipping_method of the order. Example: YES or NO or Courier. |
getShippingItemNumber() |
Get num_of_item of product. | |
setShippingItemNumber() * |
integer |
Set num_of_item of product will be shipped. |
getShippingName() |
Get ship_name of address. | |
setShippingName() ** |
string |
Set ship_name of address. Required if shipping_method is YES. |
getShippingAddress1() |
Get ship_add1. | |
setShippingAddress1() ** |
string |
Set ship_add1. Required if shipping_method is YES. |
getShippingAddress2() |
Get ship_add2. | |
setShippingAddress2() |
string |
Set ship_add2. |
getShippingCity() |
Get ship_city. | |
setShippingCity() ** |
string |
Set ship_city. Required if shipping_method is YES. |
getShippingState() |
Get ship_state. | |
setShippingState() |
string |
Set ship_state. |
getShippingPostCode() |
Get ship_postcode. | |
setShippingPostCode() ** |
string |
Set ship_postcode. Required if shipping_method is YES. |
getShippingCountry() |
Get ship_country. | |
setShippingCountry() ** |
string |
Set ship_country. Required if shipping_method is YES. |
getEmiOption() |
Get emi_option. | |
setEmiOption() * |
integer |
Set emi_option. Value must be 1 or 0. |
getEmiMaxInstOption() |
Get emi_max_inst_option. | |
setEmiMaxInstOption() |
integer |
Set emi_max_inst_option. |
getEmiSelectedInst() |
Get emi_selected_inst. | |
setEmiSelectedInst() |
integer |
Set emi_selected_inst. |
getEmiAllowOnly() |
Get emi_allow_only. | |
setEmiAllowOnly() |
integer |
Set emi_allow_only. Value must be 1 or 0. This parameter depends on emi_option and emi_selected_inst |
getAdditionalValueA() |
Get value_a. | |
setAdditionalValueA() |
string |
Set value_a. |
getAdditionalValueB() |
Get value_b. | |
setAdditionalValueB() |
string |
Set value_b. |
getAdditionalValueC() |
Get value_c. | |
setAdditionalValueC() |
string |
Set value_c. |
getAdditionalValueD() |
Get value_d. | |
setAdditionalValueD() |
string |
Set value_d. |
*
= Required and **
= Dependently Required.