question

phantomreference82 avatar image
phantomreference82 asked zgreathouse Deactivated commented

Developer Pay API Does not return pem

Hitting the endpoint ' https://apisandbox.dev.clover.com/v2/merchant/{ {merchantId}}/pay/key' returns the fields modulus, exponent and prefix but not pem.

The documentation states that the field pem will also be returned.
How can I get the API to return the pem field?
Developer Pay 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.

zgreathouse avatar image
zgreathouse Deactivated answered phantomreference82 commented
You do not have Process Credit Cards permissions. Update your permissions to have process credit cards checked and you will receive the pem in the response.
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.

phantomreference82 avatar image phantomreference82 commented ·
My permissions are (and have been) set to 'process credit cards' and I have still not been getting the pem in the response.

Further, I am able to process payments via encrypting the credit card using a key created using the modulus and exponent fields, so permissions is not the issue here.
Unfortunately, the approach I described will no longer work for us going forward so I need the pem field.
0 Likes 0 ·
chanel avatar image chanel phantomreference82 commented ·

Please review our guide to asking questions and provide as much detail as possible. For instance, what process were you using before? When did your approach no longer work? What specifically are you seeing that makes you say "it no longer works"?

0 Likes 0 ·
phantomreference82 avatar image phantomreference82 chanel commented ·

I am following the process highlighted in the Developer Pay API guide (https://docs.clover.com/build/developer-pay-api/)

* I send an HTTP GET request to the URL 'https://apisandbox.dev.clover.com/v2/merchant/{mId}/pay/key' whilst providing the proper API key in the 'Authorization' header
* I receive a response in the form of

{
"modulus" : string,
"exponent" : string,
"prefix" : string
}

* According to the documentation, I should be receiving the following:
{
"pem" : String
"prefix" : String
"modulus" : String
"exponent" : String
"id" : String
}
* I am following the guide to a T and do not get the fields back which it states I will. Why?

0 Likes 0 ·
Show more comments
phantomreference82 avatar image
phantomreference82 answered zgreathouse Deactivated commented
I resolved this by 'reinstalling' my webapp.

Every time permissions change, the app must be re-installed by the merchants - Even if said app is a web-app which does not have any meaningful installation on the part of the merchant.
1 comment
10 |2000

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

zgreathouse avatar image zgreathouse commented ·

The installation is meaningful for web apps.

In your OAuth flow, before receiving your access_token, you need a code. The code gathers what permissions are asked for by the app (your current installation/ version of the app). This code informs what permissions the access_token requested will ultimately have.

If you log into your developer account and update the permissions settings on your app, this does not update the access_tokens received by any current installation of the app.

That is why reinstalling the app is necessary when permissions have been updated.

1 Like 1 ·

Welcome to the
Clover Developer Community