Phiên bản API Đồ thị

/{payment-id}/refunds

Dùng để cấp bất kỳ khoản tiền hoàn lại nào.

Đọc

Bạn không thể đọc cạnh này.

Đăng

Bạn có thể dùng cạnh này để khởi tạo khoản tiền hoàn lại:

POST /v19.0/{payment-id}/refunds HTTP/1.1
Host: graph.facebook.com

currency=EUR&amount=1.00
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->post(
    '/{payment-id}/refunds',
    array (
      'currency' => 'EUR',
      'amount' => '1.00',
    ),
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
Bundle params = new Bundle();
params.putString("currency", "EUR");
params.putString("amount", "1.00");
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{payment-id}/refunds",
    params,
    HttpMethod.POST,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
NSDictionary *params = @{
  @"currency": @"EUR",
  @"amount": @"1.00",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{payment-id}/refunds"
                                      parameters:params
                                      HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];

Quyền

  • Bạn cần có mã truy cập ứng dụng để cấp bất kỳ khoản tiền hoàn lại nào cho ứng dụng đó.

Trường

Tên Mô tả Loại

currency

Mã đơn vị tiền tệ gồm 3 chữ cái theo tiêu chuẩn ISO của số tiền hoàn lại. Mã này phải giống với đơn vị tiền tệ của giao dịch mua ban đầu. Đây là trường bắt buộc.

string

amount

Số tiền hoàn lại. Đây là trường bắt buộc. Trường này phải có giá trị nhỏ hơn hoặc bằng trường refundable_amount trên đối tượng cha Thanh toán.

string

reason

Lý do bạn hoàn tiền cho đơn đặt hàng này.

enum{MALICIOUS_FRAUD, FRIENDLY_FRAUD, CUSTOMER_SERVICE}

Phản hồi

Nếu thành công:

{
  "success": true
}

Nếu không, hệ thống sẽ trả về một thông báo lỗi phù hợp.

Xóa

Bạn không thể xóa bằng cạnh này.