Skip to content

Conversation

@runticle
Copy link
Contributor

Adds the stripe function confirmSetupIntent. Use in project as

import { Intents } from "react-native-easy-payments"

await Intents.confirmCardSetup(config, cardParams, callback)

@runticle
Copy link
Contributor Author

Should I actually call it confirmSetupIntent to match with stripe do you think?

break;
}
case STPPaymentHandlerActionStatusSucceeded: {
completion(setupIntent.paymentMethodID, nil);
Copy link
Member

Choose a reason for hiding this comment

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

Nice, so we have validated that we can get the method ID out of this method

js/index.js Outdated
@@ -1,2 +1,3 @@
export { default as PaymentRequest } from './PaymentRequest';
export { PKPaymentButton } from './PKPaymentButton';
export { Intents } from './Intents';
Copy link
Member

Choose a reason for hiding this comment

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

Nice, I like it. Maybe better to do an export default in Intents.js and then export { default as Intents } here. Saves you embedding everything inside a single object

cardParams: (NSDictionary *)cardParams
callback: (RCTResponseSenderBlock)callback)
{
NSString *merchantId = methodData[@"merchantIdentifier"];
Copy link
Member

Choose a reason for hiding this comment

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

merchantId is pk_test_... right?

card.expYear = [RCTConvert NSNumber:cardParams[@"expYear"]];
card.expMonth = [RCTConvert NSNumber:cardParams[@"expMonth"]];
card.cvc = [RCTConvert NSString:cardParams[@"cvc"]];
STPPaymentMethodParams *paymentMethodParams = [STPPaymentMethodParams paramsWithCard:card billingDetails:nil metadata:nil];
Copy link
Member

Choose a reason for hiding this comment

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

Maybe here, paramsWithCard could potentially be paramsWithToken

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nabilfreeman and others added 30 commits November 15, 2020 19:51
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.

3 participants