-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor digipay gateway #228
Conversation
d90f0fb
to
672019e
Compare
@alissn have you tested these changes? I mean, you should have done a successful payment before merging this PR. |
In our project, we required the use this gateway but old version was not work. All responses returned the following error: {
"result": {
"title": "FAILURE",
"status": 1000,
"message": "عملیات ناموفق بود لطفا مجددا تلاش کنید",
"level": "BLOCKER"
}
} After discussing with the Digipay technical team, updating this driver became necessary. For successful payment testing, we could only test on the staging service using this URL |
] | ||
); | ||
|
||
$body = json_decode($response->getBody()->getContents(), true); | ||
if ($response->getStatusCode() != 200) { | ||
// error has happened | ||
$message = $body['result']['message'] ?? 'خطا در هنگام درخواست برای پرداخت رخ داده است.'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I merged this PR, but this line will not work since $body
not exist, please also fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
Hi,
This PR refactors the
Digipay
gateway to the new version of the API. It includes the following changes:apiPaymentUrl
. Reference: 2.1. Address.apiPaymentUrl
. thepurchase
method to returnredirectUrl
, which the user should redirect to. Reference: 2.5. Response fields.client
properties.\GuzzleHttp\RequestOptions
class.verify
method, passtype
value from request to api url.Receipt
class. Reference: purchase_verify.If further description is needed, feel free to ask!
Documents
Official Document
Persian PDF version