Skip to content

Instantly share code, notes, and snippets.

@A-pZ
Created October 28, 2022 10:42
Show Gist options
  • Save A-pZ/ef2b8cbb04c3da50bd5432fa130fea47 to your computer and use it in GitHub Desktop.
Save A-pZ/ef2b8cbb04c3da50bd5432fa130fea47 to your computer and use it in GitHub Desktop.
決済手段のデフォルトを登録
Customer customer = Customer.retrieve(paymentCustomer.id()); // 決済利用者のカスタマIDを指定
CustomerUpdateParams customerUpdateParams = CustomerUpdateParams.builder()
.setInvoiceSettings(
// 決済したPaymentMethodのIDを InvoiceSettingを経由して指定する
CustomerUpdateParams.InvoiceSettings.builder().setDefaultPaymentMethod(paymentMethodId.value()).build()
).build();
customer.update(customerUpdateParams);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment