2016-11-28 110 views
1

我在Stripe Api找到了找回所有發票的方法。但是,它不顯示如何通過JavaScript檢索它們。Stripe API - 使用Javascript檢索所有收據(發票)

我已經做了類似的創建付款,它的迴應是收據本身。

if ($scope.card.error == "" && $scope.card.cvc_error == "" && $scope.card.cardType != "Unrecognizable card type") { 

      return stripe.card.createToken({ 
       number: $scope.card.number, 
       cvc: $scope.card.cvc, 
       exp_month: $scope.card.exp_month, 
       exp_year: $scope.card.exp_year 
      }).then(function (response) { 
       //Todo connect to api 

       console.log(response) 

      }).then(function (res) { 

       $scope.successAlert(); 
      }) 
     } else { 

      $scope.errorAlert(validationArray); 
     } 

我正在使用角度。

回答

2

list all invoices API調用只能與您的祕密API密鑰一起提供,所以您無法從您的前端代碼發送此請求。您需要從後端發出請求,並將結果轉發到您的前端代碼以供顯示。

+0

@ywin舉一個例子..感謝提前。 –

相關問題