Skip to content

Commit

Permalink
MPGS-590: Remove unnecessary error handling for SimplifyCommerce.host…
Browse files Browse the repository at this point in the history
…edPayments() callback
  • Loading branch information
riversy committed Nov 5, 2021
1 parent 062611c commit b161c10
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions views/js/simplify.embedded.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,22 +302,13 @@ $(function () {
/**
* Payment initialization
*/
var hostedPaymentsOnject = SimplifyCommerce.hostedPayments(
var hostedPaymentsObject = SimplifyCommerce.hostedPayments(
paymentCallback,
window.getEmbeddedConfig()
);
hostedPaymentsOnject.closeOnCompletion();
hostedPaymentsObject.closeOnCompletion();

function paymentCallback(response) {
if (response && response.length > 0 && response[0].error) {
setState({
paymentError: response[0].error,
});

hostedPaymentsOnject.enablePayBtn();
return;
}

if (response && response.cardToken) {
elements
.paymentForm
Expand Down

0 comments on commit b161c10

Please sign in to comment.