If you don't want to use the checkout experience included with the Kite Android Print SDK (i.e. Managed Checkout) then you need to explicitly take payment from your users for the order to be printed and posted. You can create your own UI for capturing card details or you can use the PayPal Android SDK.
Payments should be made directly to Kite's PayPal account rather than your own. We then pay you based on your desired margins that you have configured in the developer dashboard. This is the recommended client side approach if you want to avoid paying for your own server(s) to validate customer payments.
Alternatively we do support a server side payment flow where the user pays you directly. In this approach you'll need a server to validate payment and issue a print request using our REST API. Your client Android app deals solely with your server to submit the print order. If your server is happy with the proof of payment it submits the order to our server on behalf of the client app. See payment workflows for more details regarding this approach.
If you haven't already, see the README for an initial overview and instructions for adding the SDK to your project.
- Create a print order representing the product(s) you wish to have printed and posted
- Set the shipping address to which the order will be delivered
- Take payment from the user
- Using the PayPal Android SDK payment flow if you don't want to create your own UI
- Alternatively create your own UI and use
PayPalCard
to process the payment
- Attach the proof of payment to the
PrintOrder
to be verified server side - Submit the
PrintOrder
to our server for printing and posting
-
Take payment from the user. There are two approaches available if you don't want to run your own servers
-
Using the PayPal Android SDK payment flow if you don't want to create your own UI. Follow the best practices laid out in the PayPal Android SDK documentation for making a payment.
You'll need to use our PayPal Client Id & Receiver Email in your transactions or the proof of payment you receive from PayPal will be rejected by our servers when you submit the print order. Depending on whether your using the Live or Sandbox printing environment our PayPal Client Id & Receiver Email values are different.
The Test/Sandbox print environment (
KiteSDK.DefaultEnvironment.TEST
) validates print order proof of payments against the Sandbox PayPal environment. The Live print environment (KiteSDK.DefaultEnvironment.LIVE
) validates print order proof of payments against the Live PayPal Environment.The
KiteSDK.DefaultEnvironment
enum has handy methods (getPayPalClientId()
,getPayPalReceiverEmail()
) for getting the correct PayPal Client Id & Receiver Email for the environment you're using. You can also get hold of the current environment you initialised usingKiteSDK.getEnvironment()
.KiteSDK.initialise( getContext(), "REPLACE_WITH_YOUR_API_KEY", KiteSDK.DefaultEnvironment.TEST ); String paypalClientId = KiteSDK.getEnvironment().getPayPalClientId(); String paypalReceiverEmail = KiteSDK.getEnvironment().getPayPalReceiverEmail();
-
Alternatively capture the users card details with your own UI and use
PayPalCard
to process the paymentPayPalCard card = new PayPalCard(); card.setNumber("4121212121212127"); card.setExpireMonth(12); card.setExpireYear(2012); card.setCvv2("123"); card.chargeCard(PayPalCard.Environment.SANDBOX, order.getCost(), PayPalCard.Currency.GBP, "A print order!", new PayPalCardChargeListener() { @Override public void onChargeSuccess(PayPalCard card, String proofOfPayment) { // set the PrintOrder proofOfPayment to the one provided and submit the order } @Override public void onError(PayPalCard card, Exception ex) { // handle gracefully } });
-
-
Attach the proof of payment to the
Order
to be verified server sideOrder order = ...; order.setProofOfPayment( proofOfPayment );
-
Submit the
Order
to our server for printing and posting.order.submitForPrinting(/*Context: */ this, new Order.ISubmissionProgressListener() { @Override public void onProgress( Order order, int primaryProgressPercent, int secondaryProgressPercent ) { // Show upload progress spinner, etc. } @Override public void onSubmissionComplete( Order order, String orderId ) { // Order was successfully submitted to the system, display success to the user } @Override public void onError( Order order, Exception error ) { // Handle error gracefully } });
- Register your payment details with us so that we can pay you when your users place orders