I have Magento 1.6.0.0 and I use Paypal Express Checkout. The issue is that Invoice emails are not automatically sent. It says at the invoice details page:
the invoice email is not sent
Can someone tell me whats the issue here?
The Order confirmation emails are sent successfully and I think Paypal data is also getting captured via IPN (or by PDT) as I am getting "Payment Information" filled with data coming from paypal.
Let me know how to get this solved.
Thanks a lot.
Ok this is how I have solved it myself !!
[file \app\code\core\Mage\Sales\Model\Order\Payment.php]
public function registerCaptureNotification($amount)
{
.
.
.
// at the end right before return $this;
// Custom Code - Send email on Invoice #-
if (!$this->getIsTransactionPending()){
if(!$this->getIsFraudDetected()){
if($invoice)
{
#$invoice->sendEmail();
#$invoice->setEmailSent(true);
}
}
}
//#-
}
However, this will only work with Paypal IPN being called and confirmed...
Related
I have a question about the PHP-Paypal-API. When paying I set the following parameters to each item:
$itemDetails = new PaymentDetailsItemType();
$itemDetails->Name = $item['name'];
$itemDetails->Amount = $itemAmount;
$itemDetails->Quantity = $item['count'];
$itemDetails->ItemCategory = isset($item['pp_cat']) ? $item['pp_cat'] : 'Digital';
$itemDetails->Tax = new BasicAmountType($data['currencyCode'], $item['tax']);
$paymentDetails->PaymentDetailsItem[] = $itemDetails;
In the shopping cart in Paypal, the names of the items are assigned correctly. The Payment works as expected. (This is only a Screenshot from a Test-Product in Sandbox, but same Code.
But in the E-Mail, the seller gets as soon as the payment was successfully, the description is empty. I unfortunately only have the German Mail, but maybe it will help you anyway.
What Parameter should be set, so the Description in the E-Mail isn't empty?
I have also found a similar thread but there was no answer. No description or item name on PayPal Payment Received email
Kindly create an MTS ticket at our Technical Portal (https://www.paypal-techsupport.com/) and share the affected transaction ID further checking.
I am using the Paypal PHP REST API SDK, but I can reproduce the problem using curl too. I am able to get a token without a problem. This only occurs when I'm submitting a live payment. I can switch to sandbox and submit an identical payment successfully.
As you can see below this is a very basic payment. I don't see how there could possibly be a problem with the information being submitted.
I have no shortage of debug IDs since this happens every time, but here is the last one I got: 049eee254433f
{
"intent":"sale",
"payer":{
"payment_method":"credit_card",
"funding_instruments":[
{
"credit_card":{
"type":"visa",
"number":"(removed)",
"cvv2":"(removed)",
"expire_month":"1",
"expire_year":"2016",
"first_name":"(removed)",
"last_name":"(removed)"
}
}
]
},
"transactions":[
{
"amount":{
"total":"11.98",
"currency":"USD"
}
}
]
}
The issue, according to the debug ID, is that you are not sending the billing address along with the card information. The option to include/not include the billing address with your request is based upon your merchant account setup. In order to rectify the above error, please provide the billing address in your request.
https://developer.paypal.com/webapps/developer/docs/api/#creditcard-object
I have fully integrated my website with paypal using paypal RESTful's API PHP SDK. Now my problem is every once in a while on the payment process, once the user approves the payment and it comes back to my website for execution, the API execution request comes back with the following responses from paypal. The HTTP response code's in these scenarios are 400 and 500. Below I have listed the error name and error message which comes as a part of the JSON response I get form paypal on execute action (https://api.paypal.com/v1/payments/payment/PAY-xxxxxxxxxxxxxxxxxxxxxxxxxx/execute):
400 PAYMENT_NOT_APPROVED_FOR_EXECUTION,Payer has not approved payment
500 INTERNAL_SERVICE_ERROR,An internal service error has occurred
In terms of the code I use to make that call I have added the function which executes the payment. I should add that this is working in 98% of times. Below is the code:
public function getExecute()
{
// Payment is cancelled
if (!(Input::get('success') && Input::get('success') == 'true'))
return $this->runPaymentExitProcess();
// No paymentId
if (!Session::has('paymentId'))
return "No payment id to execute";
$paymentId = Session::get('paymentId');
$this->payment = Payment::get($paymentId, $this->apiContext);
// The payer_id is added to the request query parameters when the user is redirected from paypal back to your site
$this->execution->setPayer_id(Input::get('PayerID'));
$response = $this->payment->execute($this->execution, $this->apiContext);
// Check for paypal errors
if (isset($response->name)) {
// When we have a paypal error
if ($this->hasPaypalError($response)) {
$error = array('name' => $response->name, 'message' => $response->message);
Session::put('error', $error);
return (MODE == 'LIVE') ? Redirect::to('/paypalerror') : Redirect::to('/paypalerror'.MODE_PARAM);
die;
}
}
// Unset session
Session::forget('paymentId');
// execution successful
if ($this->addPaymentIdToUser($paymentId))
return (MODE == 'LIVE') ? Redirect::to('/') : Redirect::to('/'.MODE_PARAM);
}
The code is in laravel. Please note that the $this->apiContext is set in the constructor of the class. Also this is the function is the success url which is set in the API under redirect_urls.
Can someone please help me figure out if this issue is coming from my side or Paypal's side?
For the 400 error, this would occur if the user decided not to approve the payment. If you think the payment was actually approved in the web flow then that would be an issue to look into further.
Can you provide the debugId and approximate time (with timezone, or GMT) of a 500 internal server error response, and a 400 if you believe the payment was actually approved by user.
I'm trying to get PayPal's chained payments working in their sandbox env. but whenever I click on "Pay" at the very last stage after signing in I always get redirected to a page with the generic error message "Your payment can't be completed. Please return to the participating website and try again."
I've tried doing both chained and parallel payments with the same results.
I've also followed a few suggestions from around the web which inc tweaking the merchant account settings making sure certain fields were unchecked under the "blocked" options. As well checking currency and country code. Initially country code was en_GB and currency GBP, that didn't work I tried doing en_US with USD but in all cases I get the same message.
I've also tried adding an IPN url on the off chance PayPal would post some error code/message to it but got nadda! If you click "Return to test store" it goes to the cancel URL without any POST/GET parameters.
I'm using their PHP SDK from http://paypal.github.io/#adaptive-payments-tab-php-5-3
So the question, does anyone have any suggestion as to how I can find out what exactly is going wrong or other things I can try to fix it?
I had this problem in the sandbox environment because I was not including an application ID. I used APP-80W284485P519543T which one of examples indicated as the Sandbox Application ID, and then it worked.
Mobile Payments Library Developer Guide and Reference
–
Android OS
Edition
Oct 2016
5
Preface
**Important:
The Mobile Payments Library is based on the PayPal Adaptive Payments API.
As of October 6, 2016, Adaptive Payments is now a limited releas
e product. It is restricted to
select partners for approved use cases and should not be used for new integrations without guidance from PayPal**
=============================================
first implement method
private void initLibrary() {
PayPal pp = PayPal.getInstance();
if(pp == null) {
pp = PayPal.initWithAppID(this, PAYPAL_APP_ID, PayPal.ENV_SANDBOX);
pp.setLanguage("en_US"); // Sets the language for the library.
pp.setFeesPayer(PayPal.FEEPAYER_EACHRECEIVER);
// pp.setShippingEnabled(true);
pp.setDynamicAmountCalculationEnabled(false);
}
}
**paypal button click event code**
double secondary_payment = 0;
double primary_payment = 0;
PayPalAdvancedPayment advPayment = makeChainedPayment(secondary_payment,primary_payment,"primary_email","secondary_email");
Intent checkoutIntent = PayPal.getInstance().checkout(advPayment, your_current_activity);
startActivityForResult(checkoutIntent, 1);
=============================================
private PayPalAdvancedPayment makeChainedPayment(double priceSecondary, double pricePrimary, String primary_email, String secondary_email) {
PayPalAdvancedPayment payment = new PayPalAdvancedPayment();
payment.setCurrencyType("USD");
// payment.setMerchantName("PushND");
BigDecimal bigDecimalPrimary=new BigDecimal(pricePrimary);
PayPalReceiverDetails receiverPrimary = new PayPalReceiverDetails();
receiverPrimary.setRecipient(primary_email);
//receiverPrimary.setRecipient("adaptive_receiver_1#pushnd.com");
receiverPrimary.setSubtotal(bigDecimalPrimary);
receiverPrimary.setIsPrimary(true);
payment.getReceivers().add(receiverPrimary);
PayPalReceiverDetails receiverSecondary= new PayPalReceiverDetails();
receiverSecondary.setRecipient(secondary_email);
BigDecimal bigDecimalSecond=new BigDecimal(priceSecondary);
receiverSecondary.setSubtotal(bigDecimalSecond);
payment.getReceivers().add(receiverSecondary);
return payment;
}
I currently have a problem with my Paypal IPN listener and have been receiving the following email from paypal each day:
"Please check your server that handles PayPal Instant Payment Notifications (IPN). IPNs sent to the following URL(s) are failing:
http://www.mysales.ie/create_promo_listener.php"
I have a demo site which enables users to create ads and works perfectly (no problems with IPN), however the proper site that I am developing has this issue (It is on a different host).
I have contacted the host provider and they have said it is not an issue on their side. I have tried php error logs but cant find any issues. I have the exact same code on both sites so I cant understand what the problem is.
<?php include 'ipn_handler.class.php';
/**
* Logs IPN messages to a file.
*/
class Logging_Ipn_Handler extends IPN_Handler
{
public function process(array $post_data)
{
$data = parent::process($post_data);
if($data === FALSE)
{
header('HTTP/1.0 400 Bad Request', true, 400);
exit;
}
$random_number = $_POST['custom'];
file_put_contents( 'logs/listenerTest.txt', "listener = " . $random_number, FILE_APPEND);
header("location:create_promo_creator.php?random_number=" . $random_number);
}
}
date_default_timezone_set('Europe/Oslo');
$handler = new Logging_Ipn_Handler();
$handler->process($_POST);
I have been trying to find the root of the problem for a long time but cant figure it out.
Seems that your $data = parent::process($post_data);
method is returning FALSE.
Do you have any logging instrumentation in your code to verify this?
The easy workaround is to return a 200 response to keep PayPal's IPN system happy, and to log the error for further review.