Skip to content

Allow supplying custom card information, fixes #213, #40 #221

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

Merged
merged 4 commits into from
Jul 23, 2021
Merged

Conversation

jonasbark
Copy link
Member

Yes, it's not perfect due to creating a fake Android / iOS native view (not added to the view hierarchy) but doing it properly would require major refactoring on the React Native side as well. Please tell me if you have a better idea 👍

Copy link
Member

@remonh87 remonh87 left a comment

Choose a reason for hiding this comment

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

I pre approve it with the believe you check my comments so I don’t prevent you from merging it.


import '../config.dart';

class CustomCardPaymentScreen extends StatefulWidget {
Copy link
Member

Choose a reason for hiding this comment

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

I personally think we should not add an example for this. Reason is that I noticed not a lot of people understand the seriousness of PCI complaince and not a lot read the docs.

Copy link
Member Author

Choose a reason for hiding this comment

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

I disagree - it's a very important part for Android users that cannot update to the latest Flutter, not mentioning that it's not even fixed properly there yet

Copy link
Member Author

Choose a reason for hiding this comment

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

plus the CardField still has limited styling capabilities

Copy link
Member

Choose a reason for hiding this comment

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

I agree with @remonh87. We should be careful about making this so open. People will go and copy this code and use it in their apps without understanding completely the consequences of it

Copy link
Member Author

Choose a reason for hiding this comment

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

so what do you propose? what are the alternatives?

children: [
Padding(
padding: EdgeInsets.all(16),
child: Text(
Copy link
Member

Choose a reason for hiding this comment

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

Or if you feel the need to add an example add a huge disclaimer in the text e.g.: Using the method dangerouslyUpdateCArdDetails implies that you are not using the PCI compliant native Stripe elements. You need to arrange PCI compliance within your organisation for more info see: “ https://stripe.com/en-se/guides/pci-compliance”

Copy link
Member Author

Choose a reason for hiding this comment

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

it's part of the method documentation and method name itself - I feel that that's enough

Copy link
Member

Choose a reason for hiding this comment

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

Add in the header plus menu entry “warning not PCI compliant”

@@ -28,6 +29,10 @@ class Example {
title: 'Card payment without webhooks',
builder: (c) => NoWebhookPaymentScreen(),
),
Example(
title: 'Card payment with Flutter native card input',
Copy link
Member

Choose a reason for hiding this comment

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

Maybe add here the term (PCI compliant)

Copy link
Member Author

Choose a reason for hiding this comment

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

what exactly do you mean? Do you mean to add "(not PCI compliant)"?

/// PCI compliance requirements. Make sure that you're not mistakenly logging
/// or storing full card details! See the docs for
/// details: https://stripe.com/docs/security/guide#validating-pci-compliance
Future<void> dangerouslyUpdateCardDetails(CardDetails card) async {
Copy link
Member

Choose a reason for hiding this comment

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

👍

@remonh87 remonh87 merged commit e50d4a5 into main Jul 23, 2021
@remonh87 remonh87 deleted the create_card branch July 23, 2021 18:05
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