@@ -107,16 +107,15 @@ impl ConnectorCommon for Prophetpay {
107
107
& self ,
108
108
res : Response ,
109
109
) -> CustomResult < ErrorResponse , errors:: ConnectorError > {
110
- let response: prophetpay :: ProphetpayErrorResponse = res
110
+ let response: serde_json :: Value = res
111
111
. response
112
- . parse_struct ( "ProphetpayErrorResponse " )
112
+ . parse_struct ( "ProphetPayErrorResponse " )
113
113
. change_context ( errors:: ConnectorError :: ResponseDeserializationFailed ) ?;
114
-
115
114
Ok ( ErrorResponse {
116
115
status_code : res. status_code ,
117
- code : response . status . to_string ( ) ,
118
- message : response . title ,
119
- reason : Some ( response. errors . to_string ( ) ) ,
116
+ code : consts :: NO_ERROR_CODE . to_string ( ) ,
117
+ message : consts :: NO_ERROR_MESSAGE . to_string ( ) ,
118
+ reason : Some ( response. to_string ( ) ) ,
120
119
attempt_status : None ,
121
120
} )
122
121
}
324
323
where
325
324
types:: PaymentsResponseData : Clone ,
326
325
{
327
- let response: prophetpay:: ProphetpayResponse = res
326
+ let response: prophetpay:: ProphetpayCompleteAuthResponse = res
328
327
. response
329
328
. parse_struct ( "prophetpay ProphetpayResponse" )
330
329
. change_context ( errors:: ConnectorError :: ResponseDeserializationFailed ) ?;
@@ -407,9 +406,9 @@ impl ConnectorIntegration<api::PSync, types::PaymentsSyncData, types::PaymentsRe
407
406
data : & types:: PaymentsSyncRouterData ,
408
407
res : Response ,
409
408
) -> CustomResult < types:: PaymentsSyncRouterData , errors:: ConnectorError > {
410
- let response: prophetpay:: ProphetpayResponse = res
409
+ let response: prophetpay:: ProphetpaySyncResponse = res
411
410
. response
412
- . parse_struct ( "prophetpay ProphetpayResponse " )
411
+ . parse_struct ( "prophetpay PaymentsSyncResponse " )
413
412
. change_context ( errors:: ConnectorError :: ResponseDeserializationFailed ) ?;
414
413
types:: RouterData :: try_from ( types:: ResponseRouterData {
415
414
response,
@@ -431,9 +430,12 @@ impl ConnectorIntegration<api::Capture, types::PaymentsCaptureData, types::Payme
431
430
{
432
431
}
433
432
433
+ // This is Void Implementation for Prophetpay
434
+ // Since Prophetpay does not have capture this have been commented out but kept if it is required for future usage
434
435
impl ConnectorIntegration < api:: Void , types:: PaymentsCancelData , types:: PaymentsResponseData >
435
436
for Prophetpay
436
437
{
438
+ /*
437
439
fn get_headers(
438
440
&self,
439
441
req: &types::PaymentsCancelRouterData,
@@ -471,33 +473,25 @@ impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsR
471
473
.change_context(errors::ConnectorError::RequestEncodingFailed)?;
472
474
Ok(Some(prophetpay_req))
473
475
}
476
+ */
474
477
475
478
fn build_request (
476
479
& self ,
477
- req : & types:: PaymentsCancelRouterData ,
478
- connectors : & settings:: Connectors ,
480
+ _req : & types:: PaymentsCancelRouterData ,
481
+ _connectors : & settings:: Connectors ,
479
482
) -> CustomResult < Option < services:: Request > , errors:: ConnectorError > {
480
- Ok ( Some (
481
- services:: RequestBuilder :: new ( )
482
- . method ( services:: Method :: Get )
483
- . url ( & types:: PaymentsVoidType :: get_url ( self , req, connectors) ?)
484
- . attach_default_headers ( )
485
- . headers ( types:: PaymentsVoidType :: get_headers ( self , req, connectors) ?)
486
- . body ( types:: PaymentsVoidType :: get_request_body (
487
- self , req, connectors,
488
- ) ?)
489
- . build ( ) ,
490
- ) )
483
+ Err ( errors:: ConnectorError :: NotImplemented ( "Void flow not implemented" . to_string ( ) ) . into ( ) )
491
484
}
492
485
486
+ /*
493
487
fn handle_response(
494
488
&self,
495
489
data: &types::PaymentsCancelRouterData,
496
490
res: Response,
497
491
) -> CustomResult<types::PaymentsCancelRouterData, errors::ConnectorError> {
498
- let response: prophetpay:: ProphetpayResponse = res
492
+ let response: prophetpay::ProphetpayVoidResponse = res
499
493
.response
500
- . parse_struct ( "prophetpay ProphetpayResponse " )
494
+ .parse_struct("prophetpay PaymentsCancelResponse ")
501
495
.change_context(errors::ConnectorError::ResponseDeserializationFailed)?;
502
496
types::RouterData::try_from(types::ResponseRouterData {
503
497
response,
@@ -512,6 +506,7 @@ impl ConnectorIntegration<api::Void, types::PaymentsCancelData, types::PaymentsR
512
506
) -> CustomResult<ErrorResponse, errors::ConnectorError> {
513
507
self.build_error_response(res)
514
508
}
509
+ */
515
510
}
516
511
517
512
impl ConnectorIntegration < api:: Execute , types:: RefundsData , types:: RefundsResponseData >
@@ -652,7 +647,7 @@ impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponse
652
647
) -> CustomResult < Option < services:: Request > , errors:: ConnectorError > {
653
648
Ok ( Some (
654
649
services:: RequestBuilder :: new ( )
655
- . method ( services:: Method :: Get )
650
+ . method ( services:: Method :: Post )
656
651
. url ( & types:: RefundSyncType :: get_url ( self , req, connectors) ?)
657
652
. attach_default_headers ( )
658
653
. headers ( types:: RefundSyncType :: get_headers ( self , req, connectors) ?)
@@ -668,7 +663,7 @@ impl ConnectorIntegration<api::RSync, types::RefundsData, types::RefundsResponse
668
663
data : & types:: RefundSyncRouterData ,
669
664
res : Response ,
670
665
) -> CustomResult < types:: RefundSyncRouterData , errors:: ConnectorError > {
671
- let response: prophetpay:: ProphetpayRefundResponse = res
666
+ let response: prophetpay:: ProphetpayRefundSyncResponse = res
672
667
. response
673
668
. parse_struct ( "prophetpay ProphetpayRefundResponse" )
674
669
. change_context ( errors:: ConnectorError :: ResponseDeserializationFailed ) ?;
0 commit comments