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

[CODE REVIEW]Feature/SPRO-48 Support Braintree Payment Extensions #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Dmitry-Pryshchepa
Copy link

No description provided.

Comment on lines 60 to 64
$stateData = $paymentInfo->getAdditionalInformation('stateData'); // AssignObserver::STATE_DATA
if (is_array($stateData)) {
$stateData['storePaymentMethod'] = true; // AssignObserver::STORE_PAYMENT_METHOD
$paymentInfo->setAdditionalInformation('stateData', $stateData);
}
Copy link

Choose a reason for hiding this comment

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

Are you sure it is related to Braintree?

Comment on lines +76 to +68
$result = $this->getPaymentNonceCommand->execute(
['public_hash' => $publicHash, 'customer_id' => $customerId]
)->get();
Copy link

Choose a reason for hiding this comment

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

We don't need to fetch paymentMethodNonce, we already have it: $paymentMethodToken

Copy link
Author

Choose a reason for hiding this comment

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

Just checked; we do need the nonce

Comment on lines +82 to +75
$paymentModel->setAdditionalInformation(
DataAssignObserver::PAYMENT_METHOD_NONCE,
$result['paymentMethodNonce']
);
Copy link

Choose a reason for hiding this comment

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

Suggested change
$paymentModel->setAdditionalInformation(
DataAssignObserver::PAYMENT_METHOD_NONCE,
$result['paymentMethodNonce']
);
$paymentModel->setAdditionalInformation(DataAssignObserver::PAYMENT_METHOD_NONCE, $paymentMethodToken);

composer.json Outdated
"authors": [
{
"name": "SUBSCRIBE PRO INC",
"homepage": "http://www.subscribepro.com"
Copy link

Choose a reason for hiding this comment

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

Please, update to https://www.subscribepro.com

"Swarming\\SubscribeProBraintree\\": ""
}
}
}
Copy link

Choose a reason for hiding this comment

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

Please, fix JSON format in the file.

Remove DataAssignObserver, rework TokenAssigner observer, refine composer.json
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