-
Notifications
You must be signed in to change notification settings - Fork 128
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
Subscriptions methods #236
Conversation
Razorpay.php
Outdated
// Include Requests only if not already defined | ||
if (class_exists('Requests') === false) | ||
{ | ||
require_once __DIR__.'/libs/Requests-1.8.0/library/Requests.php'; | ||
require_once __DIR__.'/vendor/rmccue/requests/library/Requests.php'; |
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.
Please remove require_once DIR.'/vendor/rmccue/requests/library/Requests.php';
and use libs folder to test
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.
M here
demo/authenticationTransaction.php
Outdated
@@ -0,0 +1,45 @@ | |||
<!DOCTYPE html> |
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.
This Demo should come in readme file i guess
Please check with concern person to verify
return $this->request('PATCH', $relativeUrl, $attributes); | ||
} | ||
|
||
public function pendingUpdate() |
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.
please check the working of this function
src/Subscription.php
Outdated
return $this->request('GET', $relativeUrl, null); | ||
} | ||
|
||
public function cancelUpdate() |
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.
please check the exact working of this function
@ankitdas13 Add this link in the readme file for this https://razorpay.com/docs/api/subscriptions/#authentication-transaction |
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.
LGTM
.gitignore
Outdated
@@ -2,4 +2,5 @@ composer.lock | |||
phpunit.xml | |||
vendor/ | |||
libs/ | |||
.idea/ |
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.
Don't modify this file. Please revert your code
src/Subscription.php
Outdated
return $this->request('POST', $relativeUrl, $attributes); | ||
} | ||
|
||
public function deleteOffer($id) |
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.
Rename id to offerId
README.md
Outdated
$subscription = $api->subscription->fetch('sub_82uBGfpFK47AlA')->deleteOffer('offer_JHD834hjbxzhd38d') // Delete an Offer Linked to a Subscription | ||
$subscription = $api->invoice->all(['subscription_id'=>'sub_HvNIkQUz9I5GBA']); // Fetch All Invoices for a Subscription | ||
https://razorpay.com/docs/api/subscriptions/#authentication-transaction // Authentication Transaction | ||
https://razorpay.com/docs/api/subscriptions/#payment-verification // Payment Verification |
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.
Add the functions which is available in the util file with parameters instead of giving this url
README.md
Outdated
$subscription = $api->subscription->fetch('sub_82uBGfpFK47AlA')->deleteOffer('offer_JHD834hjbxzhd38d') // Delete an Offer Linked to a Subscription | ||
$subscription = $api->invoice->all(['subscription_id'=>'sub_HvNIkQUz9I5GBA']); // Fetch All Invoices for a Subscription | ||
//For authentication transaction in subscription please refer this link https://razorpay.com/docs/api/subscriptions/#authentication-transaction | ||
//For payment verification in subscription please refer this link https://razorpay.com/docs/api/subscriptions/#payment-verification |
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.
@ankitdas13 use this verifyPaymentSignature
function from utility class for payment verification
src/Subscription.php
Outdated
return $this->request('POST', $relativeUrl, $attributes); | ||
} | ||
|
||
public function deleteOffer($offer_id) |
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.
@ankitdas13 follow camel casing here and follow variable standards everywhere
src/Subscription.php
Outdated
|
||
public function deleteOffer($offer_id) | ||
{ | ||
$relativeUrl = $this->getEntityUrl() . $this->id.'/'.$offer_id; |
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.
Even here
Adding new methods from sdk and updated the README.md