PayPalCheckoutSdk - return fetch server response error 500
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The PayPalSdk works fine on SANDBOX but in Live I keep receiving error 500.
I followed the paypal guide really can not see where is my mistake. Please help..
public function paypal_capture()
{
$gateway_data = $this->billing->gateway(4);
$orderId = $this->input->post('orderID', true);
$itype = $this->input->post('itype', true);
$clientId =$gateway_data['key1']; //$paypal_conf['client_id'];
$clientSecret =$gateway_data['key2'];//$paypal_conf['secret'];
if($gateway_data['dev_mode'] == true)
{
$environment = new \PayPalCheckoutSdk\Core\SandboxEnvironment($clientId, $clientSecret);
} else {
$environment = new \PayPalCheckoutSdk\Core\ProductionEnvironment($clientId, $clientSecret);
}
$client = new \PayPalCheckoutSdk\Core\PayPalHttpClient($environment);
$request = new \PayPalCheckoutSdk\Orders\OrdersCaptureRequest($orderId);
$request->prefer('return=representation');
try {
$response = $client->execute($request);
echo json_encode($response);
$response = json_decode(json_encode($response), true);
if (isset($response['result']) and $response['result']['intent'] == 'CAPTURE' and $response['result']['status'] == 'COMPLETED') {
$note = 'INV '.$response['result']['purchase_units'][0]['reference_id'].' Paypal Payment #' . $response['result']['id'];
$this->billing->paynow($response['result']['purchase_units'][0]['reference_id'], $response['result']['purchase_units'][0]['amount']['value'], $note, 'Card',$itype);
}
}
catch (HttpException $ex) {
echo json_encode(array('status'=>'Error','message'=>'Code '.$ex->statusCode.' Contact to seller.'));
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Similar issue: this topic says https://stackoverflow.com/questions/40641560/basic-paypal-checkout-button-giving-a-500-internal-serv... the issue is from paypal server. I been trying to reach paypal support but no luck even the live support no Customer Support Agents are available. How so i contact paypal tech support?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am successfully authorizing credit card payments using the SDK but an error message when deserializing JSON.
throw new Error("Promise serialization is not implemented; nothing to deserialize")
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- When I do PayPal capture Order, I keep on getting Invalid Request Connection in REST APIs
- When clicking on a payment button generates error: Unexpected token ... in PayPal Payments Standard
- Error: "Unable to change shipping method. Please try again." in PayPal popup in REST APIs
- Ipn PayPal server giving 301 or 302 errors in PayPal Payments Standard
- Internal Server Error 500 in SDKs