Hi all,
as you probably know the PayPalPayment class might need a few little tweaks.
I find on line 170 $inputs['currency_code'] = $this->Currency; needs to be updated manually, there doesn't seem to be a config setting for this (maybe I'm mistaken) I'm cool with this for personal use but would be more user friendly for the community if there was a config function. I can't see a config function on PayPalPayment or Payment. Also it should probably default to something if it hasn't been set. When going through to pay pal with this unset, paypal responded with "you have incomplete data".
And its taken me a few days to get my head around how this is all working, now I understand it its a very nice integration of PayPal into SS. But I'm getting payment status updated to Failure upon return of a successful transaction in PayPal sandbox. The reason is on line 256
if(isset($_REQUEST['payment_status']) && $_REQUEST['payment_status'] == 'Completed') {
$payment->Status = 'Success';
$payment->TxnRef = $_REQUEST['txn_id'];
}
else {
$payment->Status = 'Failure';
}
This might just be a sandbox issue, but paypal is responding with
value="Pending" name="payment_status"
value="paymentreview" name="pending_reason"
Which I'm assuming is for unverified users? Any way would be great to expand upon this having a switch or something to update orders accordingly. And catch pending orders.
Oh and lastly, it appears alternative shipping address information isn't being posted to PayPal, not a biggie to fix. Out of interest here is the data getting posted to PayPal with "use different shipping address information" submitted
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" id="PaymentForm">
<input type="hidden" value="_cart" name="cmd">
<input type="hidden" value="1" name="upload">
<input type="hidden" value="Example product" name="item_name_1">
<input type="hidden" value="15.00" name="amount_1">
<input type="hidden" value="1" name="quantity_1">
<input type="hidden" value="mysandboxemail@paypal.com" name="business">
<input type="hidden" value="11-d6650e589e1885ca58893417366d59aa" name="custom">
<input type="hidden" value="" name="currency_code">
<input type="hidden" value="http://127.0.0.1/ss/testpaypal/paypal/complete?custom=11-d6650e589e1885ca58893417366d59aa" name="cancel_return">
<input type="hidden" value="http://127.0.0.1/ss/testpaypal/paypal/complete" name="return">
<input type="hidden" value="2" name="rm">
<input type="hidden" value="Default Admin" name="first_name">
<input type="hidden" value="Hope" name="last_name">
<input type="hidden" value="70" name="address1">
<input type="hidden" value="testing" name="address2">
<input type="hidden" value="Auckland" name="city">
<input type="hidden" value="US" name="country">
<input type="hidden" value="myemail@paypal.com" name="email">
<input type="submit" value="Submit">
</form>