Posts

Showing posts with the label acl

Accepting payments with Stripe in APEX, Part 2

Image
Adding the PL/SQL API In the previous part of this series, we hooked up the payment form so that users can enter their credit card information to accept payment. After this, the next thing you need to do is to charge the user for the goods or services. In the payment form, it's all on the client side using JavaScript; This time, we need to make some requests in PL/SQL. There is no client libraries for PL/SQL, so we need to set up some to make requests to the Stripe API. All the Stripe API's have the base URL: https://api.stripe.com/ - so we first need to set up an ACL. Just whilst figuring everything out, we will assign this to the schema you are developing out of (down the track, when we switch to APEX_WEB_SERVICE, we can also assign the ACL to the APEX schema). DECLARE l_filename varchar2(30) := 'stripe.com.xml'; l_schema varchar2(20) := '[SCHEMA?]'; BEGIN BEGIN DBMS_NETWORK_ACL_ADMIN.DROP_ACL( acl => l_filename ...

Accessing Google Data

Image
First I want to point out, the code posted here is in my no means complete, but I believe it provides a good foundation to extend on. To point out some of what is lacking - I am not fetching the refresh token to easily get a new access token without user intervention. I am not handling when the access token is no longer valid. Etc. Also, since a lot of the responses result in JSON, I used the PL/JSON package throughout. I also unfortunately cannot set up a demo on apex.oracle.com due to the obvious limitation of the wallet, and using utl_http. You may know, google has a series of API's that allow you to access your data programatically, to create third party apps. Originally when I looked at the docs, it was using OAuth 1, and I never ended up mastering it. Oleg made a post about the differences here:  http://dbswh.webhop.net/htmldb/f?p=BLOG:READ:0::::ARTICLE:889800346602035 The google docs are here, and they are quite detailed with what to do:  https://developers.google.c...

Oracle HTTP Requests: Set up the ACL

In order to use utl_http requests from Oracle 11g onward (or any network services for that matter), you need to set up an ACL. Two generic permissions to grant are connect and resolve, where * can be used as a wild card. A good template I commonly use, just replacing the file name and schema name. This should be executed as a user with dba privileges. DECLARE l_filename varchar2(200) := 'file_test_http.xml'; l_schema varchar2(200) := 'FILE_TEST'; BEGIN BEGIN DBMS_NETWORK_ACL_ADMIN.DROP_ACL( acl => l_filename ); EXCEPTION WHEN OTHERS THEN NULL; -- ACL does not exist yet END; DBMS_NETWORK_ACL_ADMIN.CREATE_ACL( acl => l_filename , description => 'All requests to test utl_http' , principal => l_schema -- schema name , is_grant => TRUE , privilege => 'connect' ); ...