question

gdev avatar image
gdev asked David Marginian Deactivated edited

iframe error

Hi, i am not able to get anything working. I am using the example:

https://codepen.io/gareth-dsouza/pen/MWKbWwv

in the form "post" action is "/charge" what is the full sandbox link?

https://checkout.sandbox.dev.clover.com/charge

i get the following error:

<Error>
<Code>InvalidArgument</Code><Message>Invalid argument.</Message><Details>POST object expects Content-Type multipart/form-data</Details>
</Error>

or

https://scl-sandbox.dev.clover.com/v1/charge


clover developer community
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 David Marginian Deactivated edited

I assume you are able to obtain the token, correct? Once you obtain the token you need to send it to your server (hence the relative /charge) and perform the charge from there https://scl-sandbox.dev.clover.com/v1/charges

4 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.

gdev avatar image gdev commented ·

Thank you for your quick response. Do you have a sample of what (send it to your server (hence the relative /charge)) my charge page should be? I was trying to post my form directly to https://scl-sandbox.dev.clover.com/v1/charges but i guess that is not how it works.


0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ gdev commented ·

The payment must be made from your server, see our docs, https://docs.clover.com/docs/ecommerce-accepting-payments

0 Likes 0 ·
gdev avatar image gdev David Marginian ♦♦ commented ·

hi,

I have created my charge.html, pasted the following:

<script>import { v4 as uuidv4 } from 'uuid'; uuidv4();</script>

curl --request POST \ --url 'https://scl-sandbox.dev.clover.com/v1/orders' \ --header 'accept: application/json' \ --header 'authorization: Bearer {I added my own access_token}' \ --header 'content-type: application/json' \ --data '{"currency":"usd", "customer":"{customer_uuid}", "email":"john.doe@customer.com", "items":[{"amount":1800, "currency":"usd", "description":"Test item #1", "quantity":1,"type":"sku" "tax_rates":[{"name":"Sale","tax_rate_uuid":"{tax_uuid}"}]}], "shipping":{"address":{city":"Sunnyvale", "country":"US", "line1":"415 N Mathilda Ave", "postal_code":"94085", "state":"California"},"name":"John Doe"}}'


but now where is the actual payment transaction? nothing here shows the credit card information?

I am not looking to manage any inventory or cart, just transfer items, quantities and prices for clover to process payment.

i had this working with a previous payment supplier using a simple "post to url" but transferring to Clover seems more complicated then i anticipated.

0 Likes 0 ·
Show more comments

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