paypal x toolkit for force - amazon s3 x toolkit for force.com dave carroll – salesforce.com...
Post on 12-Apr-2018
239 Views
Preview:
TRANSCRIPT
PayPal X Toolkit for Force.com
Dave Carroll – salesforce.com Director, Developer Evangelism @dcarroll
Praveen Alavilli - PayPal Developer Evangelist @ppalavilli
Enable your Force.com Sites for e-commerce
Webinar Attendees see 2 components:
1. Viewer Window 2. Control Panel
Type your question here
Safe harbor statement under the Private Securities Litigation Reform Act of 1995: This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services.
The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K filed on April 30, 2008 and in other filings with the Securities and Exchange Commission. These documents are available on the SEC Filings section of the Investor Information section of our Web site.
Any unreleased services or features referenced in this or other press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.
Safe Harbor
The salesforce.com Cloud
eCommerce Enablement
How can payment platform be leveraged? – Online Store
– Partner funds distributions – Intranet Store
What do we need to know? – Data modeling
– Visualforce
– Apex Code
– Portals
– Sites
Praveen Alavilli Developer Evangelist, PayPal @ppalavilli
PayPal X Toolkit for Force.com Enable your Web sites for e-commerce
Agenda
What is PayPal X ? Adaptive Payments API Adaptive Accounts API PayPal X Toolkit for Force.com Installing Toolkit Using Toolkit Code Samples Going Live Q & A
PayPal X
Open Global Payments Platform for developers
Enables various Monetization Models Subscriptions
Pay as you use Free to use, pay to services
Freemium eCommerce
(what Force.com is for Salesforce)
A person or business whose PayPal account is being debited
A person or business whose PayPal account is being credited
The API access account who makes the Adaptive Payments service calls: usually owned by the developer
Actors Involved
Payments – oh my!
Sender Receiver Consumer Merchant Consumer Internet merchant Employer Employee Parent Child Originator Recipient Person (giver) Charity Consumer Biller Person (giver) Person Business Supplier Citizen Government Investor Developer Lender Borrower
Travelers checks Bill payments Check or draft ACH payment Cards, cards, cards Net-based payments Many others
The PayPal X Platform
Facilitates Payments - Pay anyone, receive from anyone !
Provides Account Management - Identity, Permissions, Accounts
Tools for Information and Reporting - Notifications, Reporting, Search
Adaptive Payments - API • Payment APIs
• Pay: Transfer funds between parties. Supports simple, chained, parallel, preapproved payments, etc.
• PaymentDetails: Get details of a payment
• Preapproval APIs • Preapproval: Preapproval agreement signup • PreapprovalDetails: Get details of a preapproval • CancelPreapproval: Cancel an existing preapproval
• Refund: Refund a payment (complete, partial, etc.)
• ConvertCurrency: Get currency conversion (foreign exchange) rates for a list of amounts and currencies (PayPal-supported currencies).
Simple Send Money
Basic building block allows merchants to transfer money from one entity to another
Sample Use Cases: P2P payments, Social Networks, Gaming applications, Disbursements, etc.
Preapproved Payments
• Pre-authorization of money transfer from customer (sender) to API caller
• Allows an API caller to make payments on behalf of a sender within the constraints specified
• PIN optional for future payments made within the authorized amount
• Useful for single/multi use, and subscription payments
C
Sample Use Cases: Pay as you use, Micropayments for Digital goods, Subscriptions
Parallel Payments
• Pay multiple recipients at once • Future interactions with each transaction can be separate • Enable partnership opportunities • Facilitates multiple use cases: marketplace payments, service
fees, multi-merchant checkout, and so on
$10
$40
$50
$100 Receiver X - $10 Receiver Y - $40 Receiver Z - $50
Sender Visibility
Sample Use Cases: Payouts, Disbursements, Affiliate fees, MarketPlaces
Chained Payments
• Instant payment and disbursements – Sender sees one payment to primary receiver – In one motion, money to secondary receivers sent
• Supports commission-based payments • Facilitates multiple use cases: marketplace payments, service
fees, multi-merchant checkout, and so on
$10 $40
$50
$100 Primary Receiver - $100
Sender Visibility
Sample Use Cases: Multi-Merchant Marketplaces, Gaming platform, Referral programs, Property Management (Rent Payments)
Combine Chained and Preapprovals
AND
C
Combine Parallel and Preapprovals
C
AND
SAMPLE INTERACTION FLOW A Rental App that allows tenants to pay rent to a property management
that splits the payment to the actual owner and the HOA.
Sender
Rental App
Pay API
Pay Key
Redirect User to PayPal
Return URL
Confidential and Proprietary 20 Confidential and Proprietary 20
Pay Key = PA-84HK2A57FCOP3RW
User Name = Rental_admin.api Secondary Receiver [2] = Sec Receiver_2@mail.com Password = keep$secret Amount = 50.00
Signature = 23KJHO5AS09I32SDROR Tracking ID = 234235986
Sender Email = john_m@mail.com Cancel URL = www.PayRent.com/home
Currency = USD Return URL = www.PayRent.com/apstore
Primary Receiver [0] = Prim Receiver@mail.com
Amount = 1000.00
Secondary Receiver [1] = Sec Receiver_1@mail.com
Amount = 40.00
IPN= https://www.Rental.com/IPN
Sender Email: john_m@mail.com
Receiver Email: PrimReceiver@paypal.com
Adaptive Accounts API
21
• Programmatic interface to PayPal account creation
• Account created can be used with any PayPal APIs, including Adaptive Payment APIs
• Key Functionality • Create Personal and Premier accounts • Create Business accounts* • Add Funding Sources* • Get Account Verification Status*
• Benefits: • Streamline user experience • Increase conversion
* - not supported by Toolkit yet – work in progress
Use cases for Adaptive Accounts
Marketplace
Create PayPal accounts to enable payments for games, social networking widgets and
more
Small Business As part of new employee enrollment, business collects information used to create a PayPal
account
As part of the onboarding for a buyer and seller, a PayPal account can be created so that
the user experience can be localized and personalized
22
Social Media
PayPal X toolkit for Force.com
• A set of Apex classes for accessing APIs more easily
• Takes care of transport and protocol bindings
• Provides easy way to securely manage API Credentials and common request parameters
• Supports both Adaptive Payments and Adaptive Accounts API
• Supports PayPal Sandbox, Beta and Live environments
• Test pages/Scratch Pad to play with all APIs
Getting Started With Toolkit
• Create PayPal Developer Account • Sign-up on X.com • Obtain ApplicationID from MyApps page
• Create PayPal Sandbox Test Accounts • Sign-up on developer.paypal.com • Create test accounts (buyer/seller) for Sandbox • Obtain API Credentials
• Install Toolkit • From CodeShare (package or source code)
• Configure Toolkit • API Credentials (Certificate or Signature) • Common request parameters • Remote Site
• Play with Test Tools
API Credential Object
Common Request Parameters
Test Tools
Using The Toolkit
• Initialize Toolkit • PPAdaptiveToolkit object with the required API Credentials • PPAdaptiveToolkit toolkit = new PPAdaptiveToolkit('SandboxCert');
• Create Request object • PPPayRequest payRequest = new PPPayRequest('REQ-PARAMS1',
SenderEmail); • payRequest .CancelUrl = 'https://' + host + '/PayApiTest?
MainMessage=cancel'; • payRequest .ReturnUrl = 'https://' + host + '/PayDetailTest?payKey=$
{payKey}'; • Execute the API call
• PPPayResponse payResponse = toolkit.Pay(payRequest );
• Handle the response object – if( payResponse.PaymentExecStatus.equalsIgnoreCase('Created') ) {
// send user to paypal for confirmation } else if( payResponse.PaymentExecStatus.equalsIgnoreCase('Completed') ) { // success } else { /*handle error */ }
Code Samples – Simple Payment // create request envelope and set the common request parameters object name
PPPayRequest request = new PPPayRequest('MyRequestParams', paypalSenderId); // set success and cancel urls
request.CancelUrl = 'https://' + host + '/StoreFront?status=cancel'; request.ReturnUrl = 'https://' + host + '/StoreFront?status=success';
// set a note associated with the payment request.Memo = message; // set Receiver info List<PPReceiver> receiverList = new List<PPReceiver>(); PPReceiver receiver1 = new PPReceiver(); // set the receiver email (receiver's PayPal Id) receiver1.email = paypalReceiverId; // set amount to be credited to the receiver's account receiver1.amount = amount; receiverList.Add(receiver1); // set receiver info in the request request.receiverList = receiverList; // create the Adaptive Toolkit object instance w/ API Credentials PPAdaptiveToolkit toolkit = new PPAdaptiveToolkit('SandboxCert'); try { // send the PayRequest using the Adaptive toolkit object PPPayResponse response = toolkit.pay(request); // check the response payment status if ( response.PaymentExecStatus.equalsIgnoreCase('Created') ) { // payment status is 'Created' - send the user to approval page
returnPage = toolkit.commitpayment(response.payKey); } else if( response.PaymentExecStatus.equalsIgnoreCase('Completed') ) { // the payment is 'Completed' (when no approval is required // - returned in case of pre-approvals or implicit approvals) // send the user to the return url returnPage = new pagereference(request.returnUrl); } return returnPage; } catch(PPFaultMessageException faultMsg) { /* handle errors */}
Code Sample – Chained/Parallel Payment PPReceiver receiver1 = new PPReceiver();
// set the receiver email (receiver's PayPal Id) receiver1.email = paypalReceiverId1; // set amount to be credited to the receiver's account receiver1.amount = amount1; // set the primary flag to indicate if it’s a chained (true) or parallel (false)
payment receiver1.Primary = true; receiverList.Add(receiver1);
PPReceiver receiver2 = new PPReceiver(); // set the receiver email (receiver's PayPal Id) receiver1.email = paypalReceiverId2; // set amount to be credited to the receiver's account receiver1.amount = amount2; receiverList.Add(receiver2); // set receiver info in the request request.receiverList = receiverList;
Code Sample – Preapprovals // create request envelope and set the common request parameters
object name PPPreapprovalRequest request = new PPPreapprovalRequest
('MyRequestParams', paypalSenderId); // set success and cancel urls request.CancelUrl = 'https://' + host + '/StoreFront?status=cancel'; request.ReturnUrl = 'https://' + host + '/StoreFront?status=success'; // set a note associated with the payment request.Memo = message; // set Date of Month when the payment can be made using this
preapproval request.DateOfMonth = 1; // set Day of week when the payment can be made using this
preapproval request.DayOfWeek = 'WEDNESDAY'; // set the end date request.EndingDate = DateTime.newInstance(2010, 12, 31); // set the max amount per payment request.MaxAmountPerPayment = 10; // set max number of payment made using this preapproval request.MaxNumberOfPayments = 5; // set max number of payments made using this preapproval per period request.MaxNumberOfPaymentsPerPeriod = 1; // set max total payments using this preapproval request.maxTotalAmountOfAllPayment = 100; // set the payment period request.PaymentPeriod = 'DAILY'; // set a request pin to be associated with the preapproval request.PinType = ‘REQUIRED'; // or NOT_REQUIRED request.StartingDate = DateTime.newInstance(2009, 11, 8);
// create the Adaptive Toolkit object instance w/ API Credentials
PPAdaptiveToolkit toolkit = new PPAdaptiveToolkit('SandboxCert');
try { // send the PayRequest using the Adaptive toolkit object PPPayResponse response = toolkit.preapproval(request); // check the response payment status if
( response.PaymentExecStatus.equalsIgnoreCase('Created') ) {
// if the payment status is 'Created' - send the user to approval page returnPage = toolkit.commitpreapproval(response.payKey);
} else if( response.PaymentExecStatus.equalsIgnoreCase('Completed') ) {
// if the payment is 'Completed' (when no approval is required
// - returned in case of pre-approvals or implicit approvals) // send the user to the return url
returnPage = new pagereference(request.returnUrl); } return returnPage; } catch(PPFaultMessageException faultMsg) {
/* handle exceptions */ }
Going Live
1. Upgrade to a PayPal Business Account
2. Get Verified
3. Obtain Live API Credentials
4. Submit App on X.com for review
5. Follow the Salesforce “How to Publish” guide.
WHAT’S COMING NEXT
• Support for Business Account Creation
• Support for obtaining Account verification status
• Support for adding Funding Sources
• Receive IPNs
Let us know what you need! (30% of our roadmap is based on your feedback)
www.x.com Twitter: @paypalx, @ppalavilli www.facebook.com/paypalx
Q & A
top related