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

Adds Subscriptions and VA API's Support #12

Merged
merged 14 commits into from
Nov 28, 2017
Merged

Adds Subscriptions and VA API's Support #12

merged 14 commits into from
Nov 28, 2017

Conversation

mayankamencherla
Copy link
Contributor

@mayankamencherla mayankamencherla commented Nov 3, 2017

  • 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

@mayankamencherla mayankamencherla added this to the Nov-S1 milestone Nov 3, 2017
@mayankamencherla mayankamencherla self-assigned this Nov 3, 2017
@mayankamencherla
Copy link
Contributor Author

@sunnyagg Can we just use edit VA for close? In API, we use the same route for both features.

@sunnyagg sunnyagg changed the title New apis Adds Subscriptions and VA API's Support Nov 6, 2017

public Subscription Cancel()
{
string relativeUrl = GetEntityUrl() + "/" + this["id"] + "/cancel";
Copy link
Collaborator

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 ?


public VirtualAccount Edit(Dictionary<string, object> data)
{
string relativeUrl = string.Format("virtual_accounts/{0}", this["id"]);
Copy link
Collaborator

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();

Copy link
Collaborator

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

Copy link
Collaborator

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

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];
Copy link
Collaborator

Choose a reason for hiding this comment

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

this will throw NullRef.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sunnyagg

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];
Copy link
Collaborator

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);
Copy link
Collaborator

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

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

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

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

@sunnyagg sunnyagg merged commit 62c5787 into master Nov 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants