เวอร์ชันของ API กราฟ

/{payment-id}/refunds

ใช้เพื่อคืนการชำระเงิน

การอ่าน

คุณไม่สามารถอ่านจุดเชื่อมโยงนี้ได้

การเผยแพร่

คุณสามารถใช้จุดเชื่อมโยงนี้เพื่อเริ่มต้นการคืนเงิน:

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
}];

สิทธิ์การอนุญาต

  • ต้องใช้โทเค็นการเข้าถึงแอพเพื่อคืนการชำระเงินสำหรับแอพดังกล่าว

ช่อง

ชื่อ คำอธิบาย ประเภท

currency

รหัสสกุลเงิน ISO จำนวน 3 ตัวอักษรของสกุลเงินที่ระบุจำนวนเงินคืน โดยจะต้องเป็นสกุลเงินเดียวกันกับสกุลเงินที่ใช้ในการซื้อนั้นๆ ซึ่งเรากำหนดให้ต้องระบุ

string

amount

จำนวนเงินที่จะคืน ซึ่งเรากำหนดให้ต้องระบุ โดยจะต้องมีจำนวนน้อยกว่าหรือเท่ากับช่อง refundable_amount บนอ็อบเจ็กต์การชำระเงินหลัก

string

reason

เหตุผลที่คุณจะคืนเงินสำหรับคำสั่งซื้อนี้

enum{MALICIOUS_FRAUD, FRIENDLY_FRAUD, CUSTOMER_SERVICE}

การตอบกลับ

หากสำเร็จ การแสดงผลจะเป็นดังนี้

{
  "success": true
}

หากไม่จำเร็จ ระบบจะส่งคืนข้อความแสดงข้อผิดพลาดที่เกี่ยวข้อง

การลบ

คุณไม่สามารถลบโดยใช้จุดเชื่อมโยงนี้ได้