Fedex address validation failed - ruby-on-rails

I am using rails 2.3.17, I have used fedex .
I have used the plugin https://github.com/kdonovan/fedex
I have a customer who has account in fedex. But while shipping from the site , I am getting the error as
Fedex address validation failed. Check address details. Error messages: MODIFIED_TO_ACHIEVE_MATCH. Delivery Point: UNAVAILABLE. Residential Status: BUSINESS
Any guess why this is happening ?
Thanks
EDIT
address_request_details: AvenueStateOrProvinceCodeWICityWausauWebAuthenticationDetailUserCredentialPasswordhTJxEaH7fXDqYtNaPFsPIDAy6KeyXl4QkKWZbZpxhzaIVersionMajor2ServiceIdavalIntermediate0Minor0
process_address_request: #<SOAP::Mapping::Object:0x346dedc
{http://fedex.com/ws/addressvalidation/v2}HighestSeverity="SUCCESS"
{http://fedex.com/ws/addressvalidation/v2}Notifications=#<SOAP::Mapping::Object:0x346d4f0
{http://fedex.com/ws/addressvalidation/v2}Severity="SUCCESS" {http://fedex.com/ws/addressvalidation/v2}Source="wsi">
{http://fedex.com/ws/addressvalidation/v2}Version=#<SOAP::Mapping::Object:0x3469bac {http://fedex.com/ws/addressvalidation/v2}ServiceId="aval"
{http://fedex.com/ws/addressvalidation/v2}Major="2"
{http://fedex.com/ws/addressvalidation/v2}Intermediate="0" {http://fedex.com/ws/addressvalidation/v2}Minor="0"> {http://fedex.com/ws/addressvalidation/v2}ReplyTimestamp="2014-04-21T04:25:59.044-05:00" {http://fedex.com/ws/addressvalidation/v2}AddressResults=#<SOAP::Mapping::Object:0x3464508
{http://fedex.com/ws/addressvalidation/v2}ProposedAddressDetails=#<SOAP::Mapping::Object:0x3463f54 {http://fedex.com/ws/addressvalidation/v2}Score="58" {http://fedex.com/ws/addressvalidation/v2}
Changes="MODIFIED_TO_ACHIEVE_MATCH" {http://fedex.com/ws/addressvalidation/v2}ResidentialStatus="BUSINESS" {http://fedex.com/ws/addressvalidation/v2}
DeliveryPointValidation="UNAVAILABLE" {http://fedex.com/ws/addressvalidation/v2}Address=#<SOAP::Mapping::Object:0x345f4b8 {http://fedex.com/ws/addressvalidation/v2}StreetLines="1000 S 17TH AVE"
{http://fedex.com/ws/addressvalidation/v2}City="WAUSAU" {http://fedex.com/ws/addressvalidation/v2}StateOrProvinceCode="WI" {http://fedex.com/ws/addressvalidation/v2}PostalCode="54401-5741" {http://fedex.com/ws/addressvalidation/v2}CountryCode="US"> {http://fedex.com/ws/addressvalidation/v2}RemovedNonAddressData="">>>

Per the edit, FedEx is not returning an error - you are getting back SUCCESS.
MODIFIED_TO_ACHIEVE_MATCH is very common in a FedEx response - it means that the user entered an address which required some changes. Compare the original data to the response and determine if you want to overwrite it or keep as-is. Alliteratively, many sites are coded to show the original address and the standardized address side by side so the user can "update" to the standardized version. Be aware that FedEx (and UPS) validation can be destructive at times.

Related

Slack Conversations API conversations.kick returning "channel_not_found" for a public channel

I am writing a Slack integration that can boot certain users out of public channels when certain conditions are met. I have added several OAuth scopes to the bot token, including the following:
channels:history
channels:manage
channels:read
chat:write
chat:write.public
groups:write
im:write
mpim:write
users:read
I am writing my bot in Python using the slack-bolt library and asyncio. However when I try to invoke this code:
await app.client.conversations_kick(channel=channel_id, user=user_id)
I get the following error:
slack_sdk.errors.SlackApiError: The request to the Slack API failed. (url: https://www.slack.com/api/conversations.kick)
The server responded with: {'ok': False, 'error': 'channel_not_found'}
I know for a fact that both the channel_id and user_id arguments I'm passing in are valid. The channel ID I'm using is the string C01PAE3DB0A. I know it is valid because I can use the very same value for channel_id in the following API call:
response = await app.client.conversations_info(channel=channel_id)
And when I call conversations_info like that I get all of the information about my channel. (The same is true for calling users_info with the user_id - it returns successfully.) So why is that when I pass my valid channel_id parameter to conversations_kick I consistently receive this channel_not_found error? What am I missing?
So I got in touch directly with Slack support about this and they confirmed that there is a bug on their end. Specifically, the bug is that I should have received a restricted_action error response instead of a channel_not_found response. Apparently this is a known issue that is on their backlog.
The reason the API call would (try to) return this restricted_action error is simply because there is a workspace setting that, by default, prevents non-admins from kicking people out of public channels. Furthermore, this setting can only be changed by the workspace owner - one tier above admins.
But assuming you are the owner of the Slack workspace, you simply have to log into the Settings & Permissions page, which should look something like this:
And then you have to change the setting labeled "People who can remove members from public channels" from "Workspace admins and owners only (default)" to "Everyone, except guests."
Once I made that change, my API calls started succeeding.

Error using ActiveMerchant::Billing::AuthorizeNetCimGateway with Authorize.Net's opaqueData

Feb 8, 2018
My Ruby on Rails application has been successfully using ActiveMerchant::Billing::AuthorizeNetCimGateway with the payment type :credit_card for creating a customer profile with an embedded payment profile.
I'm now in the process of migrating to Authorize.Net's Accept.js which accepts credit card info directly sent from their hosted payment form and returns a payment nounce of type COMMON.ACCEPT.INAPP.PAYMENT that can be used for one time to create a payment transaction, customer profile, etc.
I constructed a payment_profile hash with :opaque_data in place of :credit_card. For example:
> payment_profile
=> {:payment=>
{:opaque_data=>
{:data_descriptor=>"COMMON.ACCEPT.INAPP.PAYMENT",
:data_value=> "eyJjb2RlIjoiNTBfMl8wNjAwMDUzNjBDMzAwOUQ3OEUzOUQ1MDk4QTYxMjFGNzlCQ0Y3RDRGQUE4NTNCMEU3MkYyMUJBNTI3NUE0NjQ2Q0ZFQTVFNzMxMDI2Qjg5ODJGNjBFRUE2RDZFMTZCMUY5NzQ4NUJFIiwidG9rZW4iOiI5NTE4MDc3Njg5NDA4MTAwOTAzNTAyIiwidiI6IjEuMSJ9"}},
:bill_to=>{:first_name=>"Firstname", :last_name=>"Lastname", :address=>nil, :city=>nil, :state=>nil, :zip=>nil, :country=>nil, :phone_number=>"(012) 234-5678"}}
I then tried to create a customer profile with an existing code similar to the following:
response = #gateway.create_customer_profile profile: {
email: client.email,
description: client.name,
merchant_customer_id: client.id,
payment_profiles: payment_profile
}
However, I received a response which had a result_code of Error and complained about "incomplete content" for element payment as follows:
> response
=> #<ActiveMerchant::Billing::Response:0x007f9827d14900
#authorization=nil,
#avs_result={"code"=>nil, "message"=>nil, "street_match"=>nil, "postal_match"=>nil},
#cvv_result={"code"=>nil, "message"=>nil},
#emv_authorization=nil,
#error_code="E00003",
#fraud_review=nil,
#message=
"The element 'payment' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has incomplete content. List of possible elements expected: 'creditCard, bankAccount, trackData, encryptedTrackData, payPal, opaqueData, emv' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.",
#params=
{"messages"=>
{"result_code"=>"Error",
"message"=>
{"code"=>"E00003",
"text"=>
"The element 'payment' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd' has incomplete content. List of possible elements expected: 'creditCard, bankAccount, trackData, encryptedTrackData, payPal, opaqueData, emv' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'."}}},
#success=false,
#test=true>
I have a few questions in my mind:
Does ActiveMerchant::Billing::AuthorizeNetCimGateway even support Accept.js' :opaque_data in place of :credit_card?
If ActiveMerchant::Billing::AuthorizeNetCimGateway does support :opaque_data, what's may be wrong with the above payment_profile and what other content that I'd need to provide for payment element?
I'd appreciate any help in resolving this issue.
While this question is over 4 years old, and I'm assuming you have either found a solution or abandoned your effort, I ran into this same issue recently, and thought it would be helpful to add my findings in case someone else runs into this.
the AuthorizeNetCimGateway does not currently support Accept.js' opaqueData. In looking at the sourcecode for the active_merchant gem, specifically in /lib/active_merchant/billing/gateways/authorize_net_cim.rb, there is ultimately a method add_payment_profile that gets called. In that method, specifically on lines 759-761, you can see that the options are either a credit_card, bank_account, or drivers_license. A tokenized payment is not currently supported.
That being said, there is an open PR#2422 that adds support for this. At the time of writing this, it appears to be failing some rubocop specs, but hopefully it can get deployed in the near future!

getting error when enter uri for timeseries ingest

Hi I am trying to save data in timeseries db but I am facing an error at timeseries ingest when I enter wss://gateway-predix-data-services.run.aws-usw02-pr.ice.predix.io/v1/stream/messages in websocket uri it shows an error like this when I click on open socket
The request failed with status code: 500
{
"error": "Error: unexpected server response (401)",
"url": "wss://gateway-predix-data-services.run.aws-usw02-pr.ice.predix.io/v1/stream/messages"
}
and see this screenshot once.
Thanks&regards
Eswar G
From the error log, it looks you got authorization error. Check if you are using correct predix-zone-id of the time-series instance in the request header or you have configured correct UAA instance in predix tool kit.
Have you updated your UAA client with timeseries authorities?
To inserting time series data with particular user or client need permission. For getting permission, you need to add authorities into your UAA client.
Following are the authorities for timeseries.
Experiencing a similar problem. I'm posting only one of several received error messages. I've cycled through combos of the following for uri and zone id:
uri:
wss://gateway-predix-data-services.run.aws-usw02-pr.ice.predix.io/v1/stream/messages
https://time-series-store-predix.run.aws-usw02-pr.ice.predix.io/v1/datapoints
zone-id:
44853a54-3ecd-4589-85da-b54f2fda7cce
and the zone id shown in the photo, with .ingest at the end.
so, 401 unauthorized.
Did you happen to re-create the timeseries or uaa? Perhaps they are not associated. Also, I'm assuming you did "login as client" in the top menu.
Might be a good idea to create a new timeseries tied to that uaa. Then use the new zoneId.
Did you add predix..ingest and predix..user to the scope and authorities section in uaa client in your predix.io account. Please check the client id to add permission for in websocketriver.config file.

How to set Vendor Tax ID and 1099 Eligibility in API?

I'm currently using Consolibyte's PHP QB classes to interface with the QB api.
I've been successfully creating and updating Vendor's in QB for a while. However, we have a new requirement to use the API to store vendor's tax information.
I've tried to lookup the correct syntax to set these, but have been unsuccessful thus far.
My most recent attempt was:
$Vendor->setVendorTaxIdent($provider->taxId);
$Vendor->setIsVendorEligibleFor1099(true);
The rest of the information set gets updated properly, and the return from
$result = $VendorService->update($this->context, $this->realm, $provider->vendorId, $Vendor);
seems to indicate success.
Please let me know if you need anymore context. Thanks!
Have you referred to the documentation?
https://developer.intuit.com/docs/api/accounting/Vendor
The documentation indicates:
TaxIdentifier: String, max 20 characters
Vendor1099: Boolean
The geters and seters exactly mirror the documented fields. So unsurprisingly, you'll have these methods:
$Vendor->setTaxIdentifier($string);
$string = $Vendor->getTaxIdentifier();
And:
$Vendor->setVendor1099($boolean);
$boolean = $Vendor->getVendor1099();
If you continue to have trouble, make sure you post the XML request you're sending to QuickBooks. You can get this by doing:
print($VendorService->lastRequest());
print($VendorService->lastResponse());

Google Federated OAuth/OpenID with Tornado: why is it ignoring my scopes?

I'm trying to use Tornado's library for federated login to authenticate users and get access to their calendar, contacts, and mail. However, when I get the "mydomain.dyndns.info is asking for some information from your Google Account" message, the only bullet point listed is "Email Address". Subsequently, when I check the returned user object after I approve the request, the user object doesn't have an 'access_token' property.
Here's the code:
def get(self):
scope_list = ['https://mail.google.com/','http://www.google.com/m8/feeds/','http://www.google.com/calendar/feeds/']
...
self.authorize_redirect(scope_list, callback_uri=self._switch_command('auth_callback'), ax_attrs=["name","email"])
def _on_auth(self, user):
print 'in on auth'
if user:
self.set_the_user(user['email'])
session.set_data('usertoken_' + user['email'], user['access_token'])
self.redirect('/')
The uri that this spits out is:
https://www.google.com/accounts/o8/ud
?openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0
&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select
&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select
&openid.return_to=http%3A%2F%2Fmydomain.dyndns.info%3A333%2Fauth%2Fauth_callback%3Fperms%3Dgmail%26perms%3Dcontacts%26perms%3Dcalendar
&openid.realm=http%3A%2F%2Fmydomain.dyndns.info%3A333%2F
&openid.mode=checkid_setup
&openid.ns.oauth=http%3A%2F%2Fspecs.openid.net%2Fextensions%2Foauth%2F1.0
&openid.oauth.consumer=mydomain.dyndns.info
&openid.oauth.scope=https%3A%2F%2Fmail.google.com%2F+http%3A%2F%2Fwww.google.com%2Fm8%2Ffeeds%2F+http%3A%2F%2Fwww.google.com%2Fcalendar%2Ffeeds%2F
&openid.ns.ax=http%3A%2F%2Fopenid.net%2Fsrv%2Fax%2F1.0
&openid.ax.type.fullname=http%3A%2F%2Faxschema.org%2FnamePerson
&openid.ax.type.lastname=http%3A%2F%2Faxschema.org%2FnamePerson%2Flast
&openid.ax.type.firstname=http%3A%2F%2Faxschema.org%2FnamePerson%2Ffirst
&openid.ax.mode=fetch_request
&openid.ax.type.email=http%3A%2F%2Faxschema.org%2Fcontact%2Femail
&openid.ax.required=firstname%2Cfullname%2Clastname%2Cemail
Ideas: 1. maybe this has something to do with the fact I'm running on a local machine behind a dyndns forwarder? 2. Tornado's documentation says "No application registration is necessary to use Google for authentication or to access Google resources on behalf of a user" -- but maybe that's not true anymore?
If anyone has thoughts, I'd really appreciate it -- this is driving me a little batty!
Figured it out. You have to set the application properties google_consumer_key and google_consumer_secret.
application = tornado.web.Application(urlhandlers, cookie_secret=cookie_secret, google_consumer_key=google_consumer_key, google_consumer_secret=google_consumer_secret)
You get them by going here: https://www.google.com/accounts/ManageDomains

Resources