@@ -43,6 +43,14 @@ impl TryFrom<&ConnectorAuthType> for AirwallexAuthType {
43
43
}
44
44
}
45
45
}
46
+
47
+ #[ derive( Default , Debug , Serialize , Eq , PartialEq ) ]
48
+ pub struct ReferrerData {
49
+ #[ serde( rename = "type" ) ]
50
+ r_type : String ,
51
+ version : String ,
52
+ }
53
+
46
54
#[ derive( Default , Debug , Serialize , Eq , PartialEq ) ]
47
55
pub struct AirwallexIntentRequest {
48
56
// Unique ID to be sent for each transaction/operation request to the connector
@@ -51,10 +59,16 @@ pub struct AirwallexIntentRequest {
51
59
currency : enums:: Currency ,
52
60
//ID created in merchant's order system that corresponds to this PaymentIntent.
53
61
merchant_order_id : String ,
62
+ // This data is required to whitelist Hyperswitch at Airwallex.
63
+ referrer_data : ReferrerData ,
54
64
}
55
65
impl TryFrom < & types:: PaymentsPreProcessingRouterData > for AirwallexIntentRequest {
56
66
type Error = error_stack:: Report < errors:: ConnectorError > ;
57
67
fn try_from ( item : & types:: PaymentsPreProcessingRouterData ) -> Result < Self , Self :: Error > {
68
+ let referrer_data = ReferrerData {
69
+ r_type : "hyperswitch" . to_string ( ) ,
70
+ version : "1.0.0" . to_string ( ) ,
71
+ } ;
58
72
// amount and currency will always be Some since PaymentsPreProcessingData is constructed using PaymentsAuthorizeData
59
73
let amount = item
60
74
. request
@@ -73,6 +87,7 @@ impl TryFrom<&types::PaymentsPreProcessingRouterData> for AirwallexIntentRequest
73
87
amount : utils:: to_currency_base_unit ( amount, currency) ?,
74
88
currency,
75
89
merchant_order_id : item. connector_request_reference_id . clone ( ) ,
90
+ referrer_data,
76
91
} )
77
92
}
78
93
}
0 commit comments