mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-11 03:40:20 +00:00
Add api payment method
It will be used to credit customer via the customer account transaction API
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user