Skip to content
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

fix getTargetUrl #9

Conversation

Daniyal-Javani
Copy link
Contributor

@Daniyal-Javani Daniyal-Javani commented Jul 14, 2020

Due to not using redirect() helper method the getTargetUrl no longer working.

Motivation and context

related to shetabit/payment#29

Types of changes

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • 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:

Go over all the following points, and put an x in all the boxes that apply.

Please, please, please, don't send your pull request until all of the boxes are ticked. Once your pull request is created, it will trigger a build on our continuous integration server to make sure your tests and code style pass.

  • 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.

Please let me know if the PR needs any changes.

*
* @return string target URL
*/
public function getTargetUrl(): string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this method? you can run toJson method and retrieve redirection form in JSON format.
as you know we sometimes we redirect to bank page using POST method, so getTargetUrl is not suitable here.
it's better to get JSON format and send the suitable POST or GET request according to it.

Copy link
Member

@khanzadimahdi khanzadimahdi Jul 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could use use render method to generate redirection form (i think you use laravel)

// in laravel controller, the below code renders a redirection form and pass it as Laravel's view
return $purchasedPayment->pay()->render();

for restful API you could use toJson method too

@khanzadimahdi
Copy link
Member

please continue this pull request if you think this is a new feature or some bugs has resolved in your commits. thanks for your contributions.

@Daniyal-Javani
Copy link
Contributor Author

Thanks, I haven't noticed the toJson method.
Thanks again for updating shetabit/payment#29

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.

2 participants