-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Conversation
… & transaction ID
…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.
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.
👍 assuming it works
NSDictionary *sourceMasterpass = sourceCard[@"masterpass"]; | ||
XCTAssertNotNil(sourceMasterpass); | ||
XCTAssertEqualObjects(sourceMasterpass[@"cart_id"], @"12345678"); | ||
XCTAssertEqualObjects(sourceMasterpass[@"transaction_id"], @"87654321"); |
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 wonder if we can be even more strict here and compare the dictionary as a whole:
XCTAssertEqualObjects(params.additionalAPIParameters, @{@"card": {
@"masterpass": { ... }
}
})
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 suspect we'll get better assertion failures by flattening it out like this. I was also cribbing off testCardParamsWithCard
above
…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.
Summary
Adds a new
STPSourceParams
constructor, which creates necessary params to create acard source using the Masterpass
cartId
andtransactionId
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 thecartId
andtransactionId
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