Why snipcart digital goods verification fails - checkout

I’ve been stuck on this for a while now.
I’m trying to set up a digital products webshop, using Vue + Strapi + Snipcart.
Here’s the error I’m encountering once I try to checkout with a product:
browser error message from snipcart
However, If I test with a normal product that doesn’t have guid attached to it - everything is fine and the transaction goes through.
I use snipcart’s JSON crawler. Therefore I’ve created an endpoint from my API with all products.
JSON structure
{
"_id":"618ff1327f4e2824f09134cf",
"price":123,
"file_guid":"7571fd60-a403-404c-b27a-616c0856e1ee",
"id":"618ff1327f4e2824f09134cf"
}
...
The only thing that comes to my mind - is that I’m not correctly referencing guid in my JSON document
I’ve also tried just guid instead file_guid - it didn’t work.
Lastly this is my “Add to cart” button code:
<v-btn dark depressed class="mt-5 snipcart-add-item"
:data-item-id="productDetails.id"
:data-item-description="productDetails.shortDescription"
:data-item-price="productDetails.price"
:data-item-image="apiUrl + productDetails.image.url"
:data-item-name="productDetails.title"
:data-item-url="'https://92ef-91-101-56-233.ngrok.io/products/snipcart'"
:data-item-max-quantity="1"
:data-item-min-quantity="1"
:data-item-file-guid="productDetails.file_guid"
>ADD TO CART</v-btn>
Everything is running and tested locally using ngrok.
Does anyone have any ideas of what I’m doing wrong? Any help is highly appreciated.
Thanks.

I’ve managet to figure out the issue. As I suspected I was referencing guid wrong (file_guid and guid), that’s why snipcart’s JSON crawler was returning me the error.
I’ve found in some random repository that You must use the name fileGuid in your API otherwise crawler won’t find it.

Related

flask-jwt-extended - Catch raise RevokedTokenError('Token has been revoked')

I already tried reading the documents as well try out the changing default behaviors https://flask-jwt-extended.readthedocs.io/en/latest/changing_default_behavior.html to handle the error (the link shows how to handle expired token) and search around in google everything in every keyword combination i could do but seems no one has example about this.
I tried using #jwt.revoked_token_loader to handle the RevokedTokenError but it seems it doesn't work as I applied it like this
#jwt.revoked_token_loader
def revoked_token_response(revoked_token):
jwtkn = revoked_token['jti']
return jsonsify({
'msg': 'token {} already been revoked!'.format(jwtkn)
)}, 401
actually, i don't know exactly how does the example on the link to handle expired tokens had parameter of 'expired_token', is that self-declaration like what I did above on the 'revoked_token'?? as far as I know, 'jti' is like a default value in the flask-jwt-extended package as I see error whenever I don't use this (in my db, it is different but there is no problem at all.
I tried following this tutorial and it works out fine on my side (as well his original code source) but I see that this one doesn't have a catch exception also on Revoke Tokens https://codeburst.io/jwt-authorization-in-flask-c63c1acf4eeb
I use postman and if based on the tutorial link, here's how i get this
i do login
i use the access token generated to access protected routes ('/secrets')
i do logout
i use again the access token generated to access protected routes
after the last one, i get this error on my server side (ide):
....flask_jwt_extended\utils.py", line 216, in verify_token_not_blacklisted
raise RevokedTokenError('Token has been revoked')
flask_jwt_extended.exceptions.RevokedTokenError: Token has been revoked
127.0.0.1 -- [02/Jul/2019 22:25:26] "GET /secrets HTTP/1.1" 500 -
in postman, this is what I get:
{
'message': 'Internal Server Error'
}
my target is to send out a custom json response instead of 'Internal Server Error'
edit:
I am no wiz on programming or such, a beginner that wanted to practice out python about secured web development. I don't yet quite understand still how decorator works out in terms of application, etc. so i don't know if others tweaks out the flask-jwt-extended package to work such things out.
Getting back a 500 error normally occurs because of a bug in other flask extensions and how that interact with native flask errorhandlers. You can find a bunch of discussions about it here (https://github.com/vimalloc/flask-jwt-extended/issues/86), but the tl;dr version is you might need to set app.config['PROPAGATE_EXCEPTIONS'] = True if using something like Flask-Restul, or use a hack like this if using flask-restplus:
jwt = JWTManager(app)
api = Api()
jwt._set_error_handler_callbacks(api)
If those don't help you, please take a look through that linked github issue, and if nothing in there helps make a reply in that issue detailing your setup.
Cheers.

error: Failed to run the post merge process

I'm trying to generate documents using conga composer 8 from apex code but its failing with error Failed to run the post-merge process. I have looked into url and its same as the one I used initially in another salesforce org. I couldn't find any help online or on conga-composer form.
Here is my conga endpoint URL:
https://composer.congamerge.com/Composer8/Index.Html? sessionId=00D41000000dorw!ARQAQKbinH5TXMR_70s3XCShQh5GuSVdrFcq0Fg9OidZLo9MLxzWSby8QY1B4xM8e72DPawVziclnXBjTzpG41RiCAPKQqOt
&serverUrl=https://na35.salesforce.com/services/Soap/u/29.0/00D41000000dorwEAA
&id=a1J410000012BwS
&TemplateId=a0C41000000kg5GEAQ
&APIMODE=13
&ESAgreementName=Contract+for+Test
&queryid=a0441000001PwI7AAK,a0441000001PwICAA0
&ESSignatureType=2
&ESSignatureOrder=2
&ESVisible=1
&ESCustomField=cldocgen__App__c
&ESCustomFieldValue=a1J410000012BwSEAU
&ESRecipient1=00541000000Ke9pAAC
&ESRecipient2=003410000078zVbAAI
&ESRecipient3=003410000078zVhAAI, Method=GET]
Any insight what might be causing this issue.
I had the same problem and was able to solve it using permissions. In this case make sure the user id whose sessionID is passing to Conga has the correct CRUD access to the primary object in your conga call (id=a1J410000012BwS). My guess is that this is something to do with Conga not being able to write the attachment back to salesforce.
Apart from what Greg has mentioned, there are 2 more observations for this error:
Under Email Administration -> Deliverability -> Access to Send Email (All Email Services) should be set to All email.
In case you are using the EmailTemplateId parameter then the classic email template must be available for use.
Also mostly this error is also because of some discrepancy in the URL.

Encoding problems in PayPal Here callback URL?

I'm trying to get PayPal Here to issue a callback to a FileMaker Go database. It looks like the fmp:// protocol is being used correctly, but seems that there may be some kind of other problem with the callback URL.
Here's the URL that I'm using to call PayPal Here (note that I'm not stripping out the carriage returns from the base64-encoded invoice in my application; this is the actual URL my application sends to the OS, and the invoice appears to be fine in PPH):
paypalhere://takePayment?as=b64&accepted=card%2Cpaypal&returnUrl=fmp:%2F%2F$%2Ffmg_pphTest&step=choosePayment&invoice=eyJwYXltZW50VGVybXMiOiJEdWVPblJlY2VpcHQiLCJkaXNjb3VudFBlcmNlbnQiOjAsImN1cnJl
bmN5Q29kZSI6IlVTRCIsInBheWVyRW1haWwiOiJjcmlzdG9zK3Rlc3RAY3Jpc3Rvc2xjLmNvbSIs
Iml0ZW1MaXN0Ijp7DQogICAgIml0ZW0iOiBbDQogICAgICAgIHsibmFtZSI6IkRpbGl0aGl1bSBD
cnlzdGFsIiwiZGVzY3JpcHRpb24iOiJNYWtlcyBzaGlwIGdvIGZhc3QuIiwidW5pdFByaWNlIjow
LjEsInF1YW50aXR5IjoxMCwidGF4UmF0ZSI6MCwidGF4TmFtZSI6IlRheCJ9DQogICAgXQ0KfX0=
This is the URL that I want to fire (this is just for testing; later on, there will be additional parameters added on to send the payment status, etc., but I can't even get this basic version to work yet):
fmp://$/fmg_pphTest
However, the behavior I'm seeing looks like this is the URL PPH is actually sending:
fmp://
Testing is being done on an iPad 2 running iOS 8.3. Any thoughts/suggestions out there?
A kind soul on the FileMaker Community boards pointed me at a working example, https://github.com/Genecom/FileMakerSampleSolutions. After doing some comparisons, I discovered the issue is due to using base64-encoding of the JSON invoice object. When I changed it to use URL-encoding of the JSON invoice (like the Genecom example), I was able to get the callback URL to work successfully.
I opened an issue on the PayPal Here github project, please feel free to chime in there if you've also experienced this issue (or found countervailing evidence): https://github.com/paypal/here-sideloader-api-samples/issues/26

Facebook API returns empty response only from specific IP

Suddenly simple Facebook Graph API calls started to return an empty result. The node I'm calling is a simple search page by name:
`https://graph.facebook.com/search?type=page&fields=profile_picture,username,id,name,likes,category,talking_about_count&access_token=<APP_TOKEN>&limit=10&q=stackoverflow`
It just started to return an empty result set when called from my server:
{"data":[]}
When I'm calling it from my personal computer browser, it works just fine.
I don't see any notification in Facebook Manage Apps page. What can be the reason? Is there any way I can see any error in this Graph API result?
UPDATE: suddenly it started working again, after it was down for at least 2 hours. Is there any way I can make these calls through client side JS? Any way to avoid to exposure of my APP_TOKEN?
UPDATE2: It stopped working again, and although I haven't identified the reason, I did figure when replacing the with a , it does work. The documentation actually says to use an APP_TOKEN.

Facebook API - Feed.registerTemplateBundle issues

I'm trying to build a feature into my framework wrapper that automates registering template bundles. I've gotten to the point where it seems like I can do so successfully using the Feed.registerTemplateBundle API method - I don't get an error, and I do get a template id back. However, the template doesn't show up in the "Registered Templates Console", and if I try to publish a story using the id, it gives me an "invalid template bundle id" error.
Any suggestions?
I had this problem in Facebook's official example application (TheRunAround)
it was registering template but when it tried to get an id it was
using sprintf (like: sprintf('%d', ))
current template ID's are out of the 32bit range so it was returning wrong id.
May it be the cause?
Turns out there were two problems:
I was erroneously double-json-encoding the short story template
Facebook was accepting the erroneously-formatting calls and returning an id, thus resulting in the creation of "phantom" template bundles that weren't showing up in their console.
I've fixed my code, and the bug has been reported (and I believe since fixed).