question

jlo09 avatar image
jlo09 asked jlo09 commented

Hosted Checkout and Wordpress

Hello,

I am in the process of creating my own wordpress plugin in which I will be displaying the hosted checkout using this endpoint:

/invoicingcheckoutservice/v1/checkouts

I have accomplished creating the request and I get a successful response with the following url:

https://sandbox.dev.clover.com/checkout/{sessionId}?mode=checkout

My problem now is that my wordpress page with the embedded iFrame is not displaying the checkout form.

It gives me the following error:

Refused to frame 'https://sandbox.dev.clover.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors *.clover.com cloverstatic.com dev.cloverstatic.com *.natwest-tyl.com *.usetyl.com *.optimizely.com *.perka.com"

Is there something I'm missing on my request headers?

Currently set as:

"headers" => array(
				"Authorization" => "Bearer " . $bToken,
				"X-Clover-Merchant-ID" => $mId,
				"Accept" => "application/json",
				"Content-Type" => "application/json"
			)

Thanks in advance!

REST APIPaymentse-commerce api
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
David Marginian avatar image
David Marginian Deactivated answered jlo09 commented

I think you need to be using the hosted iframe, not the hosted checkout. You can't frame the hosted checkout like you are trying to

3 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jlo09 avatar image jlo09 commented ·

Hi,

Thanks for your response, at least now I know to go a different route. For purposes of simplicity, I still want to use the hosted checkout, so what I am trying to do now is, from within my custom plugin I perform the wp_remote_post and receive a positive response with my hosted checkout url. Do you have any suggestions on how having that url, open the hosted checkout in a new page? I have tried using:

 window.location = $body["href"];

but haven't been successful.Thanks again for your help!


0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ jlo09 commented ·
Figuring out how to like to an external page from a WordPress plugin seems to be a WordPress development question and not something I can help you with.
0 Likes 0 ·
jlo09 avatar image jlo09 David Marginian ♦♦ commented ·
Alright thanks.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community