-
Notifications
You must be signed in to change notification settings - Fork 39
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
Adds Subscriptions and VA API's Support #12
Conversation
mayankamencherla
commented
Nov 3, 2017
•
edited by ankitdas13
Loading
edited by ankitdas13
- Create Plan
- Fetch Plan
- Fetch All plans
- Create subscription
- Fetch subscription
- Fetch all subscriptions
- Cancelling subscription
- Create addon
- Fetch addon
- Delete addon
- Create VA
- Fetch VA
- Edit VA
- Fetch all VAs
- Close VA
- Fetch VA payments
- Fetch payment bank transfer
- Create payment Transfer
- Fetch all payment transfers
- Create direct transfer
- Create transfer reversals
- Fetch transfer
- Edit transfer
@sunnyagg Can we just use edit VA for close? In API, we use the same route for both features. |
|
||
public Subscription Cancel() | ||
{ | ||
string relativeUrl = GetEntityUrl() + "/" + this["id"] + "/cancel"; |
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.
Need to add constructor for this to create Subscription with given ID ?
src/VirtualAccount.cs
Outdated
|
||
public VirtualAccount Edit(Dictionary<string, object> data) | ||
{ | ||
string relativeUrl = string.Format("virtual_accounts/{0}", this["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.
same here as well
} | ||
|
||
Subscription subscription = TestCreateSubscription(); | ||
|
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.
Create a new subscription with the id of created subscription
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.
Still not fixed
test/Helper.cs
Outdated
return addon2; | ||
} | ||
|
||
// TODO: Need to re-test 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.
remove ?
src/Addon.cs
Outdated
{ | ||
string relativeUrl = GetEntityUrl() + "/" + this["id"]; | ||
List<Entity> entities = Request(relativeUrl, HttpMethod.Delete, null); | ||
return (Addon)entities[0]; |
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 will throw NullRef.
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.
public void Delete()
{
string relativeUrl = GetEntityUrl() + "/" + this["id"];
Request(relativeUrl, HttpMethod.Delete, null);
}
test/Helper.cs
Outdated
// TODO: Need to re-test this | ||
public static Addon TestDeleteAddon() | ||
{ | ||
Addon addon = Helper.client.Addon.All()[0]; |
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.
we should be able to delete from a addon id. need to add a constructor to create addon with given Id
test/Helper.cs
Outdated
data = JsonConvert.DeserializeObject<Dictionary<string, object>>(json); | ||
} | ||
|
||
return va.Edit(data); |
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.
Edit by creating a new VA with id of newly created va
test/Helper.cs
Outdated
{ | ||
VirtualAccount va = VirtualAccountCreateTest(); | ||
|
||
return va.Close(); |
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.
same here, close by creating a new va with id of newly created va
test/Helper.cs
Outdated
{ | ||
VirtualAccount va = VirtualAccountCreateTest(); | ||
|
||
return va.Payments(); |
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.
same here as well
test/Helper.cs
Outdated
{ | ||
Subscription subscription = TestCreateSubscription(); | ||
|
||
return subscription.Cancel(); |
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.
same here, cancel on a object created with the id of existing sub