Skip to content

Commit babf97a

Browse files
committed
support orderCode & entryCode
1 parent 4e85adc commit babf97a

File tree

5 files changed

+146
-0
lines changed

5 files changed

+146
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text.Json;
4+
using System.Text.Json.Serialization;
5+
using com.alipay.ams.api.entities;
6+
using com.alipay.ams.util;
7+
8+
namespace com.alipay.ams.api.request
9+
{
10+
public class EntryCodePaymentRequest : CommonPaymentRequest<EntryCodePaymentResponse>
11+
{
12+
13+
public EntryCodePaymentRequest()
14+
{
15+
this.ProductCode = ProductCodeType.IN_STORE_PAYMENT;
16+
this.PaymentMethod = new PaymentMethod(WalletPaymentMethodType.CONNECT_WALLET.ToString());
17+
this.PaymentFactor = new PaymentFactor();
18+
this.PaymentFactor.InStorePaymentScenario = InStorePaymentScenario.EntryCode;
19+
}
20+
21+
public override void validate()
22+
{
23+
Asserts.NotNull(PaymentRequestId, "paymentRequestId required.");
24+
Asserts.NotNull(PaymentRedirectUrl, "paymentRedirectUrl required.");
25+
Asserts.NotNull(PaymentAmount, "paymentAmount required.");
26+
Asserts.NotNull(Order, "order required.");
27+
Asserts.NotNull(Order.Merchant, "order.merchant required.");
28+
Asserts.NotNull(Order.OrderAmount, "order.orderAmount required.");
29+
Asserts.NotNull(Order.OrderDescription, "order.orderDescription required.");
30+
Asserts.NotNull(Order.Merchant.ReferenceMerchantId,
31+
"order.merchant.referenceMerchantId required.");
32+
Asserts.NotNull(Order.Merchant.MerchantMCC,
33+
"order.merchant.merchantMcc required.");
34+
Asserts.NotNull(Order.Merchant.MerchantName,
35+
"order.merchant.merchantName required.");
36+
Asserts.NotNull(Order.Merchant.Store, "order.merchant.store required.");
37+
Asserts.NotNull(Order.Merchant.Store.ReferenceStoreId,
38+
"order.merchant.store.referenceStoreId required.");
39+
Asserts.NotNull(Order.Merchant.Store.StoreName,
40+
"order.merchant.store.storeName required.");
41+
Asserts.NotNull(Order.Merchant.Store.StoreMCC,
42+
"order.merchant.store.storeMcc required.");
43+
Asserts.NotNull(Order.Env, "order.env required.");
44+
Asserts.NotNull(Order.Env.UserAgent, "order.env.userAgent required.");
45+
}
46+
}
47+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text.Json;
4+
using System.Text.Json.Serialization;
5+
using com.alipay.ams.api.entities;
6+
using com.alipay.ams.util;
7+
8+
namespace com.alipay.ams.api.request
9+
{
10+
public class OrderCodePaymentRequest : CommonPaymentRequest<OrderCodePaymentResponse>
11+
{
12+
13+
public OrderCodePaymentRequest()
14+
{
15+
this.ProductCode = ProductCodeType.IN_STORE_PAYMENT;
16+
this.PaymentMethod = new PaymentMethod(WalletPaymentMethodType.CONNECT_WALLET.ToString());
17+
this.PaymentFactor = new PaymentFactor();
18+
this.PaymentFactor.InStorePaymentScenario = InStorePaymentScenario.OrderCode;
19+
}
20+
21+
public override void validate()
22+
{
23+
Asserts.NotNull(PaymentRequestId, "paymentRequestId required.");
24+
Asserts.NotNull(PaymentRedirectUrl, "paymentRedirectUrl required.");
25+
Asserts.NotNull(PaymentAmount, "paymentAmount required.");
26+
Asserts.NotNull(Order, "order required.");
27+
Asserts.NotNull(Order.Merchant, "order.merchant required.");
28+
Asserts.NotNull(Order.OrderAmount, "order.orderAmount required.");
29+
Asserts.NotNull(Order.OrderDescription, "order.orderDescription required.");
30+
Asserts.NotNull(Order.Merchant.ReferenceMerchantId,
31+
"order.merchant.referenceMerchantId required.");
32+
Asserts.NotNull(Order.Merchant.MerchantMCC,
33+
"order.merchant.merchantMcc required.");
34+
Asserts.NotNull(Order.Merchant.MerchantName,
35+
"order.merchant.merchantName required.");
36+
Asserts.NotNull(Order.Merchant.Store, "order.merchant.store required.");
37+
Asserts.NotNull(Order.Merchant.Store.ReferenceStoreId,
38+
"order.merchant.store.referenceStoreId required.");
39+
Asserts.NotNull(Order.Merchant.Store.StoreName,
40+
"order.merchant.store.storeName required.");
41+
Asserts.NotNull(Order.Merchant.Store.StoreMCC,
42+
"order.merchant.store.storeMcc required.");
43+
}
44+
}
45+
}

ams-dotnet/src/com/alipay/ams/api/request/UserPresentedCodePaymentRequest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public UserPresentedCodePaymentRequest(string paymentCode)
2323
public override void validate()
2424
{
2525
Asserts.NotNull(PaymentRequestId, "paymentRequestId required.");
26+
Asserts.NotNull(PaymentRedirectUrl, "paymentRedirectUrl required.");
2627
Asserts.NotNull(PaymentAmount, "paymentAmount required.");
2728
Asserts.NotNull(Order, "order required.");
2829
Asserts.NotNull(Order.Merchant, "order.merchant required.");
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using System.Net.Http;
3+
using System.Text.Json;
4+
5+
using com.alipay.ams.api.entities;
6+
using com.alipay.ams.api.response;
7+
8+
namespace com.alipay.ams.api.request
9+
{
10+
public class EntryCodePaymentResponse : CommonPaymentResponse
11+
{
12+
13+
public new Amount PaymentAmount { get; set; }
14+
15+
16+
public new string PaymentCreateTime { get; set; }
17+
18+
19+
public new string PaymentId { get; set; }
20+
21+
22+
public new string PaymentRequestId { get; set; }
23+
24+
25+
public new RedirectActionForm RedirectActionForm { get; set; }
26+
27+
}
28+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System;
2+
using System.Net.Http;
3+
using System.Text.Json;
4+
5+
using com.alipay.ams.api.entities;
6+
using com.alipay.ams.api.response;
7+
8+
namespace com.alipay.ams.api.request
9+
{
10+
public class OrderCodePaymentResponse : CommonPaymentResponse
11+
{
12+
13+
public new Amount PaymentAmount { get; set; }
14+
15+
16+
public new string PaymentId { get; set; }
17+
18+
19+
public new string PaymentRequestId { get; set; }
20+
21+
22+
public new OrderCodeForm OrderCodeForm { get; set; }
23+
24+
}
25+
}

0 commit comments

Comments
 (0)