Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Paycell DCB Payment Method #209

Merged
merged 2 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Craftgate/Model/ApmType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public enum ApmType
[EnumMember(Value = "CHIPPIN")] CHIPPIN,
[EnumMember(Value = "PAYMOB")] PAYMOB,
[EnumMember(Value = "BIZUM")] BIZUM,
[EnumMember(Value = "PAYCELL_DCB")] PAYCELL_DCB,
[EnumMember(Value = "FUND_TRANSFER")] FUND_TRANSFER,
[EnumMember(Value = "CASH_ON_DELIVERY")] CASH_ON_DELIVERY
}
Expand Down
1 change: 1 addition & 0 deletions Craftgate/Model/PaymentProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public enum PaymentProvider
[EnumMember(Value = "CHIPPIN")] CHIPPIN,
[EnumMember(Value = "PAYMOB")] PAYMOB,
[EnumMember(Value = "BIZUM")] BIZUM,
[EnumMember(Value = "PAYCELL_DCB")] PAYCELL_DCB,
[EnumMember(Value = "OFFLINE")] OFFLINE
}
}
42 changes: 42 additions & 0 deletions Samples/PaymentSample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1227,6 +1227,48 @@ public void Init_Bizum_Apm_Payment()
Assert.AreEqual(response.PaymentStatus, PaymentStatus.WAITING);
Assert.AreEqual(response.AdditionalAction, ApmAdditionalAction.WAIT_FOR_WEBHOOK);
}

[Test]
public void Init_Paycell_DCB_Apm_Payment()
{
var additionalParams = new Dictionary<string, object>();
additionalParams.Add("paycellGsmNumber", "5305289290");

var request = new InitApmPaymentRequest
{
ApmType = ApmType.PAYCELL_DCB,
Price = new decimal(1.0),
PaidPrice = new decimal(1.0),
Currency = Currency.TRY,
PaymentGroup = PaymentGroup.LISTING_OR_SUBSCRIPTION,
ConversationId = "conversationId",
ExternalId = "externalId",
CallbackUrl = "callbackUrl",
Items = new List<PaymentItem>
{
new PaymentItem
{
Name = "Item 1",
ExternalId = Guid.NewGuid().ToString(),
Price = new decimal(0.40)
},

new PaymentItem
{
Name = "Item 2",
ExternalId = Guid.NewGuid().ToString(),
Price = new decimal(0.60)
}
},
AdditionalParams = additionalParams
};

var response = _craftgateClient.Payment().InitApmPayment(request);
Assert.NotNull(response);
Assert.NotNull(response.PaymentId);
Assert.AreEqual(response.PaymentStatus, PaymentStatus.WAITING);
Assert.AreEqual(response.AdditionalAction, ApmAdditionalAction.OTP_REQUIRED);
}

[Test]
public void Init_Paymob_Apm_Payment()
Expand Down
Loading