Queries in paypal sandbox - Integration

shanthini
Contributor
Contributor

We are using pay sandbox > paypal IPN.

In this after completing a payment transaction it returns to 'Success' page but the payment_status captured is pending. 

How can we post the transaction after transaction. Currently the transaction details are passed in query string

 

Login to Me Too
1 ACCEPTED SOLUTION

Accepted Solutions
Solved

MTS_Justin
Moderator
Moderator

Hello,

You're getting two environments confused, the sandbox testing environment and the production environment.

Any URL which contains "sandbox.paypal.com", is a sandbox environment URL. You can't login to sandbox account and attempt to use "https://www.paypal.com/cgi-bin/webscr" as this is a production URL. Modify the URL and add "sandbox" after the "www.", so it should be "https://www.sandbox.paypal.com/cgi-bin/webscr".

Follow the instructions in the article, but take the necessary steps within the sandbox account for which you wish to change the Auto Return / PDT settings.

For your convenience, I've included the URL below.

https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_profile-website-payments

You also cannot use a developer account email address to send a payment to / from within the sandbox environment. Your essentially trying to send a test payment to a production account, hence the "pending" transaction status.

Sandbox Overview : https://developer.paypal.com/docs/classic/lifecycle/sb_overview/


Was my post helpful? If so, please give me a kudos!

View solution in original post

Login to Me Too
12 REPLIES 12

MTS_Justin
Moderator
Moderator
Hi,

If the payment status is showing "pending", there must be a reason for the pending payment. Review the details of the transaction to determine the pending reason. (note : the receiving account may need to manually accept the payment if they do not have an open balance in the currency of the transaction)

Was my post helpful? If so, please give me a kudos!
Login to Me Too

shanthini
Contributor
Contributor

Thanks for your reply

 

I tried by using the buyer and facilitator accounts (inside developer account) created by paypal sandbox as below. Then the status was returned as 'Completed'. 

  • Used facilitator account for  <input type="hidden" name="business" value="facilitator account email"> 
  • Buyer account for doing the payment

But the issue is after payment this doesn't returned to the site automatically after payment and it displays a button 'Return to Merchant site'. Then if we return to the site manually no parameters were returned in query string. 

 

Login to Me Too

MTS_Justin
Moderator
Moderator
1. For the return to be automatic, you need to enable Auto Return on the facilitator account and the payment needs to be a PayPal account funded payment - https://www.paypal.com/us/selfhelp/article/how-do-i-use-paypal's-auto-return-feature-to-redirect-cus...

2. For the parameters to be returned, you need to enable payment data transfter (PDT) - https://developer.paypal.com/docs/classic/products/payment-data-transfer/

Was my post helpful? If so, please give me a kudos!
Login to Me Too

shanthini
Contributor
Contributor

I created a developer a/c

 

Then inside that I created sandbox accounts. (https://developer.paypal.com/developer/accounts/)

  • If login using developer a/c I can able to set the auto return and PDT (https://www.paypal.com/cgi-bin/webscr?cmd=_profile-display-
    handler&tab_id=SELLER_PREFERENCES). In this I have set the auto return and PDT
  • If I login using the created sandbox business account (other than the developer a/c) I couldn't access the page https://www.paypal.com/cgi-bin/webscr?cmd=_profile-display-
    handler&tab_id=SELLER_PREFERENCES
  • If I use the email id of my developer a/c for business - transaction details updation and auto return are working fine. The only issue is payment status shows as 'Pending'
  • If I use the email id of my created sanbox business a/c for business - transaction details updation and payment status working fine. The issues are auto return is not working and no values are returned using query string to the success page

Is there a way to post login details, passwords, we site url in a secure way so that I will share the details.

 

Thanks

 

Login to Me Too
Solved

MTS_Justin
Moderator
Moderator

Hello,

You're getting two environments confused, the sandbox testing environment and the production environment.

Any URL which contains "sandbox.paypal.com", is a sandbox environment URL. You can't login to sandbox account and attempt to use "https://www.paypal.com/cgi-bin/webscr" as this is a production URL. Modify the URL and add "sandbox" after the "www.", so it should be "https://www.sandbox.paypal.com/cgi-bin/webscr".

Follow the instructions in the article, but take the necessary steps within the sandbox account for which you wish to change the Auto Return / PDT settings.

For your convenience, I've included the URL below.

https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_profile-website-payments

You also cannot use a developer account email address to send a payment to / from within the sandbox environment. Your essentially trying to send a test payment to a production account, hence the "pending" transaction status.

Sandbox Overview : https://developer.paypal.com/docs/classic/lifecycle/sb_overview/


Was my post helpful? If so, please give me a kudos!
Login to Me Too

shanthini
Contributor
Contributor

Hi

Thanks for your help. Now paypal - IPN this is working fine. I have listed below the steps I followed. 

 

 

  • Inside my paypal developer account I created a sandbox business account and a sandbox buyer account
  • Then I included the sandbox business account's email in the 'business hidden field' of the form. Also configured success, notify and cancel urls.
  • Then logged into sandbox.paypal.com using the created sandbox business account.
    • In this I set the auto return - on, Return url, PDT and PayPal Account Optional on  using Profile and Settings -> My Selling Tools -> Web site preferences.
    • Then using Profile and Settings -> My Selling Tools -> Instant payment notification set the notify url and enabled message deliver

Now able to get the payment status as 'Success' on successful payment and able to get the correct transaction id in the success page

 

 

The only issue is to buyer email id i couldn't receive mails. But if I login as a buyer and checked the details are available. Could you please suggest whether a buyer will get an email of the transaction details in sandbox environment

Login to Me Too

MTS_Justin
Moderator
Moderator
Hello,

Thanks for the detailed update, great to hear you have your payments working now.

All mails for sandbox accounts are sent to the "notifications" section within your PayPal Developer account. No sandbox account email is ever sent to an external email address.

https://developer.paypal.com/developer/notifications/

Was my post helpful? If so, please give me a kudos!
Login to Me Too

shanthini
Contributor
Contributor

Hi

 

I have one more query. Could you please suggest on this

 

If I click 'Pay Now' button from website this goes to a page with provisions to 'Pay with PayPal' and 'Pay with Debit or Credit Card' as in below screen shot. Then after clicking the 'Pay with Debit or Credit Card' only this is directing to a page with provision to do payment.


ref1.png

 

 

 

 

 

 

 

 

 

 

 

 

Instead of this I would lime to direct to a page like below. How can I do this

 

ref2.png

 

Login to Me Too

shanthini
Contributor
Contributor

Along with the above query I have two more, could you please suggest. Thanks

 

  • How to set the default country to be displayed in checkout. I have set the below, but it displays the country of the previous transaction only and it is not displaying always US

   <input type="hidden" name="country" value="US">

 

  • Also to apply 6% of sales tax I set as below. This is working and the label for the tax amount is shown as ‘VAT’. Do we have the provision to change this label from ‘VAT’ to ‘Sales tax’. If yes please suggest how

   <input type="hidden" name="tax_cart" value="0.06">

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.