Skip to main content

PayPal Community

  • Dashboard
  • Send and Request
  • Wallet
  • Business
  • Help
Log in

Le Forum de la communauté n’est pas disponible pour les nouveaux messages ou les réponses; les articles précédents restent disponibles pour vérification. Afin de connaître les options d’assistance complètes, rendez-vous sur PayPal.com/HelpCenter

Si vous souhaitez signaler du contenu illégal et contraire au Règlement sur les services numériques de l’Union Européenne (DSA), veuillez cliquer ici.

since ‎Jun-28-2019
Country: India
Type: Business
deepakk1
deepakk1 Contributor
Contributor
3
Posts
0
Kudos
0
Solutions
Your PayPal Anniversary
The Return
Active
View all
Latest Contributions by deepakk1
  • Topics deepakk1 has Participated In
  • Latest Contributions by deepakk1

Return URL not set in payment success

by deepakk1 Contributor in SDKs
‎Jul-07-2019 09:34 PM
‎Jul-07-2019 09:34 PM
hello, i am not able to open after susses payment to new URL. actually i am passing return URL as Executed payment. and i am  set the return url at the time of execution of the payment. to opening new page on same page but it will not set and open it . please help     import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.paypal.api.payments.Links; import com.paypal.api.payments.Payment; import com.paypal.api.payments.RelatedResources; import com.paypal.api.payments.Sale; import com.paypal.api.payments.Transaction; import com.paypal.base.rest.PayPalRESTException; import com.paypal.orders.OrdersGetRequest; import com.virgo.supportadmin.config.PaypalIntentMethod; import com.virgo.supportadmin.config.PaypalPaymentIntent; import com.virgo.supportadmin.service.PaypalServiceIF; import com.virogo.supportadmin.util.URLUtils; @CrossOrigin(origins = "*") @RestController public class PaypalController { @Autowired PaypalServiceIF paymentServiceIF; private final Logger log = LoggerFactory.getLogger(this.getClass().getSimpleName()); public static final String PAYPAL_SUCCESS_URL = "pay/success"; public static final String PAYPAL_CANCEL_URL = "pay/cancel"; @RequestMapping(method = RequestMethod.POST, value = "pay") public Map<String, Object> pay(@RequestBody Map<String,Object> paymentOrderFrom,HttpServletRequest request) { log.info("Pay Create Approval Link"); String cancelUrl = URLUtils.getBaseURl(request) + "/" + PAYPAL_CANCEL_URL; String successUrl = URLUtils.getBaseURl(request) + "/" + PAYPAL_SUCCESS_URL; String value=paymentOrderFrom.get("value").toString(); String currency_code=paymentOrderFrom.get("currency_code").toString(); String description=paymentOrderFrom.get("description").toString(); Map<String, Object> linkMap= new HashMap<>(); try { Payment payment = paymentServiceIF.createPayment( value, currency_code, PaypalIntentMethod.paypal, PaypalPaymentIntent.sale, description, cancelUrl, successUrl); //System.out.println(payment); for(Links links : payment.getLinks()){ if(links.getRel().equals("approval_url")){ //return "redirect:" + links.getHref(); linkMap.put("Link", links.getHref()); } } } catch (PayPalRESTException e) { log.error(e.getMessage()); } return linkMap; } @RequestMapping(method = RequestMethod.GET, value = PAYPAL_CANCEL_URL) public String cancelPay(){ String html=" Payment Cancel "; return html; }   @RequestMapping(method = RequestMethod.GET, value = PAYPAL_SUCCESS_URL) public String successPay(@RequestParam("paymentId") String paymentId, @RequestParam("PayerID") String payerId) throws PayPalRESTException{ log.info("Payment Execute and get responce"); Map<String, Object> excutePayment= new HashMap<>(); String returnUrl="wwww.google.com"; Payment payment = paymentServiceIF.executePayment(paymentId, payerId,returnUrl); //System.out.println(payment); if(payment.getState().equals("approved")){ //return "success"; String transationId = null; String amount=null; for(Transaction transaction : payment.getTransactions()){ List<RelatedResources> transactionrelatedResource = transaction.getRelatedResources(); for (RelatedResources relatedResources : transactionrelatedResource) { Sale transationsaleid=relatedResources.getSale(); transationId=transationsaleid.getId(); amount=transationsaleid.getAmount().toString(); System.out.println(transationId); } } String excetuePayment=payment.toString(); excutePayment=getJsonStringToMap(excetuePayment); List transactionList= new ArrayList<>(); transactionList.add(payment.getTransactions()); //System.out.println(payment.getTransactions()); String html=" Your payment has been successfully completedTransaction Id "+transationId+" "; return html; } return "redirect :"; //return excutePayment; } //Convert to String to Map public static Map<String, Object> getJsonStringToMap(String stringJson) { Map<String, Object> map = new HashMap<String, Object>(); try { ObjectMapper mapper = new ObjectMapper(); map = mapper.readValue(stringJson, new TypeReference<Map<String, Object>>() { }); } catch (Exception e) { e.printStackTrace(); } return map; } }     ... View more
Labels:
  • Labels:
  • Mobile SDKs
  • PayPal Here SDK

Pay-Pal support Indian currency for sandbox

by deepakk1 Contributor in Sandbox Environment
‎Jul-01-2019 11:52 PM
‎Jul-01-2019 11:52 PM
i have an issue for Indian currency not supported while i am integrated pay-pal sandbox account please help  ... View more

Integration Of pay-pal Rest Api

by deepakk1 Contributor in REST APIs
‎Jul-01-2019 09:52 PM
‎Jul-01-2019 09:52 PM
I am not able to get approve the order from customer when the create the order and get link for approval but this link will be open but but i am not able to get on the payment will          continue only status will change and redirect same page i am not understand how to pass the capture Api not onapprove the function . ... View more
Labels:
  • Labels:
  • Payments REST APIs
Paypal Logo
  • Help
  • Contact Us
  • Security
  • Fees
  • © 1999-2025 PayPal, Inc. All rights reserved.
  • Privacy
  • Legal
  • Cookies
  • Policy Updates

The money in your balance is eligible for pass-through FDIC insurance.

The PayPal Cash Mastercard is issued by The Bancorp Bank pursuant to a license by Mastercard International Incorporated. The Bancorp Bank; Member FDIC.

Powered by Khoros