WebIT PayPal Standard Product

901 views
818 views

Published on

Presentation on PayPal Standard API product range, as delivered during the WebIT 2011 DevCamp in Sofia.

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
901
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
3
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • Welcome to PayPal Dev Camp!I will start this session with a BIG stereotype: people usually say that women like stability, exerience, proven solutions, whereas men are more prompt to innovative solutions et texting new things.As we will see today, PayPal is not exception! I will leave the new generation of APIs to Saulius and Corrado and I will spend the next 40 min or so on PayPal express checkout – the main API based payment method for PayPal account holders.
  • And so,
  • Caller Details and General API settings
  • Retrieve Shipping addressBilling addressAccount status
  • Retrieve Shipping addressBilling addressAccount status
  • Funds transferred from the buyer to each receiever as distributed in the SetEC/DoEC callUp to 10 receivers
  • 1 payment request per receiverUp to 10payments requests
  • Payment requests to be added to both Set EC – to be displayed to the userDo EC for the correct payment completion
  • Particularly relevant to Telco/pay monthly contracts and InsuranceAdaptable to many other industries: - utilities - loyalty schemes - petrol stations
  • No Pll payments Up to 10 Billing agreementsMerchant initiated billing if BA is with the receiverChannel Initiated billing for Gateway models -> Subject field in DoRefTxn
  • Automatic redirection/browser recognitionVersion 63 and aboveIn App Payment through Mobile Express Checkout Libraries for iPhone and AndroidPayment with username/passwordDevice specific PIN
  • Tesco prototype.A few supermarket chains have launched ‘Self Checkout’ systemsConsumer ‘borrows a scanner’ and scans items as they browse in the shop.Using the Tesco APIs, we have pushed the experience further: everyone has a smartphone today, do we really need additional hardware to scan items?
  • Pizza ExpressPay your bill at the restaurant with PayPal
  • Relatively newLimitations around functionality compared to Mobile‘Remember Me’ functionality for quicker and slicker processCharacteristics:- No physical delivery- Instant fulfillment - In context purchases- Global Distribution- Smaller Transaction Values
  • In Game PurchasesUsually low value items
  • This leads me to the end this overview- but before I hand onto the next section – a few useful places to get started with PP in general and the Express Checkout features specifically
  • WebIT PayPal Standard Product

    1. 1. 
    2. 2. 
    3. 3. protected void DoSetEC(object sender, EventArgs e) { try { caller = new NVPCallerServices(); setProfile(MyProfile, “APIUsername”,”APIPassword”,”APISignature”); MyCodec["METHOD"] = "SetExpressCheckout"; MyCodec["VERSION"] = “82“; MyCodec["CANCELURL"] = ”MyCancelURL"; MyCodec["RETURNURL"] = ”MyReturnURL”; MyCodec["PAYMENTREQUEST_0_CURRENCYCODE"] = "GBP"; MyCodec["PAYMENTREQUEST_0_PAYMENTACTION"] = "Sale"; MyCodec["L_PAYMENTREQUEST_0_NAME0"] = ”Item in my Shopping cart"; MyCodec["L_PAYMENTREQUEST_0_AMT0"] = "24.48"; MyCodec["L_PAYMENTREQUEST_0_QTY0"] = "2”; MyCodec["PAYMENTREQUEST_0_ITEMAMT"] = "43.96"; MyCodec["PAYMENTREQUEST_0_SHIPPINGAMT"] = "1.50"; MyCodec["PAYMENTREQUEST_0_AMT"] = ”45.46” caller.Initialize(); caller.APIProfile = MyProfile; MyNVPRequest = MyCodec.Encode(); MyNVPResponse = caller.Call(MyNVPRequest); MyRespoCodec.Decode(MyNVPResponse); if (MyRespoCodec["ACK"] != "Success" && MyRespoCodec["ACK"] != "SUCCESSWITHWARNING") { /*display error message*/} else { MyToken = MyRespoCodec["TOKEN"].ToString(); Response.Redirect(@"https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_express-checkout&token=" + MyToken); } } catch (Exception exp) {/*sort out exceptions*/} }
    4. 4. protected void DoGetEC(string token, string PayerID) { try { caller = new NVPCallerServices(); setProfile(MyProfile, “APIUsername”,”APIPassword”,”APISignature”); MyCodec["METHOD"] = "GetExpressCheckoutDetails"; MyCodec["TOKEN"] = MyToken; caller.Initialize(); caller.APIProfile = MyProfile; MyNVPRequest = MyCodec.Encode(); MyNVPResponse = caller.Call(MyNVPRequest); MyRespoCodec.Decode(MyNVPResponse); if (MyRespoCodec["ACK"] != "Success" && MyRespoCodec["ACK"] != "SUCCESSWITHWARNING") { /*display error message*/} else {/*Get information on the buyer and the transaction*/CollectShippingDetails(MyRespoCodec[”SHIPPTONAME"], MyRespoCodec[”SHIPTOSTREET1"], MyRespoCodec[”SHIPTOSTREET2”], MyRespoCodec[”SHIPTOCITY”], MyRespoCodec[”SHIPTOPOSTALCODE"], MyRespoCodec[”SHIPTOCOUNTRY"]); } } catch (Exception exp) {/*sort out exceptions*/} }
    5. 5. protected void DoECPayment(string token, string PayerID) { try { caller = new NVPCallerServices(); setProfile(MyProfile, “APIUsername”,”APIPassword”,”APISignature”); MyCodec["METHOD"] = "DoExpressCheckoutPayment"; MyCodec["TOKEN"] = token; MyCodec["PAYERID"] = PayerID; MyCodec["PAYMENTACTION"] = "Sale"; MyCodec["CURRENCYCODE"] = “GBP”; MyCodec["AMT"] = "39.90"; caller.Initialize(); caller.APIProfile = MyProfile; MyNVPRequest = MyCodec.Encode(); MyNVPResponse = caller.Call(MyNVPRequest); MyRespoCodec.Decode(MyNVPResponse); if (MyRespoCodec["ACK"] != "Success" && MyRespoCodec["ACK"] != "SUCCESSWITHWARNING") { /*display error message*/} else {/*Get information on the payment status*/ TxnID = MyRespoCodec[”TRANSACTIONID"] ; if (MyRespoCodec[”PAYMENTSTATUS"] != “Completed”) {/*Handle Incomplete transaction*/} else {/*Fulfill order*/} } } catch (Exception exp) {/*sort out exceptions*/} }
    6. 6. ₤₤ ₤ ₤
    7. 7. protected void DoSetEC(object sender, EventArgs e) { try { caller = new NVPCallerServices(); setProfile(MyProfile, “APIUsername”,”APIPassword”,”APISignature”); MyCodec["METHOD"] = "SetExpressCheckout"; MyCodec["VERSION"] = “82“; MyCodec["CANCELURL"] = ”MyCancelURL"; MyCodec["RETURNURL"] = ”MyReturnURL”; MyCodec["PAYMENTREQUEST_0_CURRENCYCODE"] = ”USD"; MyCodec["PAYMENTREQUEST_0_PAYMENTACTION"] = "Sale"; MyCodec["PAYMENTREQUEST_0_SELLERID"] = ”paypal@bookit.com”; MyCodec["L_PAYMENTREQUEST_0_NAME0"] = ”Booking for my hotel"; MyCodec["L_PAYMENTREQUEST_0_AMT0"] = ”423.35"; MyCodec["L_PAYMENTREQUEST_0_QTY0"] = “1”; MyCodec["PAYMENTREQUEST_0_ITEMAMT"] = ”423.35"; MyCodec["PAYMENTREQUEST_0_AMT"] = ”423.35” MyCodec["PAYMENTREQUEST_1_CURRENCYCODE"] = ”USD"; MyCodec["PAYMENTREQUEST_1_PAYMENTACTION"] = "Sale”; MyCodec["PAYMENTREQUEST_1_SELLERID"] = ”paypal@usairlines.com”; MyCodec["L_PAYMENTREQUEST_1_NAME0"] = ”Plane tickets"; MyCodec["L_PAYMENTREQUEST_1_AMT0"] = ”1348.53"; MyCodec["L_PAYMENTREQUEST_1_QTY0"] = “1”; MyCodec["PAYMENTREQUEST_1_ITEMAMT"] = ”1348.53"; MyCodec["PAYMENTREQUEST_1_AMT"] = ”1348.53”; /*Complete API call*/ } catch {/*deal with exceptions*/} }
    8. 8. 
    9. 9. protected void DoSetEC(object sender, EventArgs e) { try { caller = new NVPCallerServices(); setProfile(MyProfile, “APIUsername”,”APIPassword”,”APISignature”); MyCodec["METHOD"] = "SetExpressCheckout"; MyCodec["VERSION"] = “82“; MyCodec["CANCELURL"] = ”MyCancelURL"; MyCodec["RETURNURL"] = ”MyReturnURL”; MyCodec["PAYMENTREQUEST_0_CURRENCYCODE"] = ”GBP"; MyCodec["PAYMENTREQUEST_0_PAYMENTACTION"] = "Sale"; MyCodec["PAYMENTREQUEST_0_ITEMAMT"] = ”23.35"; MyCodec["PAYMENTREQUEST_0_AMT"] = ”23.35” MyCodec["L_BILLINGTYPE0"] = "MerchantInitiatedBilling”; MyCodec["L_PAYMENTTYPE0"] = "InstantOnly"; MyCodec["L_BILLINGAGREEMENTDESCRIPTION0"] = ”Car Insurance"; MyCodec["L_BILLINGAGREEMENTCUSTOM0"] = "MyTest"; /*Complete API call*/ } catch {/*deal with exceptions*/} } protected void StartReferenceTxn(string transactionID) { caller = new NVPCallerServices(); setProfile(MyProfile); MyCodec["METHOD"] = "DoReferenceTransaction"; MyCodec["REFERENCEID"] = transactionID; MyCodec["PAYMENTACTION"] = "Sale”; MyCodec["AMT"] = ”39.95”; MyCodec["CURRENCYCODE"] = "GBP”; MyCodec["SOFTDESCRIPTOR"] = ”Car Insurance Installment”; /*Complete API call*/ } catch {/*deal with exceptions*/} }
    10. 10. 
    11. 11. <script>var dg = new PAYPAL.apps.DGFlow({trigger: "submitBtn”});</script>https://www.sandbox.paypal.com/incontext?token=<token><script>top.dg.closeFlow();</script>
    12. 12. 

    ×