Integrating payment gateway "Instamojo" in Laravel 5.1 - laravel-5.1

I'm using a package 'IndiPay' (https://github.com/softon/indipay) in Laravel 5.1. I have configured api_key and auth_token in my .env file. And in the parameters list, included the required POST parameters (purpose and amount). Additionally, added tid with reference to the GitHub. Even though, I couldn't make the payment successful. It throwed an error like problem in Hash parameter. I attach my screenshot here.
Any suggestions please?
Thanks in advance..

Check whether you have included all the below parameters that I have listed. It could be that you would have missed out some required POST parameters.
 'txnid' => 'XXXX',
 'redirect_url' => 'XXXX',
 'purpose' => 'Testing',
'amount' => 2500,
 'buyer_name' => 'XXX',
 'allow_repeated_payments' => <true/false>

Related

Can't get OAuth 2 Scope. It is not set. Quickbook

I have successfully integrated Quickbook accounting APIs with the Development Keys and Credentials. Moreover, when I put Production Keys and Secret, I got an error with status code (403), and later I got to know that is because of scopes.
I noticed there is a function called "getScope()" to check the token scopes. I went to try that and get the following error:
Can't get OAuth 2 Scope. It is not set.
I even tried using access and refresh tokens from the API playground. Still, the error is there.
Here is my code snippet:
$dataService = DataService::Configure(array(
'auth_mode' => 'oauth2',
'ClientID' => $quickBookData->client_id,
'ClientSecret' => $quickBookData->client_secret,
'accessTokenKey' => $quickBookData->access_token,
'refreshTokenKey' => $quickBookData->refresh_token,
'QBORealmID' => $quickBookData->realm_id,
'baseUrl' => "production",
));
$OAuth2LoginHelper = $dataService->getOAuth2LoginHelper();
$scopes = $OAuth2LoginHelper->getScope();

Saml_IDP gem not pulling metadata or acceptable_hosts

I'm trying to implement SSO via SAML and using my application as both the IdP (routes are based off localhost:3000) and SP (routes based off lvh.me:3000). I used the saml_idp gem to set up the IdP and the omniauth-saml gem for the SP side.
I can get a request sent to the IdP and a response sent back if I bypass the validate_saml_request method in the SamlIdpController in the gem. The response I get returns the user's email and first/last name per what I configured in the config/saml_idp.rb file.
I really don't want to bypass the validate_saml_request. When I looked to see why my request is not being validated, I see that the logs return '[] compare to lvh.me' and 'No acceptable AssertionConsumerServiceURL, either configure them via config.service_provider.response_hosts or match to your metadata_url_host'.
For SPs, my config/saml_idp.rb file looks like:
service_providers = {
"my-application" => {
fingerprint: ENV['SAML_CERT_FINGERPRINT'],
metadata_url: "http://lvh.me:3000/auth/saml/metadata",
response_hosts: ["lvh.me:3000"]
},
}
I confirmed that the metadata does exist at that metadata_url as well. Not really sure why it's not pulling anything via the metadata_url or response_hosts via the config.
On my SP side, the config/omniauth.rb file looks like:
Rails.application.config.middleware.use OmniAuth::Builder do
provider :saml,
:assertion_consumer_service_url => "http://lvh.me:3000/auth/saml/callback",
:issuer => "portal",
:idp_sso_target_url => "http://localhost:3000/saml/auth",
:idp_sso_target_url_runtime_params => {:original_request_param => :mapped_idp_param},
:idp_cert => ENV['SAML_CERT'],
:idp_cert_fingerprint => ENV['SAML_CERT_FINGERPRINT'],
:idp_cert_fingerprint_validator => lambda { |fingerprint| fingerprint },
:name_identifier_format => "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"
end
While I was unable to get it working using this piece of configuration in the config/saml_idp.rb file, I only needed to have the IdP interact with one SP and was able to get it working by adjusting what I passed to response_hosts and using another part of the code given in the config file (example below):
config.service_provider.finder = ->(issuer_or_entity_id) do
{
fingerprint: ENV['SAML_CERT_FINGERPRINT'],
metadata_url: "http://lvh.me:3000/saml/metadata",
response_hosts: ["lvh.me"]
}
end

Wrong redirect URI using shopify-app gem

I've been trying to create an application these past few days. First I've been trying to create an app on localhost (http://localhost) but have been getting errors since Shopify is only supporting https. Then I deployed the application to my VPS (https://my.domain.com) and have specified the callback-URL in my partners account as well (https://my.domain.com). When I enter the shop where I want to install my application the installation window pops up and I can click on "Install". If I do so, the same mismatch occurs. I figured out it was because the URL looks like this:
https://shop.myshopify.com/admin/oauth/authorize?client_id=XXX&redirect_uri=HTTP%3A%2F%2Flocalhost%3...
This is where the mismatch happens. I do not understand why because the redirect_uri should be the callback-URL by default, if not specified otherwise. The callback-app-URL is "https://my.domain.com" so why is the redirect_uri "http://..." and how can I fix this?
I suppose I need to specify the redirect_uri somewhere in my omniauth.rb initializer?
provider :shopify, redirect_uri: "https://localhost:3000"
ShopifyApp.configuration.api_key,
ShopifyApp.configuration.secret,
:scope => ShopifyApp.configuration.scope,
:setup => lambda {|env|
params = Rack::Utils.parse_query(env['QUERY_STRING'])
site_url = "https://#{params['shop']}"
env['omniauth.strategy'].options[:client_options][:site] = site_url
}
Any help is appreciated, really don't know what to do

Mad Mimi Error when Trying to Send an e-mail to a list

I put this into my terminal
uri = URI('https://api.madmimi.com/mailer/to_list')
res = Net::HTTP.post_form(uri,'username'=>'test#example.com',
'api_key' => 'xxxxxx2ce1ac9eb91c75f5933283eb6c ', 'promotion_name' =>
'bulletin', 'subject' => 'Your Daily Bulletin Update', 'from' =>
'noreply#matsu-namibiaflood.opensciencedatacloud.org/', 'list_name' => 'bulletin')
The result was
#<Net::HTTPBadRequest 400 Bad Request readbody=true>
On the Mad Mimi API they talk about putting in your user name and API key https://madmimi.com/developer/mailer/methods
What am I doing wrong? Should I put the username and API key elsewhere?
James here from Mad Mimi, would you mind popping an email to us and I can have a look at your account and check the settings, list names and the promotion.
I would say remove the / at the end of the your "from" email and just check there are no spaces in your API key.
If that doesn't work, I would need to check the promotion but make sure there are no {placeholder} in your bull
Thank you,
James

Getting error 87 at payment Authorize.net in Rails 3

I have created a test account with Authorize.net. My development environment is rails 3 and I am trying to implement the Server Integration Method (SIM) by using static IP. But I am getting an error:
"3,1,87,(TESTMODE) Transactions of this market type cannot be processed on this system.,000000,P,0,,,199.00,,auth_capture,,,,,,,,,,,,,,,,,,,,,,,,,,D3EA25CA1DF97765286A48C6B22287F4,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,✓,uSIUUgX0d++dIheYjcHdlztlViD/r4YDUP9rEuEy9U8=,Purchase" when send request to "AuthorizeNet::SIM::Transaction::Gateway::TEST" gateway.
I also found this link: others got similar type error
But not helpful. Any suggestions how to resolve this error? I wrote following codes in the action.
#amount = 10.00
#sim_transaction = AuthorizeNet::SIM::Transaction.new('API Login ID', 'Transaction Key', #amount, :hosted_payment_form => true)
#sim_transaction.set_hosted_payment_receipt(AuthorizeNet::SIM::HostedReceiptPage.new(:link_method => AuthorizeNet::SIM::HostedReceiptPage::LinkMethod::GET, :link_text => 'Continue', :link_url => payments_thank_you_url(:only_path => false)))
Since you are dealing with credit card transactions through web applications, you need to make sure your Sandbox account is of "Card Not Present" type. If you don't remember which type you set it to, it is a good idea to create a new account and make sure to select "Card Not Present" option. Otherwise, you will get this error message.
I hope this helps.

Resources