Method keyFromPemFileWithName not found on JWTCryptoSecurity class - ios

Have someone faced any error when trying to integrate DocuSign SDK on Swift iOS application? I have installed the last version of DocuSign (3.0.1) using Cocoapods and it has a dependency of JWT framework (version 3.0.0-beta.11 installed).
I try to run the code but I got this error: No known class method for selector No known class method for selector 'keyFromPemFileWithName:'
It seems there is no method keyFromPemFileWithName inside JWTCryptoSecurity class.
I would appreciate if someone has the answer for this.

I've found 2 ways to solve this issue
1) Force to use an old version of JWS with DocuSign:
pod 'JWT', :git => 'https://github.com/yourkarma/JWT', :commit => 'c4232478d3190a163f76b05c38ec84625e3d785a'
pod 'DocuSignESign'
2) Edit DocuSign framework in order to have a method like that (without passing the file name but the file URL)

Related

Rails - Google Translate API : ArgumentError: unknown keyword: project

I have this code that was working on my rails app that is using google Translate API, but on my last commit to heroku I got the error
ArgumentError: unknown keyword: project
It seems that my google analytics is not working neither. Don't know what is causing the error. Maybe you have a hint ?
translate = Google::Cloud::Translate.new project: "my_project"
description_translation = translate.translate params[:description], to: 'en'
update_attribute(:description, description_translation)
project was an alias for project_id. It was deprecated since version 1.1.0 of the library.
Your code presumably stopped working because you updated the library to version 2.0.0 (or above) - since here, in this PR, support for the project parameter was fully dropped.
To fix this error, simply rename project to project_id.
Also take note of any other potentially-breaking changes here, in the CHANGELOG. As shown in that link, you may wish to temporarily use version: :v2 to help ease the migration if there are further complications.

undefined method `async' (suckerpunch gem)

I am using sucker_punch gem to send the email in my rails app in the background.It used to work fine, but then I suddenly got this error:
undefined method `async' for #<ActiveJob::QueueAdapters::SuckerPunchAdapter::JobWrapper:0x007f892c6c31a0>
Below is the screenshot of the full error:
I am using sucker_punch version 2.0.1 right now. I have tried to downgrade it and using sucker_punch version 1.6.0 instead, but the error persist.
Any help? Thanks!
Okay I have finally figured it out. In my sucker_punch.rb file, I need to include this:
# config/initializers/sucker_punch.rb
require 'sucker_punch/async_syntax'
This is required for those who are using Sucker Punch version 2.0.0+ with Rails < 5.0.0 as explained here
They've actually changed async syntax.
With newer versions of sucker_punch, you should call async like so:
Model.perform_async
It's mentioned under the Backwards Compatibility heading here
https://github.com/brandonhilkert/sucker_punch

Rails 4.2 - Grape - IOError: Not opened for reading

I'm building an API with Grape on Rails 4.2. Here's a link to the repo on GitHub.
On the frontend, I have a JavaScript application built with EmberJS. Here's the link to the repo on GitHub as well.
I have updated the following gems so that I can format the responses of my API following JSON API standard, which appears to be required to update to Ember 1.13, then to Ember 2.0.
gem "active_model_serializers", '0.10.0.rc2'
gem "grape"
gem "grape-active_model_serializers", :git => 'https://github.com/jrhe/grape-active_model_serializers.git'
After that, I've got the following error when I call the API: IOError: Not opened for reading
According to the information I gathered here and there, I suspect this is a conflict with how I format JSON.
In default.rb, the file that inherit all API controllers, when I comment this line:
formatter :json, Grape::Formatter::ActiveModelSerializers
I don't have any error anymore, but obviously the response isn't serialized.
My questions are:
Do you have any idea how I can solve this?
Do you think it's relevant to use Grape to build the API in my Rails app? With Rails 5 coming, isn't that better to user rails-api and rewrite the whole app? I mean, I'm starting, it's maybe the right time to do that...
Let me know if you need more information.
Thanks in advance for your help.
I ended up rewriting the whole API using jsonapi-resources.

Old version of recaptcha get displayed instead of the newer version using the rails gem "Recaptcha"

Thanks to the gem https://github.com/ambethia/recaptcha/ (version 0.3.6), I managed to integrate Google Recaptcha into my rails app. The problem is that only the old version (V1) is displayed, similar to below.
However, I would prefer to the newer version with the checkbox like below, which is much easier for the users. Any idea how to get there?
There is some discussion about this, see: https://github.com/ambethia/recaptcha/issues/112
You are free to implement the new API by yourself it's not that hard actually, and if you have the knowledge submit a pull request to the original repository with a working solution :-)
The instructions on how to implement reCaptcha can be found here: http://www.google.com/recaptcha/intro/index.html

PayPal payment error

I've got an app that has the possibility to do shopping, making the money transaction through paypal. I'm trying now to integrate the paypal stuff into my rails project and as I'm trying to learn how that's done I've downloaded this sample project that appears to show a good example of how this stuff is done.
I think I've got everything covered when talking about configuration. That app is now all configured with my paypal credentials.
My problem is that after making any payment, when making the callback, the app throws this error:
undefined method `recipientName=' for #<PayPal::SDK::REST::DataTypes::Address:0x007feb13a30ee8>
Even with the default configuration I'm having this issue.
Does anyone know what is that about? I guess is something about the gems included in the project that have to do with paypal:
# PayPal
gem 'paypal-sdk-core', :git => 'https://github.com/paypal/sdk-core-ruby.git'
gem 'paypal-sdk-rest', :git => 'https://github.com/paypal/rest-api-sdk-ruby.git'
But have any clue about how to fix it. Maybe someone does.
Thanks!
I found the solution. Definitely was something about the gem versions. Just updated them and problem solved.
Making this:
# PayPal
gem 'paypal-sdk-core', :git => 'https://github.com/paypal/sdk-core-ruby.git'
gem 'paypal-sdk-rest', :git => 'https://github.com/paypal/rest-api-sdk-ruby.git'
Didn't installed the latest version of both gems. I've just took out those git specification and after a bundle update the problem was solved.

Resources