簡體   English   中英

使用java檢查客戶的ACH信用轉移

[英]Check ACH credit transfer for customer in stripe using java

有沒有辦法檢查 ACH 信用轉移是否使用 java 僅使用 customerid 以條帶方式添加到客戶。

ACH Credit Transfer 仍然僅在 Stripe 的舊 API 上可用,稱為Source API ,如此所述。 由於它還與 PaymentMethod API 不兼容,您必須使用 Java 中稱為getSources()的舊調用之一,這可能有點難以發現。

您的代碼將如下所示:

// Retrieve the customer with its legacy payment sources included
CustomerRetrieveParams retrieveParams =
  CustomerRetrieveParams.builder()
    .addExpand("sources")
    .build();

Customer customer = Customer.retrieve("cus_1234", retrieveParams, null);

// Filter payment sources down to just Sources
PaymentSourceCollectionListParams sourcesParams =
  PaymentSourceCollectionListParams.builder()
    .setObject("source")
    .build();

PaymentSourceCollection sources = customer.getSources().list(sourcesParams);

// Iterate over the Sources to find what you need
Iterable<PaymentSource> itSources =  sources.autoPagingIterable();
for (PaymentSource paymentSource : itSources) {
  Source source = (Source) paymentSource;
  System.out.println(source.getId());
  System.out.println(source.getType());
}
System.out.println("done");

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM