Add api payment method

It will be used to credit customer via the customer account transaction
API
This commit is contained in:
Gaetan Craig-Riou
2026-02-03 13:44:48 +11:00
parent 45786780a8
commit e10fd0b020
4 changed files with 49 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ module SampleData
distributors.each do |enterprise|
create_payment_methods(enterprise)
end
create_api_method(distributors)
end
private
@@ -45,5 +46,16 @@ module SampleData
payment_method.calculator = calculator
payment_method.save!
end
def create_api_method(enterprises)
log "Creating api payment method"
Spree::PaymentMethod::Check.create!(
name: "api_payment_method.name",
description: "api_payment_method.description",
environment: Rails.env,
distributors: enterprises,
display_on: "back_end"
)
end
end
end