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

Add Masterpass to STPSourceParams, allowing Sources to be created #928

Merged
merged 6 commits into from Apr 17, 2018

Conversation

danj-stripe
Copy link
Contributor

Summary

Adds a new STPSourceParams constructor, which creates necessary params to create a
card source using the Masterpass cartId and transactionId

Motivation

Allowing integration with Masterpass SDK. Client apps must handle all of the integration
with the Masterpass SDK. However, once they've done that, a successful
MCCCheckoutResponse returned by that framework will be populated with the cartId and
transactionId necessary to integrate with Stripe.

see also stripe/stripe-android#549

Testing

Basic unit test + manually running a functional test. Larry and I worked together to
generate cartId + transactionId, and ran them through the functional test.
Successfully created src_1CI1AkDAu10Yox5RoAvqOE9U

I've also slightly improved the VCO (#889) tests to reach parity

bdorfman-stripe and others added 5 commits April 17, 2018 14:45
…on id and publishable key

These are not re-usable, so you need to provide new values every time the test is run.
I wish I had a better testing story here, but this is what we've come up with so far.
This moves the hardcoded test for VCO out of a private branch I had, and at least puts
it into master, even if it's disabled.

The other test basically just ensures that dictionaries work correctly, but it'll also
hopefully help guard against unintentionally breaking the format of the payload.
Copy link
Contributor

@joeydong-stripe joeydong-stripe left a comment

Choose a reason for hiding this comment

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

👍 assuming it works

NSDictionary *sourceMasterpass = sourceCard[@"masterpass"];
XCTAssertNotNil(sourceMasterpass);
XCTAssertEqualObjects(sourceMasterpass[@"cart_id"], @"12345678");
XCTAssertEqualObjects(sourceMasterpass[@"transaction_id"], @"87654321");
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if we can be even more strict here and compare the dictionary as a whole:

XCTAssertEqualObjects(params.additionalAPIParameters, @{@"card": {
    @"masterpass": { ... }
  }
})

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suspect we'll get better assertion failures by flattening it out like this. I was also cribbing off testCardParamsWithCard above

@danj-stripe danj-stripe merged commit 6b5828b into master Apr 17, 2018
@danj-stripe danj-stripe deleted the danj/feature/masterpass branch April 17, 2018 22:47
danj-stripe added a commit that referenced this pull request Apr 24, 2018
…v0.9.2

v0.9.2 seems to add some anchor tags for Protocols & Categories, otherwise I just
see the new content from #928 and then new version numbers and dates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants