Created
December 8, 2015 16:12
-
-
Save paladintodd/471c1f3a154bf29a0aec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET PROCEDURE TO w:\vfp7com\prog\StripeX ADDITIVE | |
SET CLASSLIB TO w:\vfp7com\apps\libcurl\libcurl ADDITIVE | |
local o | |
o = NEWOBJECT("StripeX") | |
o.cAPIKey = "YourKeyGoesHere" | |
IF !o.Authenticate() && Make sure Stripe working | |
?"Auth", "Failed", o.cErrorMessage | |
return | |
endif | |
LOCAL lCount | |
lCount = 0 | |
* Get a list of all plans | |
lCount = o.PlanList() | |
?"# Plans found : " + TRANSFORM(lCount) | |
if lCount > 0 | |
LOCAL lCount | |
lCOunt = 0 | |
SELECT CurStripePlan | |
lCount = 0 | |
SCAN | |
lCount = lCount + 1 | |
?" Plan #" + TRANSFORM(lCount) + " ID: " +; | |
ALLTRIM(CurStripePlan.ID) | |
ENDSCAN | |
ENDIF | |
* Retrieve a plan | |
SELECT CurStripePlan | |
GO top | |
?"Retrieve Plan " + ALLTRIM(CurStripePlan.ID) + " : " + IIF(o.PlanRetrieve(CurStripePlan.ID), "Success", "Fail") | |
?" ID : " + o.ObjectExtract("id", o.cData) | |
?" Name : " + o.ObjectExtract("name", o.cData) | |
?" Amount : " + TRANSFORM(o.ObjectExtract("amount", o.cData)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment