Parsigate is a free and open-source WooCommerce plugin that supports multiple Iranian payment gateways, including bank, installment, and intermediary gateways.
- WordPress
- WooCommerce
- ParsiDate Plugin must be installed and activated
- Parsian
- Pasargad
- Saman (Sep)
- Mellat (BehPardakht)
- Melli (Sadad)
- Asan Pardakht
- Saderat (Sepehr)
- Iran Kish
- SnappPay
- Tara
- DigiPay
- Azki Vam
- Zibal
- Zarinpal
- PayPing
- AghaPardakht
- Shepa
- Test payment gateway for development and debugging
$gateway = new \ParsiGate\Gateway($driver = 'zarinpal');
$pay = $gateway->pay($params = []);
$verify = $gateway->verify($params = []);$gateways = \ParsiGate\Gateways::list();// 1. Create Your Own Gateway Class for Process
class MyGateway extends \ParsiGate\Gateways\Base
{
public function pay(array $args = []): array
{
return $this->success();
}
public function verify(array $args = []): array
{
return $this->success();
}
}
// 2. Append to Gateway List with `parsigate_gateways_list` Hook
add_filter('parsigate_gateways_list', 'new_define_gateway_parsigate', 10, 1);
function new_define_gateway_parsigate($list)
{
$list['my-gateway'] = [
'title' => __('My Gateway Name', 'parsigate'),
'class' => MyGateway::class,
'website' => 'gateway-site.com',
'logo' => 'https://gateway-site.com/logo.png',
'type' => 'bank',
'usage' => ['woocommerce'],
'woocommerce' => [
'sandbox' => false,
'settings' => [
'merchant_id' => [
'title' => __('Merchant ID', 'parsigate'),
'type' => 'text',
'default' => '',
'desc_tip' => false
]
],
'pay' => function ($amount, $order, $option, $callback_url, $class) {
return [
"merchant_id" => $option['merchant_id'],
"amount" => $amount,
"callback_url" => $callback_url,
"description" => sprintf(__('Order ID: %d', 'parsigate'), $order->get_order_number()),
];
},
'verify' => function ($amount, $order, $option, $class, $request) {
$authority = ($request['get']['Authority'] ?? '');
$status = ($request['get']['Status'] ?? '');
return [
"merchant_id" => $option['merchant_id'],
"amount" => $amount,
'Authority' => $authority,
'Status' => $status
];
}
]
];
return $list;
}- Install and activate the ParsiDate plugin.
- Upload and activate Parsigate via WordPress admin or FTP.
- Go to WooCommerce → Settings → Payments and configure your desired gateways.
GNU General Public License v2.0 or later.