Skip to content

Commit

Permalink
feat(connector): [Boku] Implement Authorize, Psync, Refund and Rsync …
Browse files Browse the repository at this point in the history
…flow (#1699)
  • Loading branch information
Sakilmostak committed Aug 2, 2023
1 parent 73ed7ae commit 9cba7da
Show file tree
Hide file tree
Showing 14 changed files with 568 additions and 159 deletions.
10 changes: 10 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ authorizedotnet.base_url = "https://apitest.authorize.net/xml/v1/request.api"
bambora.base_url = "https://api.na.bambora.com"
bitpay.base_url = "https://test.bitpay.com"
bluesnap.base_url = "https://sandbox.bluesnap.com/"
boku.base_url = "https://country-api4-stage.boku.com"
boku.base_url = "https://$-api4-stage.boku.com"
braintree.base_url = "https://api.sandbox.braintreegateway.com/"
cashtocode.base_url = "https://cluster05.api-test.cashtocode.com"
checkout.base_url = "https://api.sandbox.checkout.com/"
Expand Down
2 changes: 1 addition & 1 deletion config/development.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ authorizedotnet.base_url = "https://apitest.authorize.net/xml/v1/request.api"
bambora.base_url = "https://api.na.bambora.com"
bitpay.base_url = "https://test.bitpay.com"
bluesnap.base_url = "https://sandbox.bluesnap.com/"
boku.base_url = "https://country-api4-stage.boku.com"
boku.base_url = "https://$-api4-stage.boku.com"
braintree.base_url = "https://api.sandbox.braintreegateway.com/"
cashtocode.base_url = "https://cluster05.api-test.cashtocode.com"
checkout.base_url = "https://api.sandbox.checkout.com/"
Expand Down
2 changes: 1 addition & 1 deletion config/docker_compose.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ authorizedotnet.base_url = "https://apitest.authorize.net/xml/v1/request.api"
bambora.base_url = "https://api.na.bambora.com"
bitpay.base_url = "https://test.bitpay.com"
bluesnap.base_url = "https://sandbox.bluesnap.com/"
boku.base_url = "https://country-api4-stage.boku.com"
boku.base_url = "https://$-api4-stage.boku.com"
braintree.base_url = "https://api.sandbox.braintreegateway.com/"
cashtocode.base_url = "https://cluster05.api-test.cashtocode.com"
checkout.base_url = "https://api.sandbox.checkout.com/"
Expand Down
4 changes: 2 additions & 2 deletions crates/api_models/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub enum Connector {
Bitpay,
Bambora,
Bluesnap,
// Boku, added as template code for future usage
Boku,
Braintree,
Cashtocode,
Checkout,
Expand Down Expand Up @@ -192,7 +192,7 @@ pub enum RoutableConnectors {
Bitpay,
Bambora,
Bluesnap,
// Boku, added as template code for future usage
Boku,
Braintree,
Cashtocode,
Checkout,
Expand Down
19 changes: 19 additions & 0 deletions crates/common_utils/src/ext_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ where
where
Self: Serialize;

///
/// Functionality, for specifically encoding `Self` into `String`
/// after serialization by using `serde::Serialize`
/// specifically, to convert into XML `String`.
///
fn encode_to_string_of_xml(&'e self) -> CustomResult<String, errors::ParsingError>
where
Self: Serialize;

///
/// Functionality, for specifically encoding `Self` into `serde_json::Value`
/// after serialization by using `serde::Serialize`
Expand Down Expand Up @@ -131,6 +140,16 @@ where
.attach_printable_lazy(|| format!("Unable to convert {self:?} to a request"))
}

fn encode_to_string_of_xml(&'e self) -> CustomResult<String, errors::ParsingError>
where
Self: Serialize,
{
quick_xml::se::to_string(self)
.into_report()
.change_context(errors::ParsingError::EncodeError("xml"))
.attach_printable_lazy(|| format!("Unable to convert {self:?} to a request"))
}

fn encode_to_value(&'e self) -> CustomResult<serde_json::Value, errors::ParsingError>
where
Self: Serialize,
Expand Down
1 change: 1 addition & 0 deletions crates/router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ rand = "0.8.5"
regex = "1.8.4"
reqwest = { version = "0.11.18", features = ["json", "native-tls", "gzip", "multipart"] }
ring = "0.16.20"
roxmltree = "0.18.0"
serde = { version = "1.0.163", features = ["derive"] }
serde_json = "1.0.96"
serde_path_to_error = "0.1.11"
Expand Down
Loading

0 comments on commit 9cba7da

Please sign in to comment.