SANDBOX - COMO OBTENER VALOR DE VARIABLE CUSTOM ENVIADA
Undertaker11
Colaborador
Opciones
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse al feed de RSS
- Resaltar
- Imprimir
- Denunciar contenido inapropiado
Publicado el
sep-30-2019
01:22 PM
Comentar que logre obtener el detalle de la transacción usando 2 métodos para SANDBOX, pero en ninguno de los casos he logrado obtener el valor enviado inicialmente en el parámetro CUSTOM, en este caso coloque como prueba el valor CUSTOM = JPSH
Favor indicar como obtener este parámetro CUSTOM.
muchas gracias de antemano por la colaboración
1er. método
$url = "https://api.sandbox.paypal.com/v2/payments/captures/".$_GET["paymentID"];
$accessToken=$access_token;
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_POST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $accessToken,
'Accept: application/json',
'Content-Type: application/json'
));
$response = curl_exec($curl);
print_r($response);
$accessToken=$access_token;
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_POST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $accessToken,
'Accept: application/json',
'Content-Type: application/json'
));
$response = curl_exec($curl);
print_r($response);
RESULTADO OBTENIDO
{"id":"3XM094743W299702Y","amount":{"currency_code":"USD","value":"2.00"},"final_capture":true,"seller_protection":{"status":"ELIGIBLE","dispute_categories":["ITEM_NOT_RECEIVED","UNAUTHORIZED_TRANSACTION"]},"seller_receivable_breakdown":{"gross_amount":{"currency_code":"USD","value":"2.00"},"paypal_fee":{"currency_code":"USD","value":"0.36"},"net_amount":{"currency_code":"USD","value":"1.64"}},"status":"COMPLETED","create_time":"2019-09-27T03:19:44Z","update_time":"2019-09-27T03:19:44Z","links":[{"href":"https://api.sandbox.paypal.com/v2/payments/captures/3XM094743W299702Y","rel":"self","method":"GET"},{"href":"https://api.sandbox.paypal.com/v2/payments/captures/3XM094743W299702Y/refund","rel":"refund","method":"POST"},{"href":"https://api.sandbox.paypal.com/v2/checkout/orders/2JC78967VU682931A","rel":"up","method":"GET"}]}
2do. método:
$accessToken=$access_token;
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_POST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $accessToken,
'Accept: application/json',
'Content-Type: application/json'
));
$response = curl_exec($curl);
print_r($response);
RESULTADO OBTENIDO
{"id":"2JC78967VU682931A","intent":"CAPTURE","purchase_units":[{"reference_id":"default","amount":{"currency_code":"USD","value":"2.00"},"payee":{"email_address":"XXXXX","merchant_id":"ELSVRNRBPMXB6"},"description":"Compra de boletos mediante XXXXXX","shipping":{"name":{"full_name":"test buyer"},"address":{"address_line_1":"1 Main St","admin_area_2":"San Jose","admin_area_1":"CA","postal_code":"95131","country_code":"US"}},"payments":{"captures":[{"id":"3XM094743W299702Y","status":"COMPLETED","amount":{"currency_code":"USD","value":"2.00"},"final_capture":true,"seller_protection":{"status":"ELIGIBLE","dispute_categories":["ITEM_NOT_RECEIVED","UNAUTHORIZED_TRANSACTION"]},"seller_receivable_breakdown":{"gross_amount":{"currency_code":"USD","value":"2.00"},"paypal_fee":{"currency_code":"USD","value":"0.36"},"net_amount":{"currency_code":"USD","value":"1.64"}},"links":[{"href":"https://api.sandbox.paypal.com/v2/payments/captures/3XM094743W299702Y","rel":"self","method":"GET"},{"href":"https://api.sandbox.paypal.com/v2/payments/captures/3XM094743W299702Y/refund","rel":"refund","method":"POST"},{"href":"https://api.sandbox.paypal.com/v2/checkout/orders/2JC78967VU682931A","rel":"up","method":"GET"}],"create_time":"2019-09-27T03:19:44Z","update_time":"2019-09-27T03:19:44Z"}]}}],"payer":{"name":{"given_name":"test","surname":"buyer"},"email_address":"XXXXX","payer_id":"NDQJCY85WNXBL","address":{"country_code":"US"}},"create_time":"2019-09-27T03:19:26Z","update_time":"2019-09-27T03:19:44Z","links":[{"href":"https://api.sandbox.paypal.com/v2/checkout/orders/2JC78967VU682931A","rel":"self","method":"GET"}],"status":"COMPLETED"}
0 RESPUESTAS 0
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.