checkout-sdk-js icon indicating copy to clipboard operation
checkout-sdk-js copied to clipboard

Issue to make payment

Open kulvirbal opened this issue 2 years ago • 17 comments

I have implemented a checkout page using Checkout SDK. Since yesterday, we are facing an issue with Payment Processing. Issue is with await service.submitOrder({ payment }) method response. Error Message: MissingDataError: Unable to proceed because payment method data is unavailable or not properly configured. Here is the Payment Parameter: { methodId: "stripe", paymentData: { ccExpiry: { month: 05, year: 11 }, ccName: "Name", ccNumber: "Card Number", ccType: "visa, ccCvv: 123 }, } I have started getting this error after PR merge: https://github.com/bigcommerce/checkout-sdk-js/pull/1470. We are having production site please help me to resolve this issue.

kulvirbal avatar Jun 16 '22 04:06 kulvirbal

Hi there, we are looking into your issue. Can you please provide your sandbox/store URL?

bc-peng avatar Jun 16 '22 05:06 bc-peng

Thank you so much for your quick response. Here is my store URL: https://signredesign.com/

kulvirbal avatar Jun 16 '22 06:06 kulvirbal

Can you try replacing methodId stripe with stripev3 and see if it is working?

bc-peng avatar Jun 16 '22 06:06 bc-peng

I tried but it didn't work. I even try to implement the functionality to pay later (for now my client is looking to create orders) using below code but it didn't work. `await service.loadCheckout();

try { await service.finalizeOrderIfNeeded();

window.location.assign('/order-confirmation');

} catch (error) { if (error.type !== 'order_finalization_not_required') { throw error; } }` I am getting the following error for this code: OrderFinalizationNotRequiredError: The current order does not need to be finalized at this stage.

Please help me it is a production store.

kulvirbal avatar Jun 16 '22 06:06 kulvirbal

If you believe new SDK causes the trouble, you can simply use an old SDK version from NPM or CDN. Please let me know if the problem disappears when you revert to a previous SDK version.

bc-peng avatar Jun 16 '22 07:06 bc-peng

How can I use the previous version of sdk using NPM?

kulvirbal avatar Jun 16 '22 07:06 kulvirbal

Specify a version in your checkout package.json, then run npm install. https://github.com/bigcommerce/checkout-js/blob/5aad832465649922416c3cc89364d33f83dc6055/package.json#L37

bc-peng avatar Jun 16 '22 23:06 bc-peng

@bc-peng I tried but it didn't work. It was working just fine and I didn't touch my code at all. Could you please suggest me another work around?

kulvirbal avatar Jun 20 '22 04:06 kulvirbal

Hey @kulvirbal from what we can see is that this store is using native checkout and not custom checkout, is that correct?

Also from the store's payment endpoint payload gateway: "stripev3" and method: "card". So I think your correct payload should be

{ gatewayId: "stripe3", methodId: "card", paymentData: { ccExpiry: { month: 05, year: 11 }, ccName: "Name", ccNumber: "Card Number", ccType: "visa, ccCvv: 123 }, }

Can you try the above please?

animesh1987 avatar Jun 20 '22 06:06 animesh1987

Hello @animesh1987 ,

Thank you for your reply. I have changed the current store to native BigCommerce Checkout as Checkout SDK has issues and we are having production store.

I have changed the params as per your suggestion but it is giving me different errors now:

NotInitializedError: Unable to proceed because the payment step of checkout has not been initialized.

Screen Shot 2022-06-19 at 11 20 02 PM

I have tried gatewayId: "stripe3" and gatewayId: "stripev3" but nothing worked.

kulvirbal avatar Jun 20 '22 06:06 kulvirbal

Have you initialised the stripe components? By that error it seems like you haven't run the process of initialising the or is thrown in the process of initialising the payment method. The above payload that I linked was for executing a payment.

animesh1987 avatar Jun 20 '22 06:06 animesh1987

I did initialize the process using the following code: await service.initializePayment({ methodId: "card", gatewayId: "stripev3"});

could you please let me know if it the right way to initialize the method?

kulvirbal avatar Jun 20 '22 07:06 kulvirbal

You can try this https://github.com/bigcommerce/checkout-sdk-js/blob/master/packages/core/src/payment/strategies/stripev3/stripev3-initialize-options.ts#L29 as reference, also will need to add gatewayId to the payload.

So you can keep the above payload and add the stripev3 key to it.

animesh1987 avatar Jun 20 '22 07:06 animesh1987

@kulvirbal did you manage to try it out?

animesh1987 avatar Jun 20 '22 13:06 animesh1987

@animesh1987 I am again start getting the below error MissingDataError: Unable to proceed because payment method data is unavailable or not properly configured.

kulvirbal avatar Jun 21 '22 04:06 kulvirbal

Can you please share the payloads you are using for initializePayment and submitOrder. Also the workflow you are implementing, since it seems like the error is in the payload sent.

animesh1987 avatar Jun 21 '22 11:06 animesh1987

Hey @kulvirbal is this still an issue?

animesh1987 avatar Aug 09 '22 12:08 animesh1987

Closing this due to inactivity

animesh1987 avatar Aug 25 '22 12:08 animesh1987