Note that there are some explanatory texts on larger screens.

plurals
  1. POPaypal says my CancelURL is invalid?
    text
    copied!<p>I'm creating a site and am just adding in payments.<br> I'm using the <a href="https://github.com/paypalx/SDKs/tree/master/Merchant/merchant-php-sdk" rel="nofollow">Paypal SDK</a> and have setup my <code>SetExpressCheckout()</code>.</p> <p>Here is the response,</p> <pre><code>object(SetExpressCheckoutResponseType)[72] public 'Token' =&gt; null public 'Timestamp' =&gt; string '2012-08-23T15:21:15Z' (length=20) public 'Ack' =&gt; string 'Failure' (length=7) public 'CorrelationID' =&gt; string 'e0278e8e18b4f' (length=13) public 'Errors' =&gt; object(ErrorType)[78] public 'ShortMessage' =&gt; string 'Transaction refused because of an invalid argument. See additional error messages for details.' (length=94) public 'LongMessage' =&gt; string 'CancelURL is invalid.' (length=21) public 'ErrorCode' =&gt; string '10472' (length=5) public 'SeverityCode' =&gt; string 'Error' (length=5) public 'ErrorParameters' =&gt; null public 'Version' =&gt; string '93.0' (length=4) public 'Build' =&gt; string '3556406' (length=7) </code></pre> <p>I'm not sure what's up. My <code>CancelURL</code> looks like, <code>urlencode('https://www.example.com/users/account/');</code>. I've included the trailing slash, which some people think can cause it to be invalid. </p> <p>The only thing that I can think of is that because my site isn't online anywhere, that Paypal can't reach the page. I have created a dummy page and uploaded it into <code>/users/account/</code> on the server so it's reachable and still nothing. I also have an entry in my <code>etc/hosts</code> to route <code>example.com</code> traffic to my localhost which worked fine for my Facebook Auth bits.</p> <p>Anyone have any ideas on what the restrictions are for a CancelURL and why Paypal is kicking my request?</p> <hr> <p><strong>Request generation</strong> </p> <pre><code>$int = new PayPalAPIInterfaceServiceService(); $amount = new BasicAmountType(); $amount-&gt;currencyID = CakeSession::read('Locale.currency'); $amount-&gt;value = Configure::read('Subscription.price.'.CakeSession::read('Locale.shortname')); $req_details_type = new SetExpressCheckoutRequestDetailsType(); $req_details_type-&gt;OrderTotal = $amount; $req_details_type-&gt;ReturnURL = urlencode('https://www.example.com/paypal/getExpressCheckoutDetails'); $req_details_type-&gt;CancelURL = urlencode('https://www.example.com/users/account/'); $req_details_type-&gt;MaxAmount = $amount; $req_details_type-&gt;OrderDescription = "Monthly subscription to Example.com Pro"; $req_details_type-&gt;ReqConfirmShipping = 0; $req_details_type-&gt;NoShipping = 1; $req_details_type-&gt;LocaleCode = CakeSession::read('Locale.shortname') == 'usa'? 'US' : 'GB'; $req_details_type-&gt;PaymentAction = 'Authorization'; $req_details_type-&gt;BuyerEmail = AuthComponent::user('email'); $req_details_type-&gt;BrandName = urlencode("Example.com"); $req_type = new SetExpressCheckoutRequestType(); $req_type-&gt;SetExpressCheckoutRequestDetails = $req_details_type; $req = new SetExpressCheckoutReq(); $req-&gt;SetExpressCheckoutRequest = $req_type; $response = $int-&gt;SetExpressCheckout($req); var_dump($response); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload