Skip to content

Commit

Permalink
Replace Alipay+ domain name
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenghui97 committed May 20, 2024
1 parent b811232 commit 679b76a
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 37 deletions.
16 changes: 8 additions & 8 deletions doc/legacy_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Alipay::Service.create_partner_trade_by_buyer_url(
return_url: 'https://example.com/orders/20150401000-0001',
notify_url: 'https://example.com/orders/20150401000-0001/notify'
)
# => 'https://mapi.alipay.com/gateway.do?service=create_partner_trade_by_buyer&...'
# => 'https://api-sea-global.alipayplus.com/gateway.do?service=create_partner_trade_by_buyer&...'
```

Guide consumer to this address to complete payment
Expand Down Expand Up @@ -277,7 +277,7 @@ Alipay::Service.refund_fastpay_by_platform_pwd_url(
}],
notify_url: 'https://example.com/orders/20150401000-0001/refund_notify'
)
# => https://mapi.alipay.com/gateway.do?service=refund_fastpay_by_platform_pwd&...
# => https://api-sea-global.alipayplus.com/gateway.do?service=refund_fastpay_by_platform_pwd&...
```

#### Arguments
Expand Down Expand Up @@ -389,7 +389,7 @@ Alipay::Service.create_forex_trade_url(
total_fee: '10.00',
notify_url: 'https://example.com/orders/20150401000-0001/notify'
)
# => 'https://mapi.alipay.com/gateway.do?service=create_forex_trade...'
# => 'https://api-sea-global.alipayplus.com/gateway.do?service=create_forex_trade...'
```

#### ARGUMENTS
Expand Down Expand Up @@ -498,7 +498,7 @@ Alipay::Service.batch_trans_notify_url(
batch_fee: 1000.00,
email: '[email protected]'
)
#=> 'https://mapi.alipay.com/gateway.do?service=batch_trans_notify&...'
#=> 'https://api-sea-global.alipayplus.com/gateway.do?service=batch_trans_notify&...'
```

#### Arguments
Expand Down Expand Up @@ -572,7 +572,7 @@ create_qr_code_params = {
}

Alipay::Service.create_merchant_qr_code(create_qr_code_params)
# => 'https://mapi.alipay.com/gateway.do?service=alipay.commerce.qrcode.create...'
# => 'https://api-sea-global.alipayplus.com/gateway.do?service=alipay.commerce.qrcode.create...'
```

#### ARGUMENTS
Expand Down Expand Up @@ -633,7 +633,7 @@ update_qr_code_params = {
}

Alipay::Service.update_merchant_qr_code(update_qr_code_params)
# => 'https://mapi.alipay.com/gateway.do?service=alipay.commerce.qrcode.modify...'
# => 'https://api-sea-global.alipayplus.com/gateway.do?service=alipay.commerce.qrcode.modify...'
```

#### ARGUMENTS
Expand Down Expand Up @@ -683,7 +683,7 @@ acquirer_overseas_query_params = {
}

Alipay::Service.acquirer_overseas_query(acquirer_overseas_query_params)
# => 'https://mapi.alipay.com/gateway.do?service=alipay.acquire.overseas.query...'
# => 'https://api-sea-global.alipayplus.com/gateway.do?service=alipay.acquire.overseas.query...'
```

#### ARGUMENTS
Expand Down Expand Up @@ -720,7 +720,7 @@ acquirer_overseas_spot_refund_params = {
}

Alipay::Service.acquirer_overseas_spot_refund_url(acquirer_overseas_spot_refund_params)
# => 'https://mapi.alipay.com/gateway.do?service=alipay.acquire.overseas.spot.refund...'
# => 'https://api-sea-global.alipayplus.com/gateway.do?service=alipay.acquire.overseas.spot.refund...'
```

#### ARGUMENTS
Expand Down
8 changes: 4 additions & 4 deletions lib/alipay/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Alipay::Service.create_partner_trade_by_buyer_url(
return_url: 'https://example.com/orders/20150401000-0001',
notify_url: 'https://example.com/orders/20150401000-0001/notify'
)
# => 'https://mapi.alipay.com/gateway.do?service=create_partner_trade_by_buyer&...'
# => 'https://api-sea-global.alipayplus.com/gateway.do?service=create_partner_trade_by_buyer&...'
```

Guide consumer to this address to complete payment
Expand Down Expand Up @@ -233,7 +233,7 @@ Alipay::Service.refund_fastpay_by_platform_pwd_url(
}],
notify_url: 'https://example.com/orders/20150401000-0001/refund_notify'
)
# => https://mapi.alipay.com/gateway.do?service=refund_fastpay_by_platform_pwd&...
# => https://api-sea-global.alipayplus.com/gateway.do?service=refund_fastpay_by_platform_pwd&...
```

#### Arguments
Expand Down Expand Up @@ -345,7 +345,7 @@ Alipay::Service.create_forex_trade_url(
total_fee: '10.00',
notify_url: 'https://example.com/orders/20150401000-0001/notify'
)
# => 'https://mapi.alipay.com/gateway.do?service=create_forex_trade...'
# => 'https://api-sea-global.alipayplus.com/gateway.do?service=create_forex_trade...'
```

#### ARGUMENTS
Expand Down Expand Up @@ -454,7 +454,7 @@ Alipay::Service.batch_trans_notify_url(
batch_fee: 1000.00,
email: '[email protected]'
)
#=> 'https://mapi.alipay.com/gateway.do?service=batch_trans_notify&...'
#=> 'https://api-sea-global.alipayplus.com/gateway.do?service=batch_trans_notify&...'
```

#### Arguments
Expand Down
2 changes: 1 addition & 1 deletion lib/alipay/notify.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def self.verify?(params, options = {})
end

def self.verify_notify_id?(pid, notify_id)
uri = URI("https://mapi.alipay.com/gateway.do")
uri = URI("https://api-sea-global.alipayplus.com/gateway.do")
uri.query = URI.encode_www_form(
'service' => 'notify_verify',
'partner' => pid,
Expand Down
2 changes: 1 addition & 1 deletion lib/alipay/service.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Alipay
module Service
GATEWAY_URL = 'https://mapi.alipay.com/gateway.do'
GATEWAY_URL = 'https://api-sea-global.alipayplus.com/gateway.do'

CREATE_PARTNER_TRADE_BY_BUYER_REQUIRED_PARAMS = %w( out_trade_no subject logistics_type logistics_fee logistics_payment price quantity )
def self.create_partner_trade_by_buyer_url(params, options = {})
Expand Down
6 changes: 3 additions & 3 deletions test/alipay/notify_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ def setup

def test_unsign_notify
stub_request(
:get, "https://mapi.alipay.com/gateway.do?service=notify_verify&partner=#{Alipay.pid}&notify_id=1234"
:get, "https://api-sea-global.alipayplus.com/gateway.do?service=notify_verify&partner=#{Alipay.pid}&notify_id=1234"
).to_return(body: "true")
assert !Alipay::Notify.verify?(@unsign_params)
end

def test_verify_notify_when_true
stub_request(
:get, "https://mapi.alipay.com/gateway.do?service=notify_verify&partner=#{Alipay.pid}&notify_id=1234"
:get, "https://api-sea-global.alipayplus.com/gateway.do?service=notify_verify&partner=#{Alipay.pid}&notify_id=1234"
).to_return(body: "true")
assert Alipay::Notify.verify?(@sign_params)
end

def test_verify_notify_when_false
stub_request(
:get, "https://mapi.alipay.com/gateway.do?service=notify_verify&partner=#{Alipay.pid}&notify_id=1234"
:get, "https://api-sea-global.alipayplus.com/gateway.do?service=notify_verify&partner=#{Alipay.pid}&notify_id=1234"
).to_return(body: "false")
assert !Alipay::Notify.verify?(@sign_params)
end
Expand Down
Loading

0 comments on commit 679b76a

Please sign in to comment.