-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into apple-pay
- Loading branch information
Showing
84 changed files
with
1,794 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Craftgate.Net; | ||
using Craftgate.Request; | ||
using Craftgate.Request.Common; | ||
using Craftgate.Response; | ||
using Craftgate.Response.Dto; | ||
|
||
namespace Craftgate.Adapter | ||
{ | ||
public class BankAccountTrackingAdapter : BaseAdapter | ||
{ | ||
public BankAccountTrackingAdapter(RequestOptions requestOptions) : base(requestOptions) | ||
{ | ||
} | ||
|
||
public BankAccountTrackingRecordListResponse SearchRecords(SearchBankAccountTrackingRecordsRequest request) | ||
{ | ||
var query = RequestQueryParamsBuilder.BuildQueryParam(request); | ||
var path = "/bank-account-tracking/v1/merchant-bank-account-trackings/records" + query; | ||
|
||
return RestClient.Get<BankAccountTrackingRecordListResponse>(RequestOptions.BaseUrl + path, | ||
CreateHeaders(path, RequestOptions)); | ||
} | ||
|
||
public Task<BankAccountTrackingRecordListResponse> SearchRecordsAsync(SearchBankAccountTrackingRecordsRequest request) | ||
{ | ||
var query = RequestQueryParamsBuilder.BuildQueryParam(request); | ||
var path = "/bank-account-tracking/v1/merchant-bank-account-trackings/records" + query; | ||
|
||
return AsyncRestClient.Get<BankAccountTrackingRecordListResponse>(RequestOptions.BaseUrl + path, | ||
CreateHeaders(path, RequestOptions)); | ||
} | ||
|
||
public BankAccountTrackingRecordResponse RetrieveRecord(decimal Id) | ||
{ | ||
var path = "/bank-account-tracking/v1/merchant-bank-account-trackings/records/" + Id; | ||
|
||
return RestClient.Get<BankAccountTrackingRecordResponse>(RequestOptions.BaseUrl + path, | ||
CreateHeaders(path, RequestOptions)); | ||
} | ||
|
||
public Task<BankAccountTrackingRecordResponse> RetrieveRecordAsync(decimal Id) | ||
{ | ||
var path = "/bank-account-tracking/v1/merchant-bank-account-trackings/records/" + Id; | ||
|
||
return AsyncRestClient.Get<BankAccountTrackingRecordResponse>(RequestOptions.BaseUrl + path, | ||
CreateHeaders(path, RequestOptions)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System.Threading.Tasks; | ||
using Craftgate.Net; | ||
using Craftgate.Request; | ||
using Craftgate.Request.Common; | ||
using Craftgate.Response; | ||
|
||
namespace Craftgate.Adapter | ||
{ | ||
public class JuzdanPaymentAdapter : BaseAdapter | ||
{ | ||
public JuzdanPaymentAdapter(RequestOptions requestOptions) : base(requestOptions) | ||
{ | ||
} | ||
|
||
public InitJuzdanPaymentResponse Init(InitJuzdanPaymentRequest initJuzdanPaymentRequest) | ||
{ | ||
var path = "/payment/v1/juzdan-payments/init"; | ||
return RestClient.Post<InitJuzdanPaymentResponse>(RequestOptions.BaseUrl + path, | ||
CreateHeaders(initJuzdanPaymentRequest, path, RequestOptions), initJuzdanPaymentRequest); | ||
} | ||
|
||
public PaymentResponse Retrieve(string referenceId) | ||
{ | ||
var path = "/payment/v1/juzdan-payments/" + referenceId; | ||
return RestClient.Get<PaymentResponse>(RequestOptions.BaseUrl + path, CreateHeaders(path, RequestOptions)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
using System; | ||
using System.Threading.Tasks; | ||
using Craftgate.Model; | ||
using Craftgate.Net; | ||
using Craftgate.Request; | ||
using Craftgate.Request.Common; | ||
using Craftgate.Response; | ||
|
||
namespace Craftgate.Adapter | ||
{ | ||
public class MerchantAdapter : BaseAdapter | ||
{ | ||
public MerchantAdapter(RequestOptions requestOptions) : base(requestOptions) | ||
{ | ||
} | ||
|
||
public MerchantPosResponse CreateMerchantPos(CreateMerchantPosRequest createMemberRequest) | ||
{ | ||
var path = "/merchant/v1/merchant-poses"; | ||
return RestClient.Post<MerchantPosResponse>(RequestOptions.BaseUrl + path, | ||
CreateHeaders(createMemberRequest, path, RequestOptions), | ||
createMemberRequest); | ||
} | ||
|
||
public Task<MerchantPosResponse> CreateMerchantPosAsync(CreateMerchantPosRequest createMemberRequest) | ||
{ | ||
var path = "/merchant/v1/merchant-poses"; | ||
return AsyncRestClient.Post<MerchantPosResponse>(RequestOptions.BaseUrl + path, | ||
CreateHeaders(createMemberRequest, path, RequestOptions), | ||
createMemberRequest); | ||
} | ||
|
||
public MerchantPosResponse RetrieveMerchantPos(long id) | ||
{ | ||
var path = "/merchant/v1/merchant-poses/" + id; | ||
return RestClient.Get<MerchantPosResponse>(RequestOptions.BaseUrl + path, | ||
CreateHeaders(path, RequestOptions)); | ||
} | ||
|
||
public Task<MerchantPosResponse> RetrieveMerchantPosAsync(long id) | ||
{ | ||
var path = "/merchant/v1/merchant-poses/" + id; | ||
return AsyncRestClient.Get<MerchantPosResponse>(RequestOptions.BaseUrl + path, | ||
CreateHeaders(path, RequestOptions)); | ||
} | ||
|
||
public MerchantPosResponse UpdateMerchantPos(long id, UpdateMerchantPosRequest updateMerchantPosRequest) | ||
{ | ||
var path = "/merchant/v1/merchant-poses/" + id; | ||
return RestClient.Put<MerchantPosResponse>(RequestOptions.BaseUrl + path, | ||
CreateHeaders(updateMerchantPosRequest, path, RequestOptions), | ||
updateMerchantPosRequest); | ||
} | ||
|
||
public Task<MerchantPosResponse> UpdateMerchantPosAsync(long id, | ||
UpdateMerchantPosRequest updateMerchantPosRequest) | ||
{ | ||
var path = "/merchant/v1/merchant-poses/" + id; | ||
return AsyncRestClient.Put<MerchantPosResponse>(RequestOptions.BaseUrl + path, | ||
CreateHeaders(updateMerchantPosRequest, path, RequestOptions), | ||
updateMerchantPosRequest); | ||
} | ||
|
||
public void UpdateMerchantPosStatus(long id, PosStatus posStatus) | ||
{ | ||
var path = "/merchant/v1/merchant-poses/" + id + "/status/" + posStatus; | ||
RestClient.Put<object>(RequestOptions.BaseUrl + path, | ||
CreateHeaders(path, RequestOptions)); | ||
} | ||
|
||
public void UpdateMerchantPosStatusAsync(long id, PosStatus posStatus) | ||
{ | ||
var path = "/merchant/v1/merchant-poses/" + id + "/status/" + posStatus; | ||
AsyncRestClient.Put<object>(RequestOptions.BaseUrl + path, | ||
CreateHeaders(path, RequestOptions)); | ||
} | ||
|
||
public void DeleteMerchantPos(long id) | ||
{ | ||
var path = "/merchant/v1/merchant-poses/" + id; | ||
RestClient.Delete<object>(RequestOptions.BaseUrl + path, | ||
CreateHeaders(path, RequestOptions)); | ||
} | ||
|
||
public void DeleteMerchantPosAsync(long id) | ||
{ | ||
var path = "/merchant/v1/merchant-poses/" + id; | ||
AsyncRestClient.Delete<object>(RequestOptions.BaseUrl + path, | ||
CreateHeaders(path, RequestOptions)); | ||
} | ||
|
||
public MerchantPosListResponse SearchMerchantPos(SearchMerchantPosRequest searchMerchantPosRequest) | ||
{ | ||
var queryParam = RequestQueryParamsBuilder.BuildQueryParam(searchMerchantPosRequest); | ||
var path = "/merchant/v1/merchant-poses" + queryParam; | ||
return RestClient.Get<MerchantPosListResponse>(RequestOptions.BaseUrl + path, | ||
CreateHeaders(path, RequestOptions)); | ||
} | ||
|
||
public Task<MerchantPosListResponse> SearchMerchantPosAsync(SearchMerchantPosRequest searchMerchantPosRequest) | ||
{ | ||
var queryParam = RequestQueryParamsBuilder.BuildQueryParam(searchMerchantPosRequest); | ||
var path = "/merchant/v1/merchant-poses" + queryParam; | ||
return AsyncRestClient.Get<MerchantPosListResponse>(RequestOptions.BaseUrl + path, | ||
CreateHeaders(path, RequestOptions)); | ||
} | ||
|
||
public MerchantPosCommissionListResponse RetrieveMerchantPosCommissions(long id) | ||
{ | ||
var path = "/merchant/v1/merchant-poses/" + id + "/commissions"; | ||
return RestClient.Get<MerchantPosCommissionListResponse>(RequestOptions.BaseUrl + path, | ||
CreateHeaders(path, RequestOptions)); | ||
} | ||
|
||
/* | ||
* This endpoint using for creating and updating merchant pos commissions. The HTTP method is POST due to this requirement. | ||
* */ | ||
public MerchantPosCommissionListResponse UpdateMerchantPosCommissions(long id, | ||
UpdateMerchantPosCommissionsRequest request) | ||
{ | ||
var path = "/merchant/v1/merchant-poses/" + id + "/commissions"; | ||
return RestClient.Post<MerchantPosCommissionListResponse>(RequestOptions.BaseUrl + path, | ||
CreateHeaders(request, path, RequestOptions), | ||
request); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.