亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Paypal Checkout - 付款始終處于待處理狀態

Paypal Checkout - 付款始終處于待處理狀態

PHP
慕慕森 2023-10-15 14:56:48
三天以來,我試圖讓 Paypal Checkout 正常工作,但我總是遇到這樣的問題:訂單已創建,資金從購買帳戶中消失,但未到達收款人帳戶。這是我的設置:JavaScript 中的智能按鈕整合:paypal.Buttons({    env: enviroment,    // Set up the transaction  createOrder: function() {    let formData = new FormData();    formData.append('bookingId', bookingId);    return fetch (url_createOrder, {      method: 'POST',      body: formData    }).then(response => {      console.log(response);      return response.json()    })    .then(function(res) {      console.log(res);      return res.result.id;    });  },  // Finalize the transaction  onApprove: function(data, actions) {    console.log(data);        // This function captures the funds from the transaction.    return actions.order.capture().then(function(details) {      console.log(details);      // This function shows a transaction success message to your buyer      // window.location.href = 'danke.php';    });  }}).render('#paypal-button-container');正如您所看到的,createOrder 啟動了對此腳本的 AJAX 調用:[...]$client = new PayPalHttpClient($environment);$request = new OrdersCreateRequest();$request->prefer('return=representation');$request->body = self::buildRequestBody($price);// 3. Call PayPal to set up a transaction$response = $client->execute($request);echo json_encode($response, JSON_PRETTY_PRINT);// 4. Return a successful response to the client.return $response;}private static function buildRequestBody($price) { return array(   'intent' => 'CAPTURE',   'application_context' => array(      'brand_name' => 'Example',        'cancel_url' => 'http://localhost/example/abbruch.php',        'return_url' => 'http://localhost/example/danke.php'      ),      'purchase_units' => array(        0 => array(          'reference_id' => 'example_addr',          'description' => 'example Address',          'amount' => array(            'currency_code' => 'EUR',            'value' => $price          )        )      )    );[...]到目前為止一切正常。我收到一個 OrderId,我將其返回到 AJAX 調用,然后我就可以插入憑據并支付給定的價格。
查看完整描述

1 回答

?
慕尼黑5688855

TA貢獻1848條經驗 獲得超2個贊

由于沒有電子郵件地址為[email protected]已確認的沙盒帳戶,因此付款處于待處理狀態,因此付款處于無人認領狀態。如果無人認領,待處理的付款將在 30 天后自動退回。

查看完整回答
反對 回復 2023-10-15
  • 1 回答
  • 0 關注
  • 296 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號