You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the paymentform.jsx file, the useRef does not seem to be used (see source below).
Therefore cardholderName?.current?.value will always be null.
Why not provide a proper working example?
Moreover, you are mentioning in a comment (see source below):
These fields are optional for Sandbox but mandatory for production integration
Which are those fields ? Are you referring to both card-holder and card-billing-address-country. If they are both mandatory why are you only passing card-holder (with null value though)?
This is really frustrating to deal with your sample code. Each one seems different than the other for no specific reason and there is always one thing or another missing.
It would make like so much easier to have a reference implementation complete and working.
constSubmitPayment=({ onHandleMessage })=>{// Here declare the variable containing the hostedField instanceconst{ cardFields }=usePayPalHostedFields();constcardHolderName=useRef(null);constsubmitHandler=()=>{if(typeofcardFields.submit!=="function")return;// validate that \`submit()\` exists before using it//if (errorMsg) showErrorMsg(false);cardFields.submit({// The full name as shown in the card and billing addresss// These fields are optional for Sandbox but mandatory for production integrationcardholderName: cardHolderName?.current?.value,}).then(async(data)=>onHandleMessage(awaitonApproveCallback(data))).catch((orderData)=>{onHandleMessage(`Sorry, your transaction could not be processed...${JSON.stringify(orderData,)}`,);});};return(<buttononClick={submitHandler}className="btn btn-primary">
Pay
</button>);};
The text was updated successfully, but these errors were encountered:
In the paymentform.jsx file, the useRef does not seem to be used (see source below).
Therefore cardholderName?.current?.value will always be null.
Why not provide a proper working example?
Moreover, you are mentioning in a comment (see source below):
Which are those fields ? Are you referring to both
card-holder
andcard-billing-address-country
. If they are both mandatory why are you only passingcard-holder
(with null value though)?This is really frustrating to deal with your sample code. Each one seems different than the other for no specific reason and there is always one thing or another missing.
It would make like so much easier to have a reference implementation complete and working.
The text was updated successfully, but these errors were encountered: