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

[iOS] Fix issue when paymentToken is not present on real iOS device. #37

Merged
merged 4 commits into from
Jan 13, 2018
Merged

[iOS] Fix issue when paymentToken is not present on real iOS device. #37

merged 4 commits into from
Jan 13, 2018

Conversation

Andreyco
Copy link
Collaborator

Other changes:

  • this commit unifies responses for iOS simulator and real iOS device
  • serializedPaymentData is no longer present. Data is always deserialised.
  • add some Flow types and fix some (e.g object -> Object)

Fixes #30

Other changes:
- this commit unifies responses for iOS simulator and real iOS device
- `serializedPaymentData` is no longer present. Data is always deserialised.
- add some Flow types and fix some (e.g `object` -> `Object`)
@Andreyco Andreyco changed the title Fix issue when paymentToken is not present on real iOS device. [iOS] Fix issue when paymentToken is not present on real iOS device. Oct 30, 2017
Copy link
Owner

@naoufal naoufal left a comment

Choose a reason for hiding this comment

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

@Andreyco Nice work! I left a few comments. Once those changes are in, we'll be set for a merge.

@@ -54,6 +54,18 @@ import {
SUPPORTED_METHOD_NAME
} from './constants';

type PaymentDetailsIOS = {
Copy link
Owner

Choose a reason for hiding this comment

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

👍 Good call

Let's move these to the already existing types.js file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

const {
paymentData: serializedPaymentData,
Copy link
Owner

@naoufal naoufal Oct 31, 2017

Choose a reason for hiding this comment

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

Let's not refer to serializedPaymentData as paymentData even if we'll have a type for it -- It's likely to stump developers not using flow.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure I understand your advice here... Could you elaborate?


return {
paymentData: isSimulator ? null : JSON.parse(serializedPaymentData),
Copy link
Owner

Choose a reason for hiding this comment

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

I could see this stumping some people. Could you update the README to warn users of the behaviour in TEST.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, documentation is improved.

@Andreyco
Copy link
Collaborator Author

Andreyco commented Nov 3, 2017

Sorry for being unresponsive in past days. Will take a look at those during this weekend. Appreciate your time here.

@campierce88
Copy link

any word on this pr?

@naoufal naoufal merged commit 5254df6 into naoufal:master Jan 13, 2018
@naoufal naoufal mentioned this pull request Jan 13, 2018
riso pushed a commit to smarkets/react-native-payments that referenced this pull request Aug 15, 2019
naoufal#37)

* Fix issue when `paymentToken` is not present on real iOS device.
Other changes:
- this commit unifies responses for iOS simulator and real iOS device
- `serializedPaymentData` is no longer present. Data is always deserialised.
- add some Flow types and fix some (e.g `object` -> `Object`)

* Move type definition into dedicated file.

* [Docs] Mention `paymentData` inconsistencies when running Apple Pay on device vs simulator

* [Docs] Add `Testing Payments` section and advise user to test in production and real device.
tprata pushed a commit to tprata/react-native-payments that referenced this pull request Nov 23, 2019
naoufal#37)

* Fix issue when `paymentToken` is not present on real iOS device.
Other changes:
- this commit unifies responses for iOS simulator and real iOS device
- `serializedPaymentData` is no longer present. Data is always deserialised.
- add some Flow types and fix some (e.g `object` -> `Object`)

* Move type definition into dedicated file.

* [Docs] Mention `paymentData` inconsistencies when running Apple Pay on device vs simulator

* [Docs] Add `Testing Payments` section and advise user to test in production and real device.
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.

[iOS] paymentToken not present on real device
3 participants