PayTrace: 400 Bad Request For Declined Payment

TLDR:  post IS successful.  PayTrace, by design, returns a 400 error, which sets off exceptions in httpresponse.  Solution: catch the exception and then continue deserializing your response.

I coded a few weeks ago a .NET post to the PayTrace API which helps me demo and test payment by credit card using client side encryption.  The process more or less went like this:

  • Create demo account as a merchant on Paytrace
  • Download PEM key
  • On submit of form with credit card information, an imported PayTraceJS library encrypts the card number and csc code
  • Use the demo account’s username and password to submit a request for a token
  • Submit transaction (which includes encrypted info as well as other required fields) using token and await response

A successful http response returns a status code of 200.  I read it via stream, deserialize it using json into my CardResponse object (both successful and failure responses have the same design).  Everything went great until I began testing rejected cards.

Azure Blob’s Ghost Folders?

This week I had to address a upload image to blob application that I had built in my development environment, was working fine, but needed to be configured to work in production.  For the application overall, I used Azure Samples for Upload Image to Storage (built in .NET Core).  In it, the configuration in appsettings.json looks like this:

"AzureStorageConfig": {
    "AccountName": "",
    "AccountKey": "",
    "ImageContainer": "images",
    "ThumbnailContainer": "thumbnails"
}

 

Account Name account name and AccountKey are easily found in Azure Portal, for container I used Azure Storage Explorer just so I could get a full look at the container and its blobs.  The problem was, in my development environment I was uploading DIRECTLY to container.  In the example above, I was uploading to the “images” container.  In my Production environment, though, my ImagesContainer had two folders:  images/small and images/large.  I tried to change the “ImagesContainer”:”images” to “ImagesContainer”:”images/small”, “ImagesContainer”:”images\small” and no go.  Requested URI not found.…

She’s Already Coding

IT? 21 .. Am I Ready for IT?
When I entered the world of web development, my company had only experienced one other woman who tried to enter IT before me. Without experience, she had mostly taken courses in Computer Science but had not handled many computers herself. The result was that she appeared “book taught”. When it came to real-life situations, she was completely unprepared. So, the company was a bit weary of trying women in IT.

My Sketchy Background
I, on the other hand, had lived in an illustrious neighborhood where people came at all hours of night to sell or trade you things. For a minimal amount! I had an endless supply of “broken” computers to build my experience on.

Don’t get me wrong, I went to a great college and pursued all I thought I wanted to do. I somehow snuck basic HTML, C++, Java classes in on the side for my “science” pre-requisites. I mean, SCIENCE!

When I went back to my small town, jobs were scarce and I just needed A JOB, any job. The last position I applied for, the future CEO recognized I had taken computer classes. He asked about those classes,

Step By Step: Accepting Checks via Telecheck, Payeezy & Direct API (.NET)

This is a very basic tutorial on dealing with Payeezy, who’s documentation I found sometimes difficult.  Some of this guidance, I only found in forum threads and so I document…

Get What You Need

  1. Merchant Demo account
  2. Developer Sandbox account
  3. Merchant Token (demo)
  4. API secret (sandbox)
  5. API key (sandbox

Using Async, Await, Plus a Slight Delay

Today’s problem dealt with how we view our invoices online.  We use an app on the iSeries that creates a PDF and delivers it to a set destination.  That destination, in our case is a regular windows server, the files landing in a small site:   pdf.mycompany.com.

My initial approach was simple, use the PHP API I have sitting on the iSeries to make a call to the program – passing it the parameters for that specific invoice, await response (which gave me the new created filename) and then redirect to that URL.  The method looks something like this:

[HttpGet]
public async Task<ActionResult> GetInvoiceAsync(int invoice)
{
    GetInvoice getInvoice = new GetInvoice();
    var client = new HttpClient();

    string fileName = await getInvoice.LoadPDF(invoice);

    string url = "http://pdf.mycompany.com/";
    url += fileName + ".pdf";

    return Redirect(url);
}

 

This worked great… 90% of the time, but the other 10% of the time, I clicked too quickly on an invoice and got forwarded to a 404.…

ASP.NET Core – Easy Transition of Bower to NPM

UPDATE (Oct 16, 2018):  I now rely on Libman for my front end management.  I use its 3 different providers to grab the libraries off of cdnjs, unpkg (supposed to include all npm) and filesystem for local files.  See post:  Using Libman Providers to Coral Front End Libraries

I love me some Bower, even with the shadow looming over it that it’s time is done.  Recently, though, it started to do something weird with just restoring/replacing packages that really began to cause problems with my project (and make for some seriously messy 99* commits).

I can do simple task running, etc but still very much a noob to packaging.

Here was my easy solution for removing Bower and switching over to NPM (and accessing those packages through Views).…