world = mockworld(name: "Refund test", services: ["stripe", "shopify"])
# Seed data before running
world.seed do |s|
s.stripe.customers.create(
id: "cus_ana",
email: "ana@example.com",
name: "Ana Smith"
)
s.stripe.payment_intents.create(
id: "pi_test123",
amount: 15000,
currency: "usd",
status: "succeeded",
customer: "cus_ana"
)
s.shopify.orders.create(
id: "order_1234",
total_price: "150.00",
financial_status: "paid",
customer: { email: "ana@example.com" }
)
end
# Now run your test
world.run do
# Your code can reference this seeded data
order = ShopifyAPI::Order.find(id: "order_1234")
refund = Stripe::Refund.create(payment_intent: "pi_test123")
end