feat: add Airwallex payments and multi-currency support
This commit is contained in:
@@ -47,6 +47,13 @@ func TestWriteSuccessResponse(t *testing.T) {
|
||||
wantContentType: "text/plain",
|
||||
wantBody: "",
|
||||
},
|
||||
{
|
||||
name: "airwallex returns empty 200",
|
||||
providerKey: payment.TypeAirwallex,
|
||||
wantCode: http.StatusOK,
|
||||
wantContentType: "text/plain",
|
||||
wantBody: "",
|
||||
},
|
||||
{
|
||||
name: "easypay returns plain text success",
|
||||
providerKey: "easypay",
|
||||
@@ -165,6 +172,12 @@ func TestExtractOutTradeNo(t *testing.T) {
|
||||
rawBody: "{}",
|
||||
want: "",
|
||||
},
|
||||
{
|
||||
name: "airwallex payment intent payload",
|
||||
providerKey: payment.TypeAirwallex,
|
||||
rawBody: `{"name":"payment_intent.succeeded","data":{"object":{"merchant_order_id":"sub2_awx_123"}}}`,
|
||||
want: "sub2_awx_123",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
@@ -220,7 +233,7 @@ type webhookHandlerProviderStub struct {
|
||||
verifyErr error
|
||||
}
|
||||
|
||||
func (p webhookHandlerProviderStub) Name() string { return p.key }
|
||||
func (p webhookHandlerProviderStub) Name() string { return p.key }
|
||||
func (p webhookHandlerProviderStub) ProviderKey() string { return p.key }
|
||||
func (p webhookHandlerProviderStub) SupportedTypes() []payment.PaymentType {
|
||||
return []payment.PaymentType{payment.PaymentType(p.key)}
|
||||
|
||||
Reference in New Issue
Block a user