Posts

Showing posts with the label apex

Accepting payments with Stripe in APEX, Part 3

Image
Hooking everything up in APEX In part 1 of the series, we set up a form that would accept payment information. In part 2 we set up a PL/SQL API. Now, the final step is that we want to actually charge the card after the user submits the payment information, which is relatively straight forward. First, we can set up a couple of substitution strings for our stripe secret and the wallet information Next, add a new (hidden) item to the page that we can set the token into it (I called mine "P1_PMT_TOKEN"). Once that is on the page, we can modify our existing dynamic action (from part 1), so the code now looks like: var handler = StripeCheckout.configure({ key: 'pk_test_oXgwgmJbBmhzODwHxoKE8zAz', locale: 'auto', token: function(token) { $s('P1_PMT_TOKEN', token.id); } }); handler.open({ name: 'Demo Site', description: '2 widgets', currency: "aud", amount: 2000 }); Now, after the...

Accepting payments with Stripe in APEX, Part 1

Image
I've just been investigating a payment gateway for an APEX application. I already knew about the recent startup Stripe, and their fees seemed just as good (if not better) than the other well-known contenders - I figured there would be a good place to start. Now, I haven't actually worked with the others, but so far, I'm very impressed with the system/API available. From my little bit of research, all the card information will be stored on Stripe's servers, so we need not deal with storing and encrypting customers card information. With that, we are left with this general workflow: Include a form for customers to enter there card information The form gets submitted to Stripe's servers Returned is a token. We use this to then complete the charge For this first part, I'll be focusing on the form. In particular, Stripe provides a form for us that we can re-use. Check out the documentation on the form here -  https://stripe.com/docs/tutorials/checkout . K...

APEX Dashboard Competition for English Locale

Image
The other day Tobias announced a new competition where you can win Apple products, and what you need to do is build a dashboard in Oracle Application Express using some supplied data. Your are invited to the #orclapex Dashboard Competition: https://t.co/u47QyBRtVN #letswreckthistogether pic.twitter.com/G2fLM9kzw1 — Tobias Arnhold (@tobias_arnhold) January 17, 2016 I'm about to go on a little trip so I thought I'd load up this data into my local VM so that if I had some down time, I could have a play around with it (not yet sure if I'll enter!). The only problem was, I started receiving errors during the data import, as per: As from that screenshot, you will see the number is using a decimal point as a comma (as opposed to what I am used to, and what the session is expecting, a period). To be honest, I didn't even realise different locale's used different decimal marks - but after turning to Wikipedia, I see there are a large number of nations tha...

Upgrading APEX on XE without the patch sets

Image
To get APEX patch sets requires a paid support account to get access to the patch sets for minor updates - so upgrading APEX on our XE database installations can be challenging for those of us without a paid support account. So effectively, what you need to do is remove APEX, and re-install from scratch. APEX also comes with a Java program to perform backups, where you can for example export invididual workspaces, export all workspaces, export invidual applications, export applications by workspace id, or export all applications. I grabbed the idea from this apexbackup project on GitHub:  https://github.com/OraOpenSource/apexbackup . Basically, you need to set your CLASSPATH to point to: The Oracle Java database driver - typically $ORACLE_HOME/lib/ojdbc5.jar or $ORACLE_HOME/jdbc/lib/ojdbc5.jar The utilities folder in the APEX installation files After that has been set,  you can run the program. e.g:  export CLASSPATH=$ORACLE_HOME/jdbc/lib/ojdbc5.jar:$ORACLE_...

APEX Instance Admin Preferences Cheat Sheet

Image
APEX comes with an API - APEX_INSTANCE_ADMIN - where you can both get and set instance preferences. There is a list of available properties on the documentation, however I found that not all preferences were documented there. For example, in Feature Configuration, there are some preferences surrounding packaged applications: Looking at the documentation,  https://docs.oracle.com/cd/E59726_01/doc.50/e39149/apex_instance.htm#CHDFEICJ , you may find it difficult locating these. Then, there other properties in there that I don't think are relevant any more (..but not an expert on the subject, so may be wrong). Lets take the example of  PASSWORD_HISTORY_DAYS  - this states " Defines the maximum number of days a developer or administrator account password may be used before the account expires. The default value is 45 days. ". We can locate the property it's talking about under Security - Authentication Control - Development Environment Settings. ...

Building an Oracle 11G XE Server with APEX 5, ORDS and SQLcl in 30 minutes

Image
Pre-requisites 1. You have VirtualBox installed 2. You have the necessary Oracle installation files (oracle-xe, apex5, ords3 and sqlcl) Oracle XE - download from:  http://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html Apex 5 - download from:  http://www.oracle.com/technetwork/developer-tools/apex/downloads/index.html ORDS 3 - download from: http://www.oracle.com/technetwork/developer-tools/rest-data-services/downloads/index.html SQLcl - download from:  http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html 3. You have the installation image for CentOS - I just grabbed the Minimal image from a local mirror -  http://centos.mirror.digitalpacific.com.au/7/isos/x86_64/ Set up the virtual machine Give the Virtual machine an appropriate name, and since CentOS is based off Red Hat, specify the type as Red Hat (64-bit). Allocate 1GB RAM Create a new virtual hard drive...

Building dynamic forms

How do I build a dynamic form? Well first, you need to have your questions stored somewhere, so we set up the following (basic) model: CREATE TABLE DYNAMIC_QS( ID NUMBER PRIMARY KEY, QUESTION_KEY VARCHAR2(20) NOT NULL, QUESTION_TYPE VARCHAR2(20) NOT NULL, QUESTION_SEQ NUMBER NOT NULL ); / CREATE TABLE DYNAMIC_ANS( ID NUMBER PRIMARY KEY, QUESTION_KEY VARCHAR2(20) NOT NULL, QUESTION_ANS VARCHAR2(4000) NOT NULL ); / create sequence dynamic_qs_seq; / create or replace trigger BI_DYNAMIC_ANS before insert on DYNAMIC_ANS for each row begin :NEW.ID := dynamic_qs_seq.nextval; end BI_DYNAMIC_ANS; / insert into DYNAMIC_QS values (1, 'NAME', 'TEXT', 10); insert into DYNAMIC_QS values (2, 'AGE', 'TEXT', 20); insert into DYNAMIC_QS values (3, 'ADDRESS', 'TEXTAREA', 30); / create or replace view v_dynamic_qs as select dynamic_qs.id , dynamic_qs.question_key , dynamic_qs.question_type , dynamic_ans.quest...