Skip to content

Commit

Permalink
PAD: add acss_debit to the list of payment method types
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
  • Loading branch information
pierre committed Jun 21, 2023
1 parent ec31abc commit 7b4f6f9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,10 @@ public PaymentIntent execute(final Account account, final StripePaymentMethodsRe
// See https://groups.google.com/forum/?#!msg/killbilling-users/li3RNs-YmIA/oaUrBElMFQAJ
paymentMethodTypesBuilder.add("ach_debit");
}
if (transactionType == TransactionType.PURCHASE && currency == Currency.CAD) {
// See https://groups.google.com/g/killbilling-users/c/7nlIxYZd828/m/r82Tbnl7AAAJ
paymentMethodTypesBuilder.add("acss_debit");
}
paymentIntentParams.put("payment_method_types", paymentMethodTypesBuilder.build());

final StripeConfigProperties stripeConfigProperties = stripeConfigPropertiesConfigurationHandler.getConfigurable(context.getTenantId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,19 @@ public static Map<String, Object> toAdditionalDataMap(final PaymentSource stripe
additionalDataMap.put("sepa_debit_mandate_reference", sepaDebit.getMandateReference());
additionalDataMap.put("sepa_debit_mandate_url", sepaDebit.getMandateUrl());
}
final Source.AcssDebit acssDebit = stripeSource.getAcssDebit();
if (acssDebit != null) {
additionalDataMap.put("acss_debit_bank_address_city", acssDebit.getBankAddressCity());
additionalDataMap.put("acss_debit_bank_address_line_1", acssDebit.getBankAddressLine1());
additionalDataMap.put("acss_debit_bank_address_line_2", acssDebit.getBankAddressLine2());
additionalDataMap.put("acss_debit_bank_address_postal_code", acssDebit.getBankAddressPostalCode());
additionalDataMap.put("acss_debit_bank_name", acssDebit.getBankName());
additionalDataMap.put("acss_debit_category", acssDebit.getCategory());
additionalDataMap.put("acss_debit_country", acssDebit.getCountry());
additionalDataMap.put("acss_debit_fingerprint", acssDebit.getFingerprint());
additionalDataMap.put("acss_debit_last4", acssDebit.getLast4());
additionalDataMap.put("acss_debit_routing_number", acssDebit.getRoutingNumber());
}
additionalDataMap.put("created", stripeSource.getCreated());
additionalDataMap.put("customer_id", stripeSource.getCustomer());
additionalDataMap.put("id", stripeSource.getId());
Expand Down

0 comments on commit 7b4f6f9

Please sign in to comment.