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

Added Client.customerSubscriptions #51

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

stevensnoeijen
Copy link

Added concept for Client.customerSubscriptions to create, getById and delete (cancel) subscriptions with tests.

For this I also added:

  • Selenium to fully automatic test a payment. I needed this to able to test the creation of a subscription (which requires a first payment).

  • DeleteWithResponse, due to the Delete-concept would not resolve an response object. I needed this because the cancelation of a customerSubscription is done by a DELETE method that have a response when the enddate is.

stevensnoeijen added 5 commits March 15, 2018 09:44
added: DeleteWithResponse concept
added: Client.customerSubscriptions with create, getById and delete with tests
added: selenium for test in CustomerSubscriptionsIntegrationTest
@stevensnoeijen
Copy link
Author

looks like Travis dont like that I'm using selenium, ill check this soon

import nl.stil4m.mollie.concepts.Refunds;
import nl.stil4m.mollie.concepts.PaymentRefunds;
import nl.stil4m.mollie.concepts.Status;
import nl.stil4m.mollie.concepts.*;
Copy link
Owner

Choose a reason for hiding this comment

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

Please do not use * imports

private Optional<String> webhookUrl;

public CreateSubscription(@Nonnull Double amount, @Nullable Integer times, @Nonnull String interval, @Nullable String startDate, @Nonnull String description, @Nullable String method, @Nullable String webhookUrl) {
super();
Copy link
Owner

Choose a reason for hiding this comment

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

Is this super() call required?

//open paymentUrl and set it to paid

//setup selenium
WebDriver driver = new ChromeDriver();
Copy link
Owner

Choose a reason for hiding this comment

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

Shouldn't this belong to the before?


//check if payment is complete
payment = customerPayments.get(payment.getId()).getData();//get new version of payment
if (!payment.getStatus().equals("paid")) {
Copy link
Owner

Choose a reason for hiding this comment

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

Would it be a good interface to add a isPaid() method to payment? (which will be ignored in the JSON serialization)

Copy link
Author

Choose a reason for hiding this comment

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

I don't agree to just add isPaid(), because a payment can have 9 types of statuses (source: https://www.mollie.com/en/docs/status)
I would suggest making it an enum, what do you think about that?

@stevensnoeijen
Copy link
Author

I'm quite bussy atm, I will react on this in a few weeks...

added project's nb-configuration for netbeans so that imports wont *
fixed imports *
removed unneeded super()
moved Selenium Webdriver setup to @BeforeClass and @before
@stevensnoeijen
Copy link
Author

stevensnoeijen commented May 2, 2018

Ok, i've processed your requests expect one, please see my answer above.
Travis still dont like the selenium driver, can you look at this https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-the-Chrome-addon-in-the-headless-modemaybe this can fix that?

categorised all libs by test
@stevensnoeijen
Copy link
Author

bump

stevensnoeijen added 2 commits June 7, 2018 14:03
…ings

changed: added Payment.failedDatetime
changed: JsonIgnoreProperies(ignoreUnknown = true) for payment and Refund
fixed: ignore IssuersInegrationTest by ignoring the current failing test, due that issuers where changed?
added: test for PaymentIntegrationTest by payment.status paid, cancelled, refunded, expired
fixed: RefundIntegerationTest due that there is a refund payment it wont return 0 results anymore
stevensnoeijen added 3 commits June 12, 2018 16:56
added: gitignore nb-configuration.xml (netbeans)
changed: import in DynamicClient
changed: removed @author from javadoc
changed: import order to match:
com.*

nl.*

org.*

javax.*

java.*

other imports

other static imports
@stevensnoeijen
Copy link
Author

In the last week I also added the changeback api in client.paymentChargebacks and client.chargebacks, but without tests, because this isnt testable with the current mollie test api.

@stevensnoeijen
Copy link
Author

bump.
But test (IT) fail because mollie changed their response somewhat and some fail because some id's (like payment) are probably cleaned up. And Travis dont like selenium tests.
What would you suggest?

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.

2 participants