-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #233 from razorpay/payment-link
payment link end point
- Loading branch information
Showing
6 changed files
with
128 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
namespace Razorpay\Api; | ||
|
||
use Requests; | ||
|
||
|
||
class Payment_link extends Entity | ||
{ | ||
/** | ||
* Creates Payment link . | ||
* | ||
* @param array $attributes | ||
* | ||
* @return Payment_link | ||
*/ | ||
public function create($attributes = array()) | ||
{ | ||
$additionHeader['Content-Type'] = 'application/json'; | ||
|
||
parent::setAdditionHeader($additionHeader) ; | ||
|
||
return parent::create($attributes); | ||
} | ||
|
||
/** | ||
* Fetches Payment link entity with given id | ||
* | ||
* @param string $id | ||
* | ||
* @return Payment_link | ||
*/ | ||
public function fetch($id) | ||
{ | ||
return parent::fetch($id); | ||
} | ||
|
||
/** | ||
* Fetches multiple Payment link with given query options | ||
* | ||
* @param array $options | ||
* | ||
* @return Collection | ||
*/ | ||
public function all($options = array()) | ||
{ | ||
return parent::all($options); | ||
} | ||
|
||
/** | ||
* Cancels Payment link | ||
* | ||
* @return Payment_link | ||
*/ | ||
public function cancel() | ||
{ | ||
$url = $this->getEntityUrl() . $this->id . '/cancel'; | ||
|
||
return $this->request(Requests::POST, $url); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters