Skip to content

Commit

Permalink
Do not add cardToken to payload if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
mmaymo committed Jan 30, 2025
1 parent f9c612d commit 1bb9a0e
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions resources/js/blocks/molliePaymentMethod.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,19 +179,22 @@ const MollieComponent = (props) => {

useEffect(() => {
const onProcessingPayment = () => {
let data = {
payment_method: activePaymentMethod,
payment_method_title: item.title,
[issuerKey]: selectedIssuer,
billing_phone: inputPhone,
billing_company_billie: inputCompany,
billing_birthdate: inputBirthdate,
};
const tokenVal = jQuery('.mollie-components > input').val()
if (tokenVal) {
data.cardToken = tokenVal;
}
return {
type: responseTypes.SUCCESS,
meta: {
paymentMethodData: {
payment_method: activePaymentMethod,
payment_method_title: item.title,
[issuerKey]: selectedIssuer,
billing_phone: inputPhone,
billing_company_billie: inputCompany,
billing_birthdate: inputBirthdate,
cardToken: tokenVal,
}
paymentMethodData: data
},
};
}
Expand Down Expand Up @@ -432,6 +435,5 @@ const molliePaymentMethod = (useEffect, ajaxUrl, filters, gatewayData, available
},
};
}

export default molliePaymentMethod

0 comments on commit 1bb9a0e

Please sign in to comment.