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

Checkout: Send billing info to transaction endpoint #847

Merged
merged 2 commits into from
Nov 27, 2015

Conversation

janm6k
Copy link
Contributor

@janm6k janm6k commented Nov 26, 2015

For some reason we were not passing these fields along before. These fields are not PCI DSS covered, so we can freely pass them to backend.

To test, make purchase and observe data sent to the /transactions endpoint.

@janm6k janm6k added [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. [Feature] Checkout The checkout screen and process for purchases made on WordPress.com. labels Nov 26, 2015
@janm6k janm6k self-assigned this Nov 26, 2015
var validation = validateCardDetails( this._initialData.payment.newCardDetails );
const newCardDetails = this._initialData.payment.newCardDetails,
validation = validateCardDetails( newCardDetails );

Copy link
Contributor

Choose a reason for hiding this comment

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

Absolutely not mandatory but you could use destructuring here:

const { newCardDetails } = this._initialData.payment,
  validation = validateCardDetails( newCardDetails );

This saves a few characters :P.

@stephanethomas
Copy link
Contributor

I know this isn't part of the original issue but could you add a semicolon here while you're at it?

@stephanethomas
Copy link
Contributor

Tested and works fine - we now send the following payment parameters:

payment[payment_method]:WPCOM_Billing_MoneyPress_Paygate
payment[payment_key]:pg_blablablalabla
payment[name]:John Doe
payment[country]:US
payment[zip]:94140

I've made a few suggestions but otherwise this is good to go.

@stephanethomas stephanethomas added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Nov 26, 2015
@janm6k janm6k force-pushed the update/send-billing-info-to-transaction-endpoint branch from ec685c8 to 4eae543 Compare November 27, 2015 09:36
janm6k added a commit that referenced this pull request Nov 27, 2015
…ransaction-endpoint

Checkout: Send billing info to transaction endpoint
@janm6k janm6k merged commit 915d1e3 into master Nov 27, 2015
@janm6k
Copy link
Contributor Author

janm6k commented Nov 27, 2015

Thanks @stephanethomas for the suggestions, I have not yet used much of the ES6 features, this is great way to learn it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Checkout The checkout screen and process for purchases made on WordPress.com.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants