TransactionWithSlimCDApp
- DEFINITION
Method
SlimCD.Launch.TransactionWithSlimCDApp
Purpose
Launches the Slim CD app to accept payments.
Description
Allows developers to utilize the Slim CD app’s ability to accept swiped or keyed transactions, capture signatures and print receipts.
Business Rules
Developers can use our apps to avoid touching cardholder data while obtaining payments. Options allow the developer to control the display of sales tax, tip, signature and receipt screens.
Argument List
Name Required Usage xSource Required String containing a user-displayable name for the calling app xSuccess Required String containing the URL to launch at the end of processing TransactionConfig Required Object containing configuration ostems TransactionRequest Required Object containing transaction-specific items
Request Fields
Reply Fields
Reply Hierarchy
Remarks
- .NET 4.5
Include
012using SlimCD;Method
123public URI TransactionWithSlimCDApp(string xSource, string xSuccess, TransactionConfig cfg, TransactionRequest req);Request
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364string xSource - String with the name of the calling app for user display purposesstring xSuccess - String with the return URL/Protocolpublic class TransactionConfig{public string cfg_debug { get; set; }public string cfg_minimumversion { get; set; }public string cfg_amounteditable { get; set; }public string cfg_invoiceeditable { get; set; }public string cfg_salestax { get; set; }public string cfg_tip { get; set; }public string cfg_signature { get; set; }public string cfg_receipt { get; set; }}public class TransactionRequest{public string username { get; set; }public string password { get; set; }public int clientid { get; set; }public int siteid { get; set; }public int priceid { get; set; }public string key { get; set; }public string transtype { get; set; }public string clienttransref { get; set; }public string amount { get; set; }public string gratuity { get; set; }public string cashback { get; set; }public string surcharge { get; set; }public string firstname { get; set; }public string lastname { get; set; }public string address { get; set; }public string city { get; set; }public string state { get; set; }public string zip { get; set; }public string country { get; set; }public string phone { get; set; }public string email { get; set; }public string corporatecard { get; set; }public string po { get; set; }public string salestax { get; set; }public string salestaxtype { get; set; }public string clerkname { get; set; }public string allow_partial { get; set; }public string allow_duplicates { get; set; }public string kiosk { get; set; }public string send_email { get; set; }public string send_cc { get; set; }public string send_sms { get; set; }public string cc_email { get; set; }}Reply
1234567891011121314151617181920212223242526272829303132333435363738394041URI of the fully formatted protocol to launch.Note: The reply from calling the TransactionWithSlimCDApp is a URI that can be used to launch the SLIM CD app. When the SLIM CD app is finished, it will re-launch YOUR app, providing TransactionReply data in an OS-sepecific way (as either part of the URI or as PutExtra bundled data)Below is the TransactionReply data:public class TransactionReply{public string response { get; set; }public string responsecode { get; set; }public string description { get; set; }public string responseurl { get; set; }public string authcode { get; set; }public string approved { get; set; }public string cvv2reply { get; set; }public string avsreply { get; set; }public string gateid { get; set; }public string bankid { get; set; }public string corporatecardindicator { get; set; }public string invoiceno { get; set; }public string firstname { get; set; }public string lastname { get; set; }public string cardtype { get; set; }public string last4 { get; set; }public string expmonth { get; set; }public string expyear { get; set; }public string processor_token { get; set; }public string approvedhsaamt { get; set; }public string approvedamt { get; set; }public string bal { get; set; }public string returncheckservicecharge { get; set; }public string keyed { get; set; }public string tip { get; set; }public string salestax { get; set; }public string cashback { get; set; }public string surcharge { get; set; }}Sample Code
SAMPLE CODE to Retrieve the TransactionReply when your app is RE-LAUNCHED by the SLIM CD APP:
Reply Output is in XML format.
1234567Success0OKhttps://trans.slimcd.com/wswebservices/transact.asmx/CloseBatchY*875873Status Codes
123Downloads
- Include
1#import "SlimCD.h"
Method
1- (NSURL*) launchTransactionUsingSlimCDAppWithSource:(NSString*)sourceName success:(NSURL*)successURL config:(LaunchTransactionConfig*)config request:(LaunchTransactionRequest*)request;Config
123456789101112@interface LaunchTransactionConfig@property (strong) NSNumber *cfgSignature;@property (strong) NSNumber *cfgReceipt;@property (strong) NSNumber *cfgAmountEditable;@property (strong) NSNumber *cfgInvoiceEditable;@property (strong) NSNumber *cfgTip;@property (strong) NSNumber *cfgSalesTax;@property (strong) NSNumber *cfgDebug;@property (strong) NSString *cfgMinimumVersion;@endRequest
12345678910111213141516171819202122232425262728293031323334353637@interface LaunchTransactionRequest : SlimCDRequest@property (strong) NSString *userName;@property (strong) NSString *password;@property (strong) NSNumber *clientID;@property (strong) NSNumber *siteID;@property (strong) NSNumber *priceID;@property (strong) NSString *key;@property (strong) NSString *transType;@property (strong) NSString *clienttransref;@property (strong) NSString *amount;@property (strong) NSString *gratuity;@property (strong) NSString *cashback;@property (strong) NSString *firstName;@property (strong) NSString *lastName;@property (strong) NSString *address;@property (strong) NSString *city;@property (strong) NSString *state;@property (strong) NSString *zip;@property (strong) NSString *country;@property (strong) NSString *phone;@property (strong) NSString *email;@property (strong) NSString *corporateCard;@property (strong) NSString *po;@property (strong) NSString *salesTax;@property (strong) NSString *salesTaxType;@property (strong) NSString *clerkName;@property (strong) NSString *allow_partial;@property (strong) NSString *allow_duplicates;@property (strong) NSString *kiosk;@property (strong) NSString *send_email;@property (strong) NSString *send_cc;@property (strong) NSString *send_sms;@property (strong) NSString *cc_email;@property (strong) NSString *surcharge;@endReply
1NSURL containing the fully encoded URL used to launch the SlimCD App.Sample Code
1234567891011121314151617181920212223242526272829303132SlimCD *api = [[SlimCD alloc] init];// URL to call back to upon transaction completion (success or fail)NSURL *successURL = [NSURL URLWithString:@"appname://success"];// Configuration settings for the request.LaunchTransactionConfig *config = [[LaunchTransactionConfig alloc] init];// The transaction request to send.LaunchTransactionRequest *request = [[LaunchTransactionRequest alloc] init];request.transType = @"SALE";request.clienttransref = @"12345";request.userName = @"1032";request.password = @"289075";request.clientID = @1032;request.siteID = @228226448;request.priceID = @74;request.zip = @"33324";request.amount = @"1.23";// Get the URL to use to launch the SlimCD app to process this transaction.NSURL *launchURL = [api launchTransactionUsingSlimCDAppWithSource:@"Source Application Name"success:successURLconfig:configrequest:request];if ([[UIApplication sharedApplication] canOpenURL:launchURL]) {[[UIApplication sharedApplication] openURL:launchURL];}else{NSLog(@"Cannot launch SlimCD Application. Application not found?");} -
Method
Request
Reply
Sample Code
Downloads
Method To Launch Application
12345public static boolean isAppAvailable(Activity activity)public static void transactionWithSlimCDApp(Activity activity, LaunchConfigRequest cfg ,LaunchTransactionRequest request)Sample Code
12345678910111213141516171819202122232425LaunchTransactionRequest request=new LaunchTransactionRequest();request.setAmount("23");request.setClienttransref("test"); // For Invoice// To create configuration object.LaunchConfigRequest config=new LaunchConfigRequest();// set config .config.setCfg_AmountEditable(1);// To check SLimCd availability by library method.if(Launch.isAppAvailable(MainActivity.this)){// To launch the slimCD application by library method.Launch.transactionWithSlimCDApp( MainActivity.this,config,request);// finish the current activity.finish();}else{// show alert.Toast.makeText(MainActivity.this,"Please Installes SlimCD App First..",Toast.LENGTH_LONG).show();} -
Scheme
[scheme]://[host]/[action]?[x-callback parameters]&[action parameters]
scheme – The scheme should be a unique string identifier the target app. For Slim CD, this is app.slimcd.com:
host – URLs will be identified by the use of “x-callback-url” as the host portion of the URL, per the x-callback-url standard.
action – The name of the action to be executed in the target app, currently Slim CD only supports ProcessTransaction
x-callback parameters
x-source – An arbitrary string that describes the calling app. This is used to describe the calling app in any UI that may be presented by the SlimCD mobile app.
x-success – This string defines a URL to call to return control back to the calling app. Note that this URL will be called as specified, but any additional parameters required to return data back to the calling app from the requested action will be appended onto the end of this URL when it is called. We recommend the calling app also follow the x-callback-url standards.
action-parameters
Slim CD combines the data from two data structures to make the full list of action parameters. The “config” structure defines the configuration controls for the app and areprefixed with “cfg-” for each fieldname. The “request” structure define the per-transaction data for the individual transaction to be performed. The non-empty values from both structures are converted into standard URL fieldname/value pairs with ampersand separating the fields. The results are concatenated together to make the full set of action parameters. Please see the Definition tab for the definitions of each object’s properties.
Slim CD Example
The structure of a URL to launch the SlimCD mobile app is as follows:
app.slimcd.com://x-callback-url/<action> ? <x-callback-parameters> & <configuration-parameters> & <request-parameters>
Note that it is assumed that the above URL is a single string, with no spaces and with all appropriate values URL encoded as necessary to make it a valid URL.