PROGRESS REPORT LOOKING FOR HIRE FOR PAYPAL CODINGS IF CURRENT CODER DOES NOT FINISH THE WORK, BUT I LIKE TO BE OPTIMIST SO WE SHALL SEE:)
ALSO FOR TO INSTALL AN EMAIL SERVER FOR THE SITE FOR BIZ REASONS
ONCE ALL IS TESTED THEN GET THE SSL ENCRYPT CERTIFICATE:)
PLZ KINDLY HAVE PATIENCE:) I POST UPDATES HERE SO ALL CAN SEE PLZ KEEP CHECKING BACK ON OUR PROGRESS AS WE GO.:)
==============================================
PAYPAL PAYMENTS JAVA CODING JOB REQUIREMENTS
Phil McDavid describes key specifications required for paypal payments job
download structural schematic diagram entire ATE project
download java trading app www.cyanspring.com which houses java paypal payments coding
DOUBLE CLICK PIC TO ENLARGE TO DESKTOP FULL SIZE
Paypal Payments Processing Coding
hi started this as SSI does not cover the bills, need help the paypal payments coding is more complex than I knew but I have researched it best can (am working on learning to do java coding but long way to go) Thx in advance all who help make this happen, many will also.
Im Philmcdavid@yahoo.com doing AlgoTradersEdge.com needing such a generic app which is best described within a coder job description which covers it all: it is clear a generic version of this needed paypal payments code is a must have for custom app pymts
java paypal payments gateway integration skills reqd: linux, java, paypal, design, coding, ubuntu
BIG POINT: IPN LISTENER w CHAINED ADAPTIVE PAYMENTS coding also a SECURE GUI for changing, new franchise config
the chained adaptive payment transfers taxes including VAT, for tax collections, also partner shares payments, etc., whenever CC trx,
ALSO JAVASCRIPT for paste into front login for cyanspring trading app GUI client downloads for home account access to their server acct
so java or java script samples of these are included below also their source used AGAIN BELOW ARE IPN CODES TO START WITH
BY BUILDING A CUSTOM GUI FOR BOTH CHAINED ADAPTIVE PAYMENTS ALSO FOR LOG IN AUTHENTICATION, ALL CAN USE
jpb description gives details needed for this project:
JAVA PAYPAL PAYMENTS INTEGRATION JAVA APP ON LINUX OS
ad revised includes WHAT WE NEED for ipn listener featurs & source code sample for java example
ATTN awaiting as many job bids as possible then contact best candidates on paypal/java experience
plz include exact job ad you are with, as I sent many & need recheck ur experience, paypal coding and java coding background, as these are main rqmts, double click
www.paypalpaymentsflowchart.blogspot.com must include ipn listener, authentication log in credentials feature, and chained adaptive payment SDK coding for java SO PLZ IF U HAVE NO JAVA PAYPAL CODING EXPERIENCE DO NOT APPLY IF U CAN NOT CODE THIS FLOWCHART, WE HAD 1 BAD HIRE DONT WANT REPEAT THX. notes on source files reqd:
ull need these resources see these:
sample ipn paypal payments source code NEED SECURE GUI WINDOW 4 CHANGE/CONFIG ADAPTIVE PAYMENTS SETTINGS, FOR ALL&NEW FRANCHISE OWNERS, PRICE, EMAIL, ETC
http://codeoftheday.blogspot.com/2013/07/paypal-button-and-instant-payment_6.html gives sample ipn java coding
=================
http://paypal.github.io/sdk/#adaptive-payments
================
https://developer.paypal.com/docs/classic/products/adaptive-payments/
================
https://developer.paypal.com/docs/integration/direct/identity/log-in-with-paypal/
=================
https://developer.paypal.com/docs/classic/lifecycle/goingLive/ test in SANDBOX IF WORKS OR NOT SIMULATE TEST BEFORE DONE THX
===============
MAIN CODING REQMTS JOB DESCRIPTION
Ubuntu linux os with java trading app requires paypal payments gateway integration written to work with java on top of ubuntu linux OS. Paypal payments coding must include ipn listener, paypal log in authentication checks active subscriber credentials if not new client, also chained adaptive payments sdk for when a subscriber transaction is received, that taxes, partners payments go out directly from the transaction at time of each subscriber funds received. Percentage basis varies for subscripyion biz model versus franchise biz model, vs franchise VAT UK,EU franchise biz model due to different fees being charged with each, so there must also be GUI window to use for new franchise owners to program in their own paypal account payment email address, GUI must be very secure, same for client accounts user and franchise databases. IPN listener must include authentication, ipn listener, and chain adaptive payments coding SDK with certification from Paypal sandbox testing for ok from paypal for payments. You must be paypal payments expert for this job,strong experience prior paypal gateway experience a must with references. Please view job front website: www.algotradersedge.com, also view the paypal payments flowchart best flowchart dataflow we could design to best show dataflow process. www.paypalpaymentsflowchart.blogspot.com CONTACT Philmcdavid@yahoo.com with fixed price quote, resume previous same type work, and references
=================================
HERE IS FLOWCHART FOR THIS PROJECT'S DATAFLOW: BE SURE DOUBLE CLICK ON FLOWCHART DIAGRAM TO ENLARGE IT FULL DESKTOP SIZE
www.paypalpaymentsflowchart.blogspot.com
=================================
here is sample code for the IPN listener main key to the app:
* Paypal Button and Instant Payment Notification (IPN) Integration with Java
* http://codeoftheday.blogspot.com/2013/07/paypal-button-and-instant-payment_6.html
*/package smhumayun.codeoftheday.PaypalIpnExample;
import javax.net.ssl.HttpsURLConnection;
import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.URL;
import java.net.URLEncoder;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Paypal IPN Notification Handler Class
*
* User: smhumayun
* Date: 7/6/13
* Time: 5:48 PM
*/
public class IpnHandler
{
private Logger logger;
private IpnConfig ipnConfig;
private IpnInfoService ipnInfoService;
/**
* This method handles the Paypal IPN Notification as follows:
* 1. Read all posted request parameters
* 2. Prepare 'notify-validate' command with exactly the same parameters
* 3. Post above command to Paypal IPN URL {@link IpnConfig#ipnUrl}
* 4. Read response from Paypal
* 5. Capture Paypal IPN information
* 6. Validate captured Paypal IPN Information
* 6.1. Check that paymentStatus=Completed
* 6.2. Check that txnId has not been previously processed
* 6.3. Check that receiverEmail matches with configured {@link IpnConfig#receiverEmail}
* 6.4. Check that paymentAmount matches with configured {@link IpnConfig#paymentAmount}
* 6.5. Check that paymentCurrency matches with configured {@link IpnConfig#paymentCurrency}
* 7. In case of any failed validation checks, throw {@link IpnException}
* 8. If all is well, return {@link IpnInfo} to the caller for further business logic execution
*
* @param request {@link HttpServletRequest}
* @return {@link IpnInfo}
* @throws IpnException
*/
public IpnInfo handleIpn (HttpServletRequest request) throws IpnException {
logger.info("inside ipn");
IpnInfo ipnInfo = new IpnInfo();
try
{
//1. Read all posted request parameters
String requestParams = this.getAllRequestParams(request);
logger.info(requestParams);
//2. Prepare 'notify-validate' command with exactly the same parameters
Enumeration en = request.getParameterNames();
StringBuilder cmd = new StringBuilder("cmd=_notify-validate");
String paramName;
String paramValue;
while (en.hasMoreElements()) {
paramName = (String) en.nextElement();
paramValue = request.getParameter(paramName);
cmd.append("&").append(paramName).append("=")
.append(URLEncoder.encode(paramValue, request.getParameter("charset")));
}
//3. Post above command to Paypal IPN URL {@link IpnConfig#ipnUrl}
URL u = new URL(this.getIpnConfig().getIpnUrl());
HttpsURLConnection uc = (HttpsURLConnection) u.openConnection();
uc.setDoOutput(true);
uc.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
uc.setRequestProperty("Host", "www.paypal.com");
PrintWriter pw = new PrintWriter(uc.getOutputStream());
pw.println(cmd.toString());
pw.close();
//4. Read response from Paypal
BufferedReader in = new BufferedReader(new InputStreamReader(uc.getInputStream()));
String res = in.readLine();
in.close();
//5. Capture Paypal IPN information
ipnInfo.setLogTime(System.currentTimeMillis());
ipnInfo.setItemName(request.getParameter("item_name"));
ipnInfo.setItemNumber(request.getParameter("item_number"));
ipnInfo.setPaymentStatus(request.getParameter("payment_status"));
ipnInfo.setPaymentAmount(request.getParameter("mc_gross"));
ipnInfo.setPaymentCurrency(request.getParameter("mc_currency"));
ipnInfo.setTxnId(request.getParameter("txn_id"));
ipnInfo.setReceiverEmail(request.getParameter("receiver_email"));
ipnInfo.setPayerEmail(request.getParameter("payer_email"));
ipnInfo.setResponse(res);
ipnInfo.setRequestParams(requestParams);
//6. Validate captured Paypal IPN Information
if (res.equals("VERIFIED")) {
//6.1. Check that paymentStatus=Completed
if(ipnInfo.getPaymentStatus() == null || !ipnInfo.getPaymentStatus().equalsIgnoreCase("COMPLETED"))
ipnInfo.setError("payment_status IS NOT COMPLETED {" + ipnInfo.getPaymentStatus() + "}");
//6.2. Check that txnId has not been previously processed
IpnInfo oldIpnInfo = this.getIpnInfoService().getIpnInfo(ipnInfo.getTxnId());
if(oldIpnInfo != null)
ipnInfo.setError("txn_id is already processed {old ipn_info " + oldIpnInfo);
//6.3. Check that receiverEmail matches with configured {@link IpnConfig#receiverEmail}
if(!ipnInfo.getReceiverEmail().equalsIgnoreCase(this.getIpnConfig().getReceiverEmail()))
ipnInfo.setError("receiver_email " + ipnInfo.getReceiverEmail()
+ " does not match with configured ipn email " + this.getIpnConfig().getReceiverEmail());
//6.4. Check that paymentAmount matches with configured {@link IpnConfig#paymentAmount}
if(Double.parseDouble(ipnInfo.getPaymentAmount()) != Double.parseDouble(this.getIpnConfig().getPaymentAmount()))
ipnInfo.setError("payment amount mc_gross " + ipnInfo.getPaymentAmount()
+ " does not match with configured ipn amount " + this.getIpnConfig().getPaymentAmount());
//6.5. Check that paymentCurrency matches with configured {@link IpnConfig#paymentCurrency}
if(!ipnInfo.getPaymentCurrency().equalsIgnoreCase(this.getIpnConfig().getPaymentCurrency()))
ipnInfo.setError("payment currency mc_currency " + ipnInfo.getPaymentCurrency()
+ " does not match with configured ipn currency " + this.getIpnConfig().getPaymentCurrency());
}
else
ipnInfo.setError("Inavlid response {" + res + "} expecting {VERIFIED}");
logger.info("ipnInfo = " + ipnInfo);
this.getIpnInfoService().log(ipnInfo);
//7. In case of any failed validation checks, throw {@link IpnException}
if(ipnInfo.getError() != null)
throw new IpnException(ipnInfo.getError());
}
catch(Exception e)
{
if(e instanceof IpnException)
throw (IpnException) e;
logger.log(Level.SEVERE, e.toString(), e);
throw new IpnException(e.toString());
}
//8. If all is well, return {@link IpnInfo} to the caller for further business logic execution
return ipnInfo;
}
/**
* Utility method to extract all request parameters and their values from request object
*
* @param request {@link HttpServletRequest}
* @return all request parameters in the form:
* param-name 1
* param-value
* param-name 2
* param-value
* param-value (in case of multiple values)
*/
private String getAllRequestParams(HttpServletRequest request)
{
Map map = request.getParameterMap();
StringBuilder sb = new StringBuilder("\nREQUEST PARAMETERS\n");
for (Iterator it = map.keySet().iterator(); it.hasNext();)
{
String pn = (String)it.next();
sb.append(pn).append("\n");
String[] pvs = (String[]) map.get(pn);
for (int i = 0; i < pvs.length; i++) {
String pv = pvs[i];
sb.append("\t").append(pv).append("\n");
}
}
return sb.toString();
}
public Logger getLogger() {
return logger;
}
public void setLogger(Logger logger) {
this.logger = logger;
}
public IpnConfig getIpnConfig() {
return ipnConfig;
}
public void setIpnConfig(IpnConfig ipnConfig) {
this.ipnConfig = ipnConfig;
}
public IpnInfoService getIpnInfoService() {
return ipnInfoService;
}
public void setIpnInfoService(IpnInfoService ipnInfoService) {
this.ipnInfoService = ipnInfoService;
}
}
*/log in paypal authentication code https://developer.paypal.com/webapps/developer/docs/integration/direct/identity/log-in-with-paypal/
*/this javaScript gets pasted into login start page for AlgoTradersEdge Cyanspring login credentials
*/<span id="lippButton"></span>
*/<script src="https://www.paypalobjects.com/js/external/api.js"></script>
*/<script>
*/paypal.use( ["login"], function(login) {
*/ login.render ({
*/ "appid": "d3428641e41208c246d07b2e5f3cc7a5",
*/ "scopes": "profile email address phone https://uri.paypal.com/services/paypalattributes",
*/ "containerid": "lippButton",
*/ "locale": "en-us",
*/ "returnurl": "http://my.domain.here/return.php"
*/ });
*/});
*/</script>
*/If you would like to modify the generated JavaScript button code, refer to the parameter table below.
*/JavaScript button parameters
*/appid Application ID (Client ID from creating your PayPal app).
*/Note: The terms application id and client id are used interchangeably.
*/authend (optional) Authorization Server URL: Pass sandbox for the test environment, otherwise, for live, leave blank or do not pass.
*/scopes Profile information requested (available scopes)
*/locale Language and country specifier
*/theme (optional) Button styling: PayPal blue or neutral
*/returnurl Page to return to after successful login
*/For additional integration steps, see the Log In with PayPal integration guide.
*/sample java chained adaptive payments ipn listener code
*/https://github.com/paypal/codesamples-java/blob/master/src/main/java/com/sample/adaptivepayments/Pay.java
199 lines (160 sloc) 7.26 KB
package com.sample.adaptivepayments;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Logger;
import com.paypal.svcs.services.AdaptivePaymentsService;
import com.paypal.svcs.types.ap.PayRequest;
import com.paypal.svcs.types.ap.PayResponse;
import com.paypal.svcs.types.ap.Receiver;
import com.paypal.svcs.types.ap.ReceiverList;
import com.paypal.svcs.types.common.RequestEnvelope;
// # Pay API
// Use the Pay API operation to transfer funds from a sender's PayPal account to one or more receivers' PayPal accounts. You can use the Pay API operation to make simple payments, chained payments, or parallel payments; these payments can be explicitly approved, preapproved, or implicitly approved.
// This sample code uses AdaptivePayments Java SDK to make API call. You can
// download the SDK [here](https://github.com/paypal/sdk-packages/tree/gh-pages/adaptivepayments-sdk/java)
public class Pay {
PayRequest payRequest;
PayResponse payResponse;
public PayResponse simplePay() {
// ##PayRequest
// The code for the language in which errors are returned, which must be
// en_US.
RequestEnvelope requestEnvelope = new RequestEnvelope();
requestEnvelope.setErrorLanguage("en_US");
List<Receiver> receiverLst = new ArrayList<Receiver>();
// Amount to be credited to the receiver's account
Receiver receiver = new Receiver(Double.parseDouble("4.00"));
// A receiver's email address
receiver.setEmail("abc@paypal.com");
receiverLst.add(receiver);
ReceiverList receiverList = new ReceiverList(receiverLst);
// PayRequest which takes mandatory params:
//
// * `Request Envelope` - Information common to each API operation, such
// as the language in which an error message is returned.
// * `Action Type` - The action for this request. Possible values are:
// * PAY - Use this option if you are not using the Pay request in
// combination with ExecutePayment.
// * CREATE - Use this option to set up the payment instructions with
// SetPaymentOptions and then execute the payment at a later time with
// the ExecutePayment.
// * PAY_PRIMARY - For chained payments only, specify this value to
// delay payments to the secondary receivers; only the payment to the primary
// receiver is processed.
// * `Cancel URL` - URL to redirect the sender's browser to after
// canceling the approval for a payment; it is always required but only
// used for payments that require approval (explicit payments)
// * `Currency Code` - The code for the currency in which the payment is
// made; you can specify only one currency, regardless of the number of
// receivers
// * `Recevier List` - List of receivers
// * `Return URL` - URL to redirect the sender's browser to after the
// sender has logged into PayPal and approved a payment; it is always
// required but only used if a payment requires explicit approval
payRequest = new PayRequest(requestEnvelope, "PAY",
"http://localhost/cancel", "USD", receiverList,
"http://localhost/return");
// The URL to which you want all IPN messages for this payment to be
// sent.
// This URL supersedes the IPN notification URL in your profile
payRequest.setIpnNotificationUrl("http://localhost/ipn");
payResponse = makeAPICall(payRequest);
return payResponse;
}
// ##ChainedPayment
// `Note:
// For chained Payment all the above mentioned request parameters in
// simplePay() are required, but in receiverList alone we have to make
// receiver as Primary Receiver or Not Primary Receiver`
public PayResponse chainPay() {
List<Receiver> receiverLst = new ArrayList<Receiver>();
// Amount to be credited to the receiver's account
Receiver receiver1 = new Receiver(Double.parseDouble("4.00"));
// A receiver's email address
receiver1.setEmail("enduser_biz@gmail.com");
// Set to true to indicate a chained payment; only one receiver can be a
// primary receiver. Omit this field, or set it to false for simple and
// parallel payments.
receiver1.setPrimary(Boolean.TRUE);
receiverLst.add(receiver1);
// Amount to be credited to the receiver's account
Receiver receiver2 = new Receiver(Double.parseDouble("2.00"));
// A receiver's email address
receiver2.setEmail("xyz@paypal.com");
// Set to true to indicate a chained payment; only one receiver can be a
// primary receiver. Omit this field, or set it to false for simple and
// parallel payments.
receiver2.setPrimary(Boolean.FALSE);
receiverLst.add(receiver2);
ReceiverList receiverList = new ReceiverList(receiverLst);
payRequest.setReceiverList(receiverList);
return payResponse = makeAPICall(payRequest);
}
// ##Parallel Payment
// `Note:
// For parallel Payment all the above mentioned request parameters in
// simplePay() are required, but in receiverList we can have multiple
// receivers`
public PayResponse parallelPay() {
List<Receiver> receiverLst = new ArrayList<Receiver>();
// Amount to be credited to the receiver's account
Receiver receiver1 = new Receiver(Double.parseDouble("4.00"));
// A receiver's email address
receiver1.setEmail("abc@paypal.com");
receiverLst.add(receiver1);
// Amount to be credited to the receiver's account
Receiver receiver2 = new Receiver(Double.parseDouble("2.00"));
// A receiver's email address
receiver2.setEmail("xyz@paypal.com");
receiverLst.add(receiver2);
ReceiverList receiverList = new ReceiverList(receiverLst);
payRequest.setReceiverList(receiverList);
return payResponse = makeAPICall(payRequest);
}
private PayResponse makeAPICall(PayRequest payRequest) {
Logger logger = Logger.getLogger(this.getClass().toString());
// ## Creating service wrapper object
// Creating service wrapper object to make API call and loading
// configuration file for your credentials and endpoint
AdaptivePaymentsService service = null;
try {
service = new AdaptivePaymentsService(
"src/main/resources/sdk_config.properties");
} catch (IOException e) {
logger.severe("Error Message : " + e.getMessage());
}
PayResponse payResponse = null;
try {
// ## Making API call
// Invoke the appropriate method corresponding to API in service
// wrapper object
payResponse = service.pay(payRequest);
} catch (Exception e) {
logger.severe("Error Message : " + e.getMessage());
}
// ## Accessing response parameters
// You can access the response parameters using getter methods in
// response object as shown below
// ### Success values
if (payResponse.getResponseEnvelope().getAck().getValue()
.equalsIgnoreCase("Success")) {
// The pay key, which is a token you use in other Adaptive
// Payment APIs (such as the Refund Method) to identify this
// payment. The pay key is valid for 3 hours; the payment must
// be approved while the pay key is valid.
logger.info("Pay Key : " + payResponse.getPayKey());
// Once you get success response, user has to redirect to PayPal
// for the payment. Construct redirectURL as follows,
// `redirectURL=https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_ap-payment&paykey="
// + payResponse.getPayKey();`
}
// ### Error Values
// Access error values from error list using getter methods
else {
logger.severe("API Error Message : "
+ payResponse.getError().get(0).getMessage());
}
return payResponse;
}
}
========================
sample chained adaptive payments java code for ipn listener
https://github.com/paypal/codesamples-java/blob/master/src/main/java/com/sample/adaptivepayments/Pay.java

No comments:
Post a Comment