Permalink
Browse files

Adapt to configurable context

  • Loading branch information...
1 parent 038e61d commit 1aafa54f4d78b745216fd7df8d75943fb1b713ca @VictorNicollet committed May 14, 2012
Showing with 14 additions and 6 deletions.
  1. +6 −1 ohmCouchPaypal/ohmCouchPaypal.ml
  2. +8 −5 ohmCouchPaypal/ohmCouchPaypal.mli
@@ -102,6 +102,9 @@ module type CONFIG = sig
module VersionDB : CouchDB.CONFIG
module Id : CouchDB.ID
module Reason : Fmt.FMT
+
+ type ctx
+ val couchDB : ctx -> CouchDB.ctx
val testing : bool
@@ -111,7 +114,6 @@ module Make = functor(C:CONFIG) -> struct
(* Type and module definitions *)
-
module Payment = struct
module T = struct
module Float = Fmt.Float
@@ -155,6 +157,9 @@ module Make = functor(C:CONFIG) -> struct
module VersionData = Fmt.Unit
module ReflectedData = Fmt.Unit
+ type ctx = C.ctx
+ let couchDB ctx = C.couchDB ctx
+
let apply = function
| `payer payer -> return (fun id time data ->
return { data with Data.payer = Some payer }
@@ -54,6 +54,9 @@ module type CONFIG = sig
module VersionDB : Ohm.CouchDB.CONFIG
module Id : Ohm.CouchDB.ID
module Reason : Ohm.Fmt.FMT
+
+ type ctx
+ val couchDB : ctx -> Ohm.CouchDB.ctx
val testing : bool
@@ -114,10 +117,10 @@ module Make : functor (C:CONFIG) -> sig
end
module Signals : sig
- val update : (C.Id.t * Payment.t, (Ohm.CouchDB.ctx,unit) Ohm.Run.t) Ohm.Sig.channel
+ val update : (C.Id.t * Payment.t, (C.ctx,unit) Ohm.Run.t) Ohm.Sig.channel
end
- val get : C.Id.t -> (#Ohm.CouchDB.ctx,Payment.t option) Ohm.Run.t
+ val get : C.Id.t -> (C.ctx,Payment.t option) Ohm.Run.t
val setExpressCheckout :
id:C.Id.t
@@ -129,16 +132,16 @@ module Make : functor (C:CONFIG) -> sig
-> locale:[`AU|`AT|`BE|`CA|`CH|`CN|`DE|`ES|`GB|`FR|`IT|`NL|`PL|`US]
-> config:Config.t
-> reason:C.Reason.t
- -> (#Ohm.CouchDB.ctx,string option) Ohm.Run.t
+ -> (C.ctx,string option) Ohm.Run.t
val getExpressCheckoutDetails :
C.Id.t
-> config:Config.t
- -> (#Ohm.CouchDB.ctx,bool) Ohm.Run.t
+ -> (C.ctx,bool) Ohm.Run.t
val doExpressCheckoutPayment :
C.Id.t
-> config:Config.t
- -> (#Ohm.CouchDB.ctx,Status.t option) Ohm.Run.t
+ -> (C.ctx,Status.t option) Ohm.Run.t
end

0 comments on commit 1aafa54

Please sign in to comment.