Israeli Payment Orchestrator
Instructions
Step 1: Assess Payment Requirements
Ask the user about their payment needs:
| Requirement |
Hebrew |
Description |
Impact on Gateway Choice |
| Installments (tashlumim) |
תשלומים |
Split payment into monthly installments |
Not all gateways support all installment types |
| Recurring billing |
חיוב חוזר |
Subscription / standing order |
Requires token storage and Shva approval |
| Multi-currency |
רב-מטבעי |
Accept NIS + foreign currencies |
Limited gateway support for dual currency |
| Iframe / redirect |
דף סליקה |
Hosted payment page vs embedded |
Affects PCI scope |
| Bit / Apple Pay |
ביט / אפל פיי |
Alternative payment methods |
Gateway-specific integrations |
| High volume |
נפח גבוה |
Over 1,000 transactions/day |
Need SLA guarantees and fallback |
Step 2: Compare Gateways
Use scripts/compare_gateways.py to generate a comparison matrix, or reference the table below:
| Gateway |
API Style |
Installments |
Recurring |
Hosted Page |
Bit Support |
Typical Fee |
| Cardcom |
REST JSON |
Full (regular, credit, club) |
Yes |
Yes (iframe) |
No |
0.6-0.8% |
| Tranzila |
REST/Form POST |
Regular, credit |
Yes |
Yes (redirect) |
No |
0.5-0.7% |
| PayMe |
REST JSON |
Regular, credit |
Yes |
Yes (iframe) |
Yes |
0.7-1.0% |
| Meshulam |
REST JSON |
Regular |
Yes |
Yes (iframe + redirect) |
Yes |
0.6-0.9% |
| iCredit |
REST JSON |
Regular, credit |
Yes |
Yes (redirect) |
No |
0.5-0.8% |
| Pelecard |
REST JSON |
Regular, credit, club |
Yes |
Yes (iframe) |
No |
0.5-0.7% |
Fee notes: Rates are indicative. Actual rates depend on business volume, industry, and negotiation.
Step 3: Design the Orchestration Layer
Build a unified payment abstraction:
# Unified payment interface pattern
class PaymentRequest:
amount: float # סכום - in agorot (NIS cents)
currency: str # מטבע - "ILS" default
installments: int # תשלומים - 1 = regular, 2-36 = installments
installment_type: str # סוג תשלומים - "regular", "credit", "club"
card_token: str # טוקן כרטיס - for recurring
description: str # תיאור עסקה
customer_id: str # מזהה לקוח
idempotency_key: str # מפתח אידמפוטנטי - prevent duplicates
class PaymentResult:
success: bool
gateway_used: str # שער תשלום שנבחר
transaction_id: str # מזהה עסקה
approval_number: str # מספר אישור
shva_reference: str # מספר שב"א
installment_details: dict
Step 4: Implement Gateway Routing
Define routing rules for selecting the optimal gateway:
| Rule |
Priority |
Logic |
Example |
| Cost optimization |
Medium |
Route to cheapest gateway for transaction type |
Small payments to lowest-fee gateway |
| Feature match |
High |
Route based on required features |
Club installments only to Cardcom/Pelecard |
| Availability |
Critical |
Route away from failed/degraded gateways |
If Tranzila is down, failover to Cardcom |
| Volume balancing |
Low |
Distribute load across gateways |
60/40 split between primary and secondary |
| Card type |
High |
Some gateways handle specific cards better |
Diners Club routing |
Routing logic:
def select_gateway(request: PaymentRequest, gateways: list) -> str:
# 1. Filter by feature support (tashlumim type, Bit, etc.)
eligible = [g for g in gateways if g.supports(request)]
# 2. Remove unhealthy gateways
healthy = [g for g in eligible if g.is_healthy()]
# 3. Sort by cost for this transaction type
ranked = sorted(healthy, key=lambda g: g.fee_for(request))
# 4. Return best match (or raise if none available)
return ranked[0] if ranked else raise NoGatewayAvailable()
Step 5: Handle Installments (Tashlumim)
Israeli installment types have specific Shva network rules:
| Type |
Hebrew |
Shva Code |
How It Works |
Who Pays Interest |
| Regular installments |
תשלומים רגילים |
8 |
Merchant gets full amount upfront, bank collects from customer monthly |
Customer (no interest by default) |
| Credit installments |
קרדיט |
2 |
Customer pays bank in installments with interest, merchant gets full amount |
Customer pays interest to bank |
| Club installments |
מועדון |
3 |
Issuer-specific program (Isracard, CAL, Max) |
Varies by program |
| "Payments without interest" |
תשלומים ללא ריבית |
8 |
Merchant subsidizes interest cost |
Merchant absorbs cost |
Implementation notes:
- Maximum installments: typically 36, some gateways limit to 12 or 24
- Minimum per-installment: Shva may enforce minimum amounts per installment
- Installment approval: some installment counts require issuer pre-approval
Step 6: Implement Fallback and Retry Logic
Design resilient payment processing:
# Fallback strategy
GATEWAY_PRIORITY = ["cardcom", "tranzila", "payme"]
async def process_with_fallback(request: PaymentRequest) -> PaymentResult:
last_error = None
for gateway_name in GATEWAY_PRIORITY:
gateway = get_gateway(gateway_name)
if not gateway.is_healthy():
continue # דלג על שער לא זמין
try:
result = await gateway.charge(request)
if result.success:
return result
# Declined by bank -- do NOT retry with another gateway
if result.is_bank_decline():
return result
except GatewayTimeoutError:
last_error = f"{gateway_name} timeout"
continue # נסה שער הבא
except GatewayError as e:
last_error = str(e)
continue
raise AllGatewaysFailedError(last_error)
Important: Never retry a bank decline (customer insufficient funds, stolen card, etc.) with a different gateway. Only retry on gateway technical errors.
Step 7: Ensure Regulatory Compliance
Comply with Bank of Israel and Shva regulations:
| Regulation |
Hebrew |
Requirement |
Impact |
| Transaction data retention |
שמירת נתוני עסקאות |
Transaction data retention, reporting |
Store all transaction details 7 years |
| PCI DSS |
תקן PCI |
Card data security |
Use tokenization, never store full card numbers |
| Shva regulations |
תקנות שב"א |
Clearing and settlement rules |
Adhere to clearing windows and dispute timelines |
| Consumer Protection |
הגנת הצרכן |
Refund rights, clear pricing |
Display installment terms clearly |
| Anti-fraud |
מניעת הונאה |
3D Secure, velocity checks |
Implement 3DS2 for CNP transactions |
Examples
Example 1: Multi-Gateway Setup
User says: "I need to accept payments with installments, with fallback if one gateway goes down"
Actions:
- Assess: Need installments (regular + credit) and high availability
- Compare: Cardcom (primary, full installment support) + Tranzila (fallback)
- Design: Unified PaymentRequest with installment_type field
- Implement: Route installment payments to Cardcom, failover to Tranzila
- Run
python scripts/compare_gateways.py --features installments,recurring
Result: Orchestration layer with primary/fallback routing and installment handling
Example 2: Gateway Migration
User says: "We use Tranzila but want to add PayMe for Bit payments"
Actions:
- Assess: Current Tranzila setup + need Bit support
- Design: Add PayMe as secondary gateway for Bit-eligible transactions
- Route: Bit payments to PayMe, card payments to Tranzila
- Implement: Unified response mapping between both gateway formats
Result: Dual-gateway setup with feature-based routing
Example 3: Cost Optimization
User says: "Which gateway is cheapest for our 500 daily transactions averaging 200 NIS?"
Actions:
- Calculate: Monthly volume = 500 * 30 * 200 = 3,000,000 NIS
- Compare: Run
python scripts/compare_gateways.py --volume 500 --avg-amount 200
- Factor: Installment mix, chargeback rates, settlement timing
- Recommend: Based on total cost of ownership including integration effort
Result: Cost comparison with recommendation based on business profile
Example 4: Installment Configuration
User says: "Customer wants to pay 5,000 NIS in 10 interest-free installments"
Actions:
- Identify: Regular installments (tashlumim regilim), 10 payments of 500 NIS
- Check: Gateway support for 10 installments (all major gateways support this)
- Note: Merchant absorbs interest cost for "interest-free" installments
- Calculate: Merchant cost = typically 1-3% of transaction for interest subsidy
- Implement: Set installments=10, installment_type="regular" in PaymentRequest
Result: Installment payment configured with cost breakdown for merchant
Bundled Resources
Scripts
scripts/compare_gateways.py -- Generates comparison matrix of Israeli payment gateways based on features, fees, and volume. Run: python scripts/compare_gateways.py --help
References
references/gateway-matrix.md -- Detailed feature comparison of Israeli payment gateways: API formats, installment support, recurring billing, hosted pages, settlement timelines, and fee structures. Consult when evaluating or switching gateways.
Gotchas
- Each Israeli payment gateway (Cardcom, Tranzila, Grow) has a completely different API format: Cardcom uses JSON, Tranzila uses form-encoded key-value pairs, and Grow uses multipart/form-data. Agents may apply one gateway's format to another.
- Israeli payment processing requires Israeli business registration (osek murshe/patur). Agents may suggest setting up payment processing before verifying the business has proper registration with the Tax Authority.
- PCI DSS compliance requirements in Israel follow the same international standard, but Israeli acquirers (Isracard, Visa CAL) may have additional local requirements. Agents may generate PCI-compliant code that misses Israeli acquirer-specific fields.
- Bit (Israel's dominant mobile payment) refunds use a different API endpoint than credit card refunds on most gateways. Agents may use the credit card refund endpoint for Bit transactions.
Troubleshooting
Error: "Installment type not supported"
Cause: Requested installment type (credit/club) not available on selected gateway
Solution: Check gateway capabilities in Step 2 table. Club installments only available on Cardcom and Pelecard. Route to appropriate gateway.
Error: "Shva clearing rejected"
Cause: Transaction violates Shva network rules (invalid installment count, amount below minimum)
Solution: Verify installment count is within allowed range. Check minimum per-installment amount. Ensure transaction currency is ILS for domestic cards.
Error: "Gateway timeout on fallback"
Cause: All configured gateways are experiencing issues
Solution: Implement circuit breaker pattern with health checks. Consider adding a third gateway. Monitor gateway status endpoints and alert on degradation.
Error: "Duplicate transaction detected"
Cause: Retry logic sent same payment to multiple gateways
Solution: Always use idempotency keys. Check transaction status before retrying. Never retry bank declines -- only retry gateway technical errors.
1---
2name: israeli-payment-orchestrator
3description: Orchestrate Israeli payment gateways (Cardcom, Tranzila, PayMe, Meshulam, iCredit, Pelecard) with unified routing, fallback, and installments (tashlumim). Use when user asks about multi-gateway payment integration, "slikat kartisim", "tashlumim", payment routing, Shva network, BOI Directive 357, gateway comparison, or building a payment abstraction layer for Israeli merchants. Provides unified API patterns, installment handling, Shva clearing rules, and regulatory compliance. Do NOT use for single gateway setup (use cardcom-payment-gateway or tranzila-payment-gateway instead).
4license: MIT
5version: 1.0.1
6compatibility: Works with Claude Code, Cursor, GitHub Copilot, Windsurf, OpenCode, Codex. Python 3.8+ for helper scripts.
7metadata:
8 source: https://skillmd.com/skills/aibot88/israeli-payment-orchestrator
9---
10
11# Israeli Payment Orchestrator
12
13## Instructions
14
15### Step 1: Assess Payment Requirements
16Ask the user about their payment needs:
17
18| Requirement | Hebrew | Description | Impact on Gateway Choice |
19|-------------|--------|-------------|-------------------------|
20| Installments (tashlumim) | תשלומים | Split payment into monthly installments | Not all gateways support all installment types |
21| Recurring billing | חיוב חוזר | Subscription / standing order | Requires token storage and Shva approval |
22| Multi-currency | רב-מטבעי | Accept NIS + foreign currencies | Limited gateway support for dual currency |
23| Iframe / redirect | דף סליקה | Hosted payment page vs embedded | Affects PCI scope |
24| Bit / Apple Pay | ביט / אפל פיי | Alternative payment methods | Gateway-specific integrations |
25| High volume | נפח גבוה | Over 1,000 transactions/day | Need SLA guarantees and fallback |
26
27### Step 2: Compare Gateways
28Use `scripts/compare_gateways.py` to generate a comparison matrix, or reference the table below:
29
30| Gateway | API Style | Installments | Recurring | Hosted Page | Bit Support | Typical Fee |
31|---------|-----------|-------------|-----------|-------------|-------------|-------------|
32| Cardcom | REST JSON | Full (regular, credit, club) | Yes | Yes (iframe) | No | 0.6-0.8% |
33| Tranzila | REST/Form POST | Regular, credit | Yes | Yes (redirect) | No | 0.5-0.7% |
34| PayMe | REST JSON | Regular, credit | Yes | Yes (iframe) | Yes | 0.7-1.0% |
35| Meshulam | REST JSON | Regular | Yes | Yes (iframe + redirect) | Yes | 0.6-0.9% |
36| iCredit | REST JSON | Regular, credit | Yes | Yes (redirect) | No | 0.5-0.8% |
37| Pelecard | REST JSON | Regular, credit, club | Yes | Yes (iframe) | No | 0.5-0.7% |
38
39Fee notes: Rates are indicative. Actual rates depend on business volume, industry, and negotiation.
40
41### Step 3: Design the Orchestration Layer
42Build a unified payment abstraction:
43
44```python
45# Unified payment interface pattern
46class PaymentRequest:
47 amount: float # סכום - in agorot (NIS cents)
48 currency: str # מטבע - "ILS" default
49 installments: int # תשלומים - 1 = regular, 2-36 = installments
50 installment_type: str # סוג תשלומים - "regular", "credit", "club"
51 card_token: str # טוקן כרטיס - for recurring
52 description: str # תיאור עסקה
53 customer_id: str # מזהה לקוח
54 idempotency_key: str # מפתח אידמפוטנטי - prevent duplicates
55
56class PaymentResult:
57 success: bool
58 gateway_used: str # שער תשלום שנבחר
59 transaction_id: str # מזהה עסקה
60 approval_number: str # מספר אישור
61 shva_reference: str # מספר שב"א
62 installment_details: dict
63```
64
65### Step 4: Implement Gateway Routing
66Define routing rules for selecting the optimal gateway:
67
68| Rule | Priority | Logic | Example |
69|------|----------|-------|---------|
70| Cost optimization | Medium | Route to cheapest gateway for transaction type | Small payments to lowest-fee gateway |
71| Feature match | High | Route based on required features | Club installments only to Cardcom/Pelecard |
72| Availability | Critical | Route away from failed/degraded gateways | If Tranzila is down, failover to Cardcom |
73| Volume balancing | Low | Distribute load across gateways | 60/40 split between primary and secondary |
74| Card type | High | Some gateways handle specific cards better | Diners Club routing |
75
76Routing logic:
77```python
78def select_gateway(request: PaymentRequest, gateways: list) -> str:
79 # 1. Filter by feature support (tashlumim type, Bit, etc.)
80 eligible = [g for g in gateways if g.supports(request)]
81 # 2. Remove unhealthy gateways
82 healthy = [g for g in eligible if g.is_healthy()]
83 # 3. Sort by cost for this transaction type
84 ranked = sorted(healthy, key=lambda g: g.fee_for(request))
85 # 4. Return best match (or raise if none available)
86 return ranked[0] if ranked else raise NoGatewayAvailable()
87```
88
89### Step 5: Handle Installments (Tashlumim)
90Israeli installment types have specific Shva network rules:
91
92| Type | Hebrew | Shva Code | How It Works | Who Pays Interest |
93|------|--------|-----------|--------------|-------------------|
94| Regular installments | תשלומים רגילים | 8 | Merchant gets full amount upfront, bank collects from customer monthly | Customer (no interest by default) |
95| Credit installments | קרדיט | 2 | Customer pays bank in installments with interest, merchant gets full amount | Customer pays interest to bank |
96| Club installments | מועדון | 3 | Issuer-specific program (Isracard, CAL, Max) | Varies by program |
97| "Payments without interest" | תשלומים ללא ריבית | 8 | Merchant subsidizes interest cost | Merchant absorbs cost |
98
99Implementation notes:
100- Maximum installments: typically 36, some gateways limit to 12 or 24
101- Minimum per-installment: Shva may enforce minimum amounts per installment
102- Installment approval: some installment counts require issuer pre-approval
103
104### Step 6: Implement Fallback and Retry Logic
105Design resilient payment processing:
106
107```python
108# Fallback strategy
109GATEWAY_PRIORITY = ["cardcom", "tranzila", "payme"]
110
111async def process_with_fallback(request: PaymentRequest) -> PaymentResult:
112 last_error = None
113 for gateway_name in GATEWAY_PRIORITY:
114 gateway = get_gateway(gateway_name)
115 if not gateway.is_healthy():
116 continue # דלג על שער לא זמין
117 try:
118 result = await gateway.charge(request)
119 if result.success:
120 return result
121 # Declined by bank -- do NOT retry with another gateway
122 if result.is_bank_decline():
123 return result
124 except GatewayTimeoutError:
125 last_error = f"{gateway_name} timeout"
126 continue # נסה שער הבא
127 except GatewayError as e:
128 last_error = str(e)
129 continue
130 raise AllGatewaysFailedError(last_error)
131```
132
133Important: Never retry a **bank decline** (customer insufficient funds, stolen card, etc.) with a different gateway. Only retry on **gateway technical errors**.
134
135### Step 7: Ensure Regulatory Compliance
136Comply with Bank of Israel and Shva regulations:
137
138| Regulation | Hebrew | Requirement | Impact |
139|------------|--------|-------------|--------|
140| Transaction data retention | שמירת נתוני עסקאות | Transaction data retention, reporting | Store all transaction details 7 years |
141| PCI DSS | תקן PCI | Card data security | Use tokenization, never store full card numbers |
142| Shva regulations | תקנות שב"א | Clearing and settlement rules | Adhere to clearing windows and dispute timelines |
143| Consumer Protection | הגנת הצרכן | Refund rights, clear pricing | Display installment terms clearly |
144| Anti-fraud | מניעת הונאה | 3D Secure, velocity checks | Implement 3DS2 for CNP transactions |
145
146## Examples
147
148### Example 1: Multi-Gateway Setup
149User says: "I need to accept payments with installments, with fallback if one gateway goes down"
150Actions:
1511. Assess: Need installments (regular + credit) and high availability
1522. Compare: Cardcom (primary, full installment support) + Tranzila (fallback)
1533. Design: Unified PaymentRequest with installment_type field
1544. Implement: Route installment payments to Cardcom, failover to Tranzila
1555. Run `python scripts/compare_gateways.py --features installments,recurring`
156Result: Orchestration layer with primary/fallback routing and installment handling
157
158### Example 2: Gateway Migration
159User says: "We use Tranzila but want to add PayMe for Bit payments"
160Actions:
1611. Assess: Current Tranzila setup + need Bit support
1622. Design: Add PayMe as secondary gateway for Bit-eligible transactions
1633. Route: Bit payments to PayMe, card payments to Tranzila
1644. Implement: Unified response mapping between both gateway formats
165Result: Dual-gateway setup with feature-based routing
166
167### Example 3: Cost Optimization
168User says: "Which gateway is cheapest for our 500 daily transactions averaging 200 NIS?"
169Actions:
1701. Calculate: Monthly volume = 500 * 30 * 200 = 3,000,000 NIS
1712. Compare: Run `python scripts/compare_gateways.py --volume 500 --avg-amount 200`
1723. Factor: Installment mix, chargeback rates, settlement timing
1734. Recommend: Based on total cost of ownership including integration effort
174Result: Cost comparison with recommendation based on business profile
175
176### Example 4: Installment Configuration
177User says: "Customer wants to pay 5,000 NIS in 10 interest-free installments"
178Actions:
1791. Identify: Regular installments (tashlumim regilim), 10 payments of 500 NIS
1802. Check: Gateway support for 10 installments (all major gateways support this)
1813. Note: Merchant absorbs interest cost for "interest-free" installments
1824. Calculate: Merchant cost = typically 1-3% of transaction for interest subsidy
1835. Implement: Set installments=10, installment_type="regular" in PaymentRequest
184Result: Installment payment configured with cost breakdown for merchant
185
186## Bundled Resources
187
188### Scripts
189- `scripts/compare_gateways.py` -- Generates comparison matrix of Israeli payment gateways based on features, fees, and volume. Run: `python scripts/compare_gateways.py --help`
190
191### References
192- `references/gateway-matrix.md` -- Detailed feature comparison of Israeli payment gateways: API formats, installment support, recurring billing, hosted pages, settlement timelines, and fee structures. Consult when evaluating or switching gateways.
193
194## Gotchas
195- Each Israeli payment gateway (Cardcom, Tranzila, Grow) has a completely different API format: Cardcom uses JSON, Tranzila uses form-encoded key-value pairs, and Grow uses multipart/form-data. Agents may apply one gateway's format to another.
196- Israeli payment processing requires Israeli business registration (osek murshe/patur). Agents may suggest setting up payment processing before verifying the business has proper registration with the Tax Authority.
197- PCI DSS compliance requirements in Israel follow the same international standard, but Israeli acquirers (Isracard, Visa CAL) may have additional local requirements. Agents may generate PCI-compliant code that misses Israeli acquirer-specific fields.
198- Bit (Israel's dominant mobile payment) refunds use a different API endpoint than credit card refunds on most gateways. Agents may use the credit card refund endpoint for Bit transactions.
199
200## Troubleshooting
201
202### Error: "Installment type not supported"
203Cause: Requested installment type (credit/club) not available on selected gateway
204Solution: Check gateway capabilities in Step 2 table. Club installments only available on Cardcom and Pelecard. Route to appropriate gateway.
205
206### Error: "Shva clearing rejected"
207Cause: Transaction violates Shva network rules (invalid installment count, amount below minimum)
208Solution: Verify installment count is within allowed range. Check minimum per-installment amount. Ensure transaction currency is ILS for domestic cards.
209
210### Error: "Gateway timeout on fallback"
211Cause: All configured gateways are experiencing issues
212Solution: Implement circuit breaker pattern with health checks. Consider adding a third gateway. Monitor gateway status endpoints and alert on degradation.
213
214### Error: "Duplicate transaction detected"
215Cause: Retry logic sent same payment to multiple gateways
216Solution: Always use idempotency keys. Check transaction status before retrying. Never retry bank declines -- only retry gateway technical errors.