Error testing sandbox - "Things don’t appear to be working at the moment."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I'm trying to test a couple of buy now buttons that I've configured using a php snippet, as pasted below.
This works when I use the shortcode for a subscription: [buy name="Monthly partnership" amount="450" months="2" currency="USD" paypal_title="Monthly retainer" ]
But I get the error when I use the single product shortcode: [buy name="3 months package" amount="1250" paypal_title="3 month confidence coaching package" ]
Any thoughts?
Steve
function cc_buy($atts){
extract( shortcode_atts( array(
'name' => '',
'price' => '',
'amount' => '',
'months' => '1',
'paypal_title' => 'Confidence coaching with Steve Errey',
'currency' => 'USD',
'button' => 'Buy now'
), $atts ) );
$output .= "<div class='buycoaching'>";
$output .= '<form name="_xclick" action="https://sandbox.paypal.com/cgi-bin/webscr" method="post">';
if ($months == 1){
$output .= '<input type="hidden" name="cmd" value="_xclick">';
$output .= '<input type="hidden" name="amount" value="'.$amount.'">';
} else {
// It's a monthly subscription, not a one-off payment
$output .= '<input type="hidden" name="cmd" value="_xclick-subscriptions">';
$output .= '<input type="hidden" name="a3" value="'.$amount.'">';
$output .= '<input type="hidden" name="p3" value="1">';
$output .= '<input type="hidden" name="t3" value="M">';
$output .= '<input type="hidden" name="src" value="1">';
}
$output .= '<input type="hidden" name="business" value="[sandbox merchant account]">';
$output .= '<input type="hidden" name="currency_code" value="'.$currency.'">';
$output .= '<input type="hidden" name="item_name" value="'.$paypal_title.'">';
$output .= '<input type="submit" border="0" name="submit" value="'.$button.'" alt="Buy now" class="button">';
$output .= '</form>';
$output .= '</div>';
return $output;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- IPN works in sandbox but not live in Sandbox Environment
- link my PayPal business account with my WordPress website , but it's not work ?! in PayPal Payments Standard
- Problems with accent characters when calling Paypal API (v2/invoicing/invoices). in REST APIs
- System error for my Paypal button after years of correct working in PayPal Payments Standard
- User is asked for shipping address when creating a credit card order in REST APIs