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

Subscriptions methods #236

Merged
merged 24 commits into from
Oct 7, 2021
Merged

Subscriptions methods #236

merged 24 commits into from
Oct 7, 2021

Conversation

ankitdas13
Copy link
Contributor

Adding new methods from sdk and updated the README.md

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';
Copy link
Contributor

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

@@ -0,0 +1,45 @@
<!DOCTYPE html>
Copy link
Contributor

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()
Copy link
Contributor

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

return $this->request('GET', $relativeUrl, null);
}

public function cancelUpdate()
Copy link
Contributor

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

@HancilSequeira
Copy link
Contributor

Copy link
Contributor

@HancilSequeira HancilSequeira left a 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/
Copy link
Contributor

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

return $this->request('POST', $relativeUrl, $attributes);
}

public function deleteOffer($id)
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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

return $this->request('POST', $relativeUrl, $attributes);
}

public function deleteOffer($offer_id)
Copy link
Contributor

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


public function deleteOffer($offer_id)
{
$relativeUrl = $this->getEntityUrl() . $this->id.'/'.$offer_id;
Copy link
Contributor

Choose a reason for hiding this comment

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

Even here

@HancilSequeira HancilSequeira merged commit a67f0c8 into master Oct 7, 2021
@sofiya02 sofiya02 self-requested a review October 7, 2021 11:50
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.

None yet

3 participants