2014-04-01 2 views
1

페이팔과 통합되었습니다. 자바 용 REST API를 사용하고 있습니다. 현재 보류중인 결제에 문제가 있습니다. 지불 상태를 확인하기 위해 샌드 박스 환경으로 지불 (https://api.paypal.com/v1/payments/payment/ {paymentId})을 조회하면 응답이 다릅니다. { "id": "PAY-5YK922393D847794YKER7MUI", "create_time": "2013-02-19T22:01:53Z", "update_time": "2013-02-19T22:01:55Z", "state": "approved", "intent": "sale", "payer": { "payment_method": "credit_card", "funding_instruments": [ { "credit_card": { "type": "mastercard", "number": "xxxxxxxxxxxx5559", "expire_month": "2", "expire_year": "2018", "first_name": "Betsy", "last_name": "Buyer" } } ] }, "transactions": [ { "amount": { "total": "7.47", "currency": "USD", "details": { "subtotal": "7.47" } }, "description": "This is the payment transaction description.", "related_resources": [ { "sale": { "id": "36C38912MN9658832", "create_time": "2013-02-19T22:01:53Z", "update_time": "2013-02-19T22:01:55Z", "state": "completed", "amount": { "total": "7.47", "currency": "USD" }, "parent_payment": "PAY-5YK922393D847794YKER7MUI", "links": [ { "href": "https://api.sandbox.paypal.com/v1/payments/sale/36C38912MN9658832", "rel": "self", "method": "GET" }, { "href": "https://api.sandbox.paypal.com/v1/payments/sale/36C38912MN9658832/refund", "rel": "refund", "method": "POST" }, { "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-5YK922393D847794YKER7MUI", "rel": "parent_payment", "method": "GET" } ] } } ] } ], "links": [ { "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-5YK922393D847794YKER7MUI", "rel": "self", "method": "GET" } ] }
: 내가 지불페이팔 REST API 승인

및 판매를 승인 한 상태

에 판매자로 지불을 승인하면 상태에

예 응답을 완료 D 때때로 지불

완료

에서 판매 상태 보류

입니다 respose가 예 : 내가 거래를 거부 할 때 { "id": "PAY-5YK922393D847794YKER7MUI", "create_time": "2013-02-19T22:01:53Z", "update_time": "2013-02-19T22:01:55Z", "state": "pending", "intent": "sale", "payer": { "payment_method": "credit_card", "funding_instruments": [ { "credit_card": { "type": "mastercard", "number": "xxxxxxxxxxxx5559", "expire_month": "2", "expire_year": "2018", "first_name": "Betsy", "last_name": "Buyer" } } ] }, "transactions": [ { "amount": { "total": "7.47", "currency": "USD", "details": { "subtotal": "7.47" } }, "description": "This is the payment transaction description.", "related_resources": [ { "sale": { "id": "36C38912MN9658832", "create_time": "2013-02-19T22:01:53Z", "update_time": "2013-02-19T22:01:55Z", "state": "completed", "amount": { "total": "7.47", "currency": "USD" }, "parent_payment": "PAY-5YK922393D847794YKER7MUI", "links": [ { "href": "https://api.sandbox.paypal.com/v1/payments/sale/36C38912MN9658832", "rel": "self", "method": "GET" }, { "href": "https://api.sandbox.paypal.com/v1/payments/sale/36C38912MN9658832/refund", "rel": "refund", "method": "POST" }, { "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-5YK922393D847794YKER7MUI", "rel": "parent_payment", "method": "GET" } ] } } ] } ], "links": [ { "href": "https://api.sandbox.paypal.com/v1/payments/payment/PAY-5YK922393D847794YKER7MUI", "rel": "self", "method": "GET" } ] }

마찬가지로, Sanbox 작동 . 지불 상태가 실패하고 판매 상태가 취소되고 다른 시간이 보류 및 예약되면.

제 질문은 거래가 완료되었거나 실패했는지 100 % 확신 할 수 있습니까? 지불 상태 또는 판매 상태를 확인해야합니까? 이 문제는 프로덕션 환경이 아닌 샌드 박스와 만 관련된 것일 수 있습니다.

추신. 이 코드는 샘플 일 뿐이며 분석하지 마십시오.

답변

0

판매 상태가 완료된 경우에도 지불이 승인되었는지 확인해야합니다. 판매 상태가 완료된 후에도 특정 구매자의 계정과 관련된 무언가가 지불 상태를 보류 상태로 유지할 수 있습니다. 제품을 운송하기 전에 지불이 승인되었는지 확인해야합니다.