I recently had an issue with printing a report to PDF using Microsoft Reporting Service and a RDLC file, etc. Something similar to this. Unfortunately, it worked great in development, but refused to work once deployed into Azure. No matter what I did, I could not duck the GDI errors I kept getting, and apparently this continues through a line of various PDF exporting extensions, all of which rely on GDI for export. Turns out, I’m not alone in facing this problem and so, I decided to find a solution.
My general idea was to use something to render my PDF view, send that view as one long html string to a free PDF microservice and get the PDF in return.…
New Environment, New Approach
It’s Day 1, my first Microsoft Build, and I was not prepared for the sheer numbers nor format. I tediously worked out this schedule with sessions and back up sessions (in case, I don’t know… tripped on the way to the first one?). I lost my OCD mind when I realized these sessions were held open format in the MIDDLE OF THE EXPO!
I quickly realized the “sessions” were to show off their specialty. To draw you in by topic, touch on some “new” topics you hadn’t heard of, and get you to come talk to them. The presentation was not so much a sales pitch as it was a “let me help you develop on our platform.” Interesting……
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.…
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:
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.…
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
- Merchant Demo account
- Developer Sandbox account
- Merchant Token (demo)
- API secret (sandbox)
- API key (sandbox
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:
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";
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.…