Skip to content

Add Referer header to Zibal requests - #362

Merged
khanzadimahdi merged 3 commits into
shetabit:masterfrom
AzadGh95:patch-1
Sep 4, 2026
Merged

Add Referer header to Zibal requests#362
khanzadimahdi merged 3 commits into
shetabit:masterfrom
AzadGh95:patch-1

Conversation

@AzadGh95

@AzadGh95 AzadGh95 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Description

Added configurable Referer support to Zibal payment requests.

The referer option is now available in the Zibal driver configuration and defaults to null. When configured, it is sent as the Referer header in both purchase and verification requests; otherwise, the header is omitted.

Motivation and context

Zibal requires a Referer header in payment requests by September 11 (20 Shahrivar). Making the value configurable lets applications provide their approved domain without coupling the driver to Laravel’s app.url configuration.

Responsible team: Backend Team

How has this been tested?

Added unit tests covering both Zibal purchase and verification requests:

  • The configured referer value is sent as the Referer header.
  • The header is omitted when referer remains at its default null value.

Screenshots (if appropriate)

Not applicable.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have read the CONTRIBUTING document.
  • My pull request addresses exactly one patch/feature.
  • I have created a branch for this patch/feature.
  • Each individual commit in the pull request is meaningful.
  • I have added tests to cover my changes.
  • If my change requires a change to the documentation, I have updated it accordingly.

According to Zibal's latest update, we need to add the `Referer` header to Zibal requests by September 11 (20 Shahrivar).
https://zib.al/UWHS3PC
@khanzadimahdi

Copy link
Copy Markdown
Member

could you please fix the failed pipelines?

hint: this package is not a laravel package but a pure PHP package. Laravel / symfony or any functions are not available in this package. you can rely on the config object that is injected to the driver.

Comment thread src/Drivers/Zibal/Zibal.php Outdated
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (master@e601a55). Learn more about missing BASE report.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #362   +/-   ##
=========================================
  Coverage          ?   79.61%           
  Complexity        ?     1041           
=========================================
  Files             ?       65           
  Lines             ?     5499           
  Branches          ?        0           
=========================================
  Hits              ?     4378           
  Misses            ?     1121           
  Partials          ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@khanzadimahdi
khanzadimahdi merged commit d00b95e into shetabit:master Sep 4, 2026
7 checks passed
@AzadGh95
AzadGh95 deleted the patch-1 branch September 4, 2026 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants