Create Refund on square_connect Ruby sdk gives INTERNAL SERVER ERROR - square

I am using square_connect ruby gem to refund payments.
body =
#<SquareConnect::CreateRefundRequest
#amount_money=#<SquareConnect::Money #amount=200, #currency="USD">,
#idempotency_key="be70cc12-28dd-4168-96ea-6eb78f299207",
#tender_id="asdkasdkakdakdakda">
All other parameters are just as intended. I have changed Tender key too.
result = api_instance.create_refund(authorization, location_id, transaction_id, body)
This gives me INTERNAL SERVER ERROR.
ETHON: performed EASY effective_url=https://connect.squareup.com/v2/locations/BP6GXQNEANA9B/transactions/b2fd4689-af1b-40a4-b706-aafd592e1111/refund response_code=500 return_code=ok total_time=1.883598
SquareConnect::ApiError: Internal Server Error - {"errors":[{"category":"API_ERROR","code":"INTERNAL_SERVER_ERROR","detail":"An internal error has occurred, and the API was unable to service your request."}]}

Are you sure that your tender_id matches a tender you want to refund? 500 isn't the correct response, but it seems like you are likely not selecting a correct tender to refund.
Also you should look into upgrading your SDK to the latest version.

This is a major bug in the Square Connect API. I was actually trying with a wrong transaction ID, instead of getting something like "Incorrect Transaction ID" I was getting 500 Internal Server Error.
I have been using Stripe, Payflow. Authorize.net, Braintree and Moneris API for almost 2 years now but I have never received a 500 Internal server error for a wrong transaction Id. So Square needs to address it on urgent basis.

Related

Datastream Troubleshoot: "An unknown error occurred. Please try again. If the error persists, contact Google support"

We are trying to replicate data from AlloyDB to Bigquery using Datastream.
We Get "An unknown error occurred. Please try again. If the error persists, contact Google support."
In the Datastream console --> objects list, we see all source tables with Object Status "Failed" and Backfill status "Completed".
In Bigquery we see only a subset of the tables (not all the "Completed" objects were synced).
In the Logs Explorer I can see this error on BQ:
I also see this error: error: {
code: 11
message: "Unsupported primary key column either does not exist or is a pseudocolumn at [1:401]"
}
The column referred in the error is of type enum.
The desired situation is having all the AlloyDB tables replicated into Bigquery.
The error message is not very informative...
What does it mean?
What would be the best way to go about troubleshooting this?
We're actively working on making these error messages be more informative, and improvements are continuously being rolled out as we identify more edge cases. Assuming you followed all the steps in the documentation, then you may need to open a ticket with support for further investigation. If a support ticket isn't an option, you can still report the issue using the public issue tracker
I just had this same issue but connecting to a PostgreSQL in AWS RDS:
Beginning with Postgres 10, passwords are encrypted using SCRAM-SHA-256 in PostgreSQL. Google DataStream still expects MD5 password encryption, or it will generate an "unknown error" in the logs and fail the backfills.
You'll need to update your postgresql.conf (or RDS Cluster Parameter Group if you're using AWS like me):
password_encryption = 'MD5'
Restart the database and make sure the parameter has changed with:
SHOW password_encryption;
Reset the password of your users:
ALTER USER "{username}" with password '{password}';
More info from the PostgreSQL docs: https://www.postgresql.org/docs/current/auth-password.html

how to make sense of People APIs responses?

When calling People API's endpoints, especially in Batch requests, we're getting many different types of error responses.
Some have useful explanation in the error message, like:
Quota exceeded for quota metric 'Daily Contact Writes (Batch requests
cost 200 quota)' and limit 'Daily Contact Writes (Batch requests cost
200 quota) per day per user' of service 'people.googleapis.com' for
consumer 'project_number:XXX'.
Which you can detect and properly handle, e.g. wait for 24 hours before retrying that request, but some are more cryptic, such as:
Resource has been exhausted (e.g. check quota).
This does mention rate-limiting, but for which quota? Is it per-user or per GCP project? When can we retry this?
Note that we're getting this for the first batch call when syncing a user account, so I'm guessing this is not per-user quota, but there's no mention of such rate-limits in the docs.
Specifically, having issues handling:
"Sync quota exceeded"
"Resource has been exhausted (e.g. check quota)"
"MY_CONTACTS_OVERFLOW_COUNT"
Here's what I have so far, feel free to edit this answer to add more insights:
Authentication or Google backend issues:
"invalid_grant": bad access token
"Insufficient Permission": access token doesn't contain required scope
"The service is currently unavailable.": Google issue
"Internal error encountered.": Google issue
"Authentication backend unavailable.": Google issue
Quota and rate-limiting:
"Sync quota exceeded": ???
"Quota exceeded for quota metric X": A specific quota had been exceeded (per min / daily will be part of the message)
"Resource has been exhausted (e.g. check quota)": ???
"MY_CONTACTS_OVERFLOW_COUNT": ???
Bad requests:
"Request contains an invalid argument": something is wrong in the request, usually a Person object with some illegal info item
"Request contains a person.etag that is different than the current person.etag": An attempt to update a person that was recently updated on Google's side, need to fetch again
"Request person.etag is different than the current person.etag": same as above
"Requested entity was not found": An attempt to update a no-longer existing person
"Contact person resources are not found": same as above
"Contact group name is empty, expected to be non empty": An attempt to create/update a group with an empty name.
"Contact group name already exists": An attempt to create a group with the same name
"MY_CONTACTS_OVERFLOW_COUNT" happens when you try to insert contacts to a google account, but they already have the maximum number of contacts.
I am not 100% sure, but this limit seems to be ~20,000 for "normal"/"free" google accounts.
edit- The limit is 25,000, since 2011: https://workspaceupdates.googleblog.com/2011/05/need-more-contacts-in-gmail-contacts.html

Error upon getting transactions received by address using bitcoin-cli

I've got problem with printing transactions received on address.
On my machine I've got full sync node
but still cannot get transactions on address. Command which I use:
bitcoin-cli getreceivedbyaddress ADDRESS
Result:
error code: -4
error message:
Address not found in wallet
Is there anything more that I should do?
getreceivedbyaddress is a wallet RPC query. It queries your own wallet.
Bitcoind does not maintain a full per-address index of the blockchain.
To query any address you should use importaddress RPC call
importaddress "address" ( "label" rescan p2sh ) Adds an address or
script (in hex) that can be watched as if it were in your wallet but
cannot be used to spend. Requires a new wallet backup.
rescan is on by default and rescanning can take some time.

Why do I keep getting a 500 error when I calling the SoftLayer_Billing_Invoice::getItems interface?

Recently I was developing a project that relied on the softlayer interface. I want get the invoice details about the bare metal server. But I keep getting a 500 error when I call the SoftLayer_Billing_Invoice::getItems interface. And other interfaces are normal.
regards~
code show as below:
client = SoftLayer.create_client_from_env(username="username",
api_key="api_key",
proxy="proxy")
sl_billing_invoice = client['Billing_Invoice']
try:
result = sl_billing_invoice.getItems(id=id)
print result
except SoftLayer.SoftLayerAPIError as sl_exc:
msg = 'result:(%s, %s)' % (sl_exc.faultCode, sl_exc.faultString)
print msg
Return error message as blow:
result:(500, 500 Server Error: Internal Server Error)
The issue is likely that your request is returning a big amount of data, this case commonly happens with invoices and billing items. In order to solve that issue you have the followings options:
Reduce the amount of data through object-masks or using object-filters.
Use pagination (result limits) in order to fetch less data in the request.
result = sl_billing_invoice.getItems(limit=50, offset=0, id=id)
Softlayer doc and similar questions:
https://softlayer.github.io/blog/phil/how-solve-error-fetching-http-headers/
https://softlayer-python.readthedocs.io/en/latest/api/client.html?highlight=limit#making-api-calls
Softlayer getAllBillingItems stopped working?
Getting 500 Internal Server Error from Account.getVirtualGuests()
getInvoices method failing
Getting "error": "Internal Error" on Postman and getting error Can not deserialize instance of java.util.ArrayList out of START_OBJECT token

Paypal error 10413

I am working with the paypal express checkout API and am having issues.
I have a request like so:
METHOD=SetExpressCheckout
...
&L_PAYMENTREQUEST_0_NAME0=Individual%20Gross%20&%20Net
&L_PAYMENTREQUEST_0_AMT0=65.00
&L_PAYMENTREQUEST_0_QTY0=1
&PAYMENTREQUEST_0_AMT=70.26
&PAYMENTREQUEST_0_TAXAMT=5.26
&PAYMENTREQUEST_0_ITEMAMT=65.00
&PAYMENTREQUEST_0_PAYMENTACTION=Sale
&PAYMENTREQUEST_0_CURRENCYCODE=USD
I have reviewed this many times and see no error in the math, yet this is what paypal sends me.
TIMESTAMP : 2017-03-22T01:41:05Z
CORRELATION ID : e22e8009c7018
ACK : Failure
VERSION : 88.0
BUILD : 31129382
L_SEVERITYCODE0 : Error
Error Code : 10413
Transaction refused because of an invalid argument. See additional error messages for details.
The totals of the cart item amounts do not match order amounts.
I found that PayPal responded this way because I did not include L_PAYMENTREQUEST_0_NUMBER0 . After including that field, it was accepted. I must say that the error message sent to me lead to me to the wrong issue