Skip to content

Add setup intents#2

Open
runticle wants to merge 58 commits intomasterfrom
add-setup-intents
Open

Add setup intents#2
runticle wants to merge 58 commits intomasterfrom
add-setup-intents

Conversation

@runticle
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

Comment thread ios/GatewayManager.m Outdated
Comment thread ios/GatewayManager.m
Comment thread ios/GatewayManager.m
break;
}
case STPPaymentHandlerActionStatusSucceeded: {
completion(setupIntent.paymentMethodID, nil);
Copy link
Copy Markdown
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

Comment thread js/Intents/index.js Outdated
Comment thread js/index.js Outdated
@@ -1,2 +1,3 @@
export { default as PaymentRequest } from './PaymentRequest';
export { PKPaymentButton } from './PKPaymentButton';
export { Intents } from './Intents'; No newline at end of file
Copy link
Copy Markdown
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

Comment thread ios/GatewayManager.m Outdated
Comment thread ios/ReactNativePayments.m
cardParams: (NSDictionary *)cardParams
callback: (RCTResponseSenderBlock)callback)
{
NSString *merchantId = methodData[@"merchantIdentifier"];
Copy link
Copy Markdown
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?

Comment thread ios/GatewayManager.m Outdated
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
Copy Markdown
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
Copy Markdown
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.

2 participants