-
-
Notifications
You must be signed in to change notification settings - Fork 20
Fix Resource __repr__ method #3
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
Open
fedetorre
wants to merge
39
commits into
killbill:master
Choose a base branch
from
fedetorre:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
14a13cf
Fix Resource rep method
115a10e
Add payment method resource
7d41f82
Added default value for user header
f785e94
Added finder method for account
e7cd7e3
Added update method for account api
1082ae8
Modification required by Pierre
38c0dd7
Merge remote-tracking branch 'upstream/master'
2117a49
Fix put request.
b118b84
Added destroy call for payment method.
e3719aa
Added destroy call for payment method.
7370e56
Added destroy call for payment method.
d5d0f45
Fix payment method set_default.
ba8e5a3
Fix put method in resource
20655de
Fix set_default method in payment method
95b7cdb
pep8
833f53e
Fix set_default method in payment method
2992dce
Removed copyright of Quentral.
135710c
Added endpoint for catalog and plan details
26bb45e
Added endpoint for catalog and plan details
83ab80f
Added bundle
95cfc79
Fix plan detail serialization
1b77937
Fix account update method.
a298e53
Added change_plan method for subscription
dfedd45
Add subscription finder method.
6cad122
Added list invoices for account API endpoint
5a582f7
Added invoice class
84b28be
Added invoice class
7464aa6
Fix options
eac99a6
Fix invoice pdf response
32af48d
Added full catalog endpoint
aff77fe
Added refresh query parameter to payment method resource
af62e05
Add custom fields for subscription
f8267fb
Add custom fields for subscription
68a97da
Add custom fields for subscription
30595b2
Add custom fields for subscription
ba98694
Add custom fields for subscription
1dd16d8
Add custom fields for subscription
946e94e
Add custom fields for subscription
099666f
Fix catalog json format
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,59 @@ | ||
| # | ||
| # Copyright 2018 Quentral S.r.l. | ||
|
||
| # Copyright 2014-2018 The Billing Project, LLC | ||
| # | ||
| # The Billing Project, LLC licenses this file to you under the Apache License, version 2.0 | ||
| # (the "License"); you may not use this file except in compliance with the | ||
| # License. You may obtain a copy of the License at: | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
| # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
| # License for the specific language governing permissions and limitations | ||
| # under the License. | ||
| # | ||
| import killbill | ||
|
|
||
|
|
||
| class PaymentMethod(killbill.Resource): | ||
| KILLBILL_API_PAYMENT_METHODS_PREFIX = killbill.Resource.KILLBILL_API_PREFIX + '/paymentMethods' | ||
|
|
||
| def __init__(self, **d): | ||
| super(PaymentMethod, self).__init__(d) | ||
|
|
||
| def create(self, is_default=True, user=killbill.user, reason=None, comment=None, **options): | ||
| created_payment_method = self.post("%s/%s/paymentMethods" % | ||
| (killbill.Account.KILLBILL_API_ACCOUNTS_PREFIX, self.accountId), | ||
| self.to_json(), | ||
| {'isDefault': is_default}, | ||
| self.build_options( | ||
| user=user, | ||
| reason=reason, | ||
| comment=comment, | ||
| **options | ||
| )) | ||
| return self.refresh(created_payment_method, **options) | ||
|
|
||
| def set_default(self, user=killbill.user, reason=None, comment=None, **options): | ||
| set_default = self.put("%s/%s/paymentMethods/%s/setDefault" % | ||
| (killbill.Account.KILLBILL_API_ACCOUNTS_PREFIX, | ||
| self.accountId, self.paymentMethodId), | ||
| {}, | ||
| {}, | ||
| self.build_options( | ||
| user=user, | ||
| reason=reason, | ||
| comment=comment, | ||
| **options | ||
| )) | ||
| return self.refresh(set_default, **options) | ||
|
|
||
| @classmethod | ||
| def find_all_by_account_id(cls, account_id, with_plugin_info=False, **options): | ||
| relative_url = "%s/%s/paymentMethods" % (killbill.Account.KILLBILL_API_ACCOUNTS_PREFIX, account_id) | ||
| query_params = { | ||
| 'withPluginInfo': with_plugin_info | ||
| } | ||
| return cls.get(relative_url, query_params, cls.build_options(**options)) | ||
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Sorry if I wasn't clear: we require a full copyright assignment for contributions (i.e. single copyright line to The Billing Project, LLC). This is to avoid potential problems in the future (e.g. future claims).
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.
I've seen in the other files that the copy is shared also with other companies (Groupon ecc..) that are involved in the library creation. Considering that I've updated the library during the work time of Quentral s.r.l., I need to check with my CEO if is it fine to let the copy only to The Billing Project, LLC.
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.
The companies currently listed are the major sponsors of the project.
We insist on a full copyright assignment, especially on such small changes, because our project doesn't have the resources to track down individual authors for a license to redistribute the code.
I know this is a bit annoying but it is to make our life, as maintainers, easier, and to protect the project moving forward.
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.
I'm not sure this contribute will become a "small change" (I have to add some other classes and methods in the near future), but I talked yesterday with my CEO and it is fine to remove our copy line.
In the last commit you find the line removed.