diff --git a/doc/legacy_api.md b/doc/legacy_api.md index 2444d42..d1c6227 100644 --- a/doc/legacy_api.md +++ b/doc/legacy_api.md @@ -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 @@ -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 @@ -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 @@ -498,7 +498,7 @@ Alipay::Service.batch_trans_notify_url( batch_fee: 1000.00, email: 'biz_932@alitest.com' ) -#=> 'https://mapi.alipay.com/gateway.do?service=batch_trans_notify&...' +#=> 'https://api-sea-global.alipayplus.com/gateway.do?service=batch_trans_notify&...' ``` #### Arguments @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/lib/alipay/README.md b/lib/alipay/README.md index 0783e32..7839431 100644 --- a/lib/alipay/README.md +++ b/lib/alipay/README.md @@ -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 @@ -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 @@ -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 @@ -454,7 +454,7 @@ Alipay::Service.batch_trans_notify_url( batch_fee: 1000.00, email: 'biz_932@alitest.com' ) -#=> 'https://mapi.alipay.com/gateway.do?service=batch_trans_notify&...' +#=> 'https://api-sea-global.alipayplus.com/gateway.do?service=batch_trans_notify&...' ``` #### Arguments diff --git a/lib/alipay/notify.rb b/lib/alipay/notify.rb index 9e54261..f0db5e7 100644 --- a/lib/alipay/notify.rb +++ b/lib/alipay/notify.rb @@ -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, diff --git a/lib/alipay/service.rb b/lib/alipay/service.rb index 1789887..618d3d2 100644 --- a/lib/alipay/service.rb +++ b/lib/alipay/service.rb @@ -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 = {}) diff --git a/test/alipay/notify_test.rb b/test/alipay/notify_test.rb index 4599052..dccc5e8 100644 --- a/test/alipay/notify_test.rb +++ b/test/alipay/notify_test.rb @@ -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}¬ify_id=1234" + :get, "https://api-sea-global.alipayplus.com/gateway.do?service=notify_verify&partner=#{Alipay.pid}¬ify_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}¬ify_id=1234" + :get, "https://api-sea-global.alipayplus.com/gateway.do?service=notify_verify&partner=#{Alipay.pid}¬ify_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}¬ify_id=1234" + :get, "https://api-sea-global.alipayplus.com/gateway.do?service=notify_verify&partner=#{Alipay.pid}¬ify_id=1234" ).to_return(body: "false") assert !Alipay::Notify.verify?(@sign_params) end diff --git a/test/alipay/service_test.rb b/test/alipay/service_test.rb index 7c42ba0..b8a1dfc 100644 --- a/test/alipay/service_test.rb +++ b/test/alipay/service_test.rb @@ -12,7 +12,7 @@ def test_generate_create_partner_trade_by_buyer_url quantity: 1 } - assert_equal 'https://mapi.alipay.com/gateway.do?service=create_partner_trade_by_buyer&_input_charset=utf-8&partner=1000000000000000&seller_id=1000000000000000&payment_type=1&out_trade_no=1&subject=test&logistics_type=POST&logistics_fee=0&logistics_payment=SELLER_PAY&price=0.01&quantity=1&sign_type=MD5&sign=b5d30863b44acd8514a49b0320fb2aa2', Alipay::Service.create_partner_trade_by_buyer_url(options) + assert_equal 'https://api-sea-global.alipayplus.com/gateway.do?service=create_partner_trade_by_buyer&_input_charset=utf-8&partner=1000000000000000&seller_id=1000000000000000&payment_type=1&out_trade_no=1&subject=test&logistics_type=POST&logistics_fee=0&logistics_payment=SELLER_PAY&price=0.01&quantity=1&sign_type=MD5&sign=b5d30863b44acd8514a49b0320fb2aa2', Alipay::Service.create_partner_trade_by_buyer_url(options) end def test_generate_trade_create_by_buyer_url @@ -25,7 +25,7 @@ def test_generate_trade_create_by_buyer_url price: '0.01', quantity: 1 } - assert_equal 'https://mapi.alipay.com/gateway.do?service=trade_create_by_buyer&_input_charset=utf-8&partner=1000000000000000&seller_id=1000000000000000&payment_type=1&out_trade_no=1&subject=test&logistics_type=POST&logistics_fee=0&logistics_payment=SELLER_PAY&price=0.01&quantity=1&sign_type=MD5&sign=2d296368fea70a127da939558c970bab', Alipay::Service.trade_create_by_buyer_url(options) + assert_equal 'https://api-sea-global.alipayplus.com/gateway.do?service=trade_create_by_buyer&_input_charset=utf-8&partner=1000000000000000&seller_id=1000000000000000&payment_type=1&out_trade_no=1&subject=test&logistics_type=POST&logistics_fee=0&logistics_payment=SELLER_PAY&price=0.01&quantity=1&sign_type=MD5&sign=2d296368fea70a127da939558c970bab', Alipay::Service.trade_create_by_buyer_url(options) end def test_generate_create_direct_pay_by_user_url @@ -35,7 +35,7 @@ def test_generate_create_direct_pay_by_user_url price: '0.01', quantity: 1 } - assert_equal 'https://mapi.alipay.com/gateway.do?service=create_direct_pay_by_user&_input_charset=utf-8&partner=1000000000000000&seller_id=1000000000000000&payment_type=1&out_trade_no=1&subject=test&price=0.01&quantity=1&sign_type=MD5&sign=682ad02280fca7d4c0fd22678fdddeef', Alipay::Service.create_direct_pay_by_user_url(options) + assert_equal 'https://api-sea-global.alipayplus.com/gateway.do?service=create_direct_pay_by_user&_input_charset=utf-8&partner=1000000000000000&seller_id=1000000000000000&payment_type=1&out_trade_no=1&subject=test&price=0.01&quantity=1&sign_type=MD5&sign=682ad02280fca7d4c0fd22678fdddeef', Alipay::Service.create_direct_pay_by_user_url(options) end def test_generate_create_direct_pay_by_user_wap_url @@ -44,7 +44,7 @@ def test_generate_create_direct_pay_by_user_wap_url subject: 'test', total_fee: '0.01' } - assert_equal 'https://mapi.alipay.com/gateway.do?service=alipay.wap.create.direct.pay.by.user&_input_charset=utf-8&partner=1000000000000000&seller_id=1000000000000000&payment_type=1&out_trade_no=1&subject=test&total_fee=0.01&sign_type=MD5&sign=6530de6e3cba153cd4ca7edc48b91f96', Alipay::Service.create_direct_pay_by_user_wap_url(options) + assert_equal 'https://api-sea-global.alipayplus.com/gateway.do?service=alipay.wap.create.direct.pay.by.user&_input_charset=utf-8&partner=1000000000000000&seller_id=1000000000000000&payment_type=1&out_trade_no=1&subject=test&total_fee=0.01&sign_type=MD5&sign=6530de6e3cba153cd4ca7edc48b91f96', Alipay::Service.create_direct_pay_by_user_wap_url(options) end def test_refund_fastpay_by_platform_pwd_url @@ -59,7 +59,7 @@ def test_refund_fastpay_by_platform_pwd_url notify_url: '/some_url', refund_date: '2015-01-01 00:00:00' } - assert_equal 'https://mapi.alipay.com/gateway.do?service=refund_fastpay_by_platform_pwd&_input_charset=utf-8&partner=1000000000000000&seller_user_id=1000000000000000&refund_date=2015-01-01+00%3A00%3A00&batch_num=1&detail_data=1%5E0.01%5Etest&batch_no=123456789¬ify_url=%2Fsome_url&sign_type=MD5&sign=def57a58e1ac21f70c45e41bd3697368', Alipay::Service.refund_fastpay_by_platform_pwd_url(options) + assert_equal 'https://api-sea-global.alipayplus.com/gateway.do?service=refund_fastpay_by_platform_pwd&_input_charset=utf-8&partner=1000000000000000&seller_user_id=1000000000000000&refund_date=2015-01-01+00%3A00%3A00&batch_num=1&detail_data=1%5E0.01%5Etest&batch_no=123456789¬ify_url=%2Fsome_url&sign_type=MD5&sign=def57a58e1ac21f70c45e41bd3697368', Alipay::Service.refund_fastpay_by_platform_pwd_url(options) end def test_forex_refund_url @@ -71,7 +71,7 @@ def test_forex_refund_url reason: 'reason', gmt_return: '20150101000000' } - assert_equal 'https://mapi.alipay.com/gateway.do?service=forex_refund&partner=1000000000000000&_input_charset=utf-8&gmt_return=20150101000000&out_return_no=1&out_trade_no=12345678980&return_amount=0.01¤cy=USD&reason=reason&sign_type=MD5&sign=c9681fff5505fe993d1b2b8141308d0d', Alipay::Service.forex_refund_url(options) + assert_equal 'https://api-sea-global.alipayplus.com/gateway.do?service=forex_refund&partner=1000000000000000&_input_charset=utf-8&gmt_return=20150101000000&out_return_no=1&out_trade_no=12345678980&return_amount=0.01¤cy=USD&reason=reason&sign_type=MD5&sign=c9681fff5505fe993d1b2b8141308d0d', Alipay::Service.forex_refund_url(options) end def test_generate_create_forex_trade_url @@ -82,7 +82,7 @@ def test_generate_create_forex_trade_url currency: 'EUR', total_fee: '0.01', } - assert_equal 'https://mapi.alipay.com/gateway.do?service=create_forex_trade&_input_charset=utf-8&partner=1000000000000000¬ify_url=https%3A%2F%2Fexample.com%2Fnotify&subject=test&out_trade_no=1¤cy=EUR&total_fee=0.01&sign_type=MD5&sign=f24fd4d76acabf860263a40805138380', Alipay::Service.create_forex_trade_url(options) + assert_equal 'https://api-sea-global.alipayplus.com/gateway.do?service=create_forex_trade&_input_charset=utf-8&partner=1000000000000000¬ify_url=https%3A%2F%2Fexample.com%2Fnotify&subject=test&out_trade_no=1¤cy=EUR&total_fee=0.01&sign_type=MD5&sign=f24fd4d76acabf860263a40805138380', Alipay::Service.create_forex_trade_url(options) end def test_close_trade @@ -94,7 +94,7 @@ def test_close_trade EOF stub_request( :get, - %r|https://mapi\.alipay\.com/gateway\.do.*| + %r|https://api-sea-global\.alipayplus\.com/gateway\.do.*| ).to_return(body: response_body) assert_equal response_body, Alipay::Service.close_trade( @@ -145,7 +145,7 @@ def test_single_trade_query EOF stub_request( :get, - %r|https://mapi\.alipay\.com/gateway\.do.*| + %r|https://api-sea-global\.alipayplus\.com/gateway\.do.*| ).to_return(body: response_body) assert_equal response_body, Alipay::Service.single_trade_query( @@ -162,7 +162,7 @@ def test_should_send_goods_confirm_by_platform EOF stub_request( :get, - %r|https://mapi\.alipay\.com/gateway\.do.*| + %r|https://api-sea-global\.alipayplus\.com/gateway\.do.*| ).to_return(body: body) assert_equal body, Alipay::Service.send_goods_confirm_by_platform( @@ -226,7 +226,7 @@ def test_account_page_query EOF stub_request( - :get, %r|https://mapi\.alipay\.com/gateway\.do.*| + :get, %r|https://api-sea-global\.alipayplus\.com/gateway\.do.*| ).to_return(:body => body) assert_equal body, Alipay::Service.account_page_query( page_no: 1, @@ -245,7 +245,7 @@ def test_create_forex_trade_wap_url return_url: 'https://example.com/orders/20150401000-0001', notify_url: 'https://example.com/orders/20150401000-0001/notify' } - assert_equal 'https://mapi.alipay.com/gateway.do?service=create_forex_trade_wap&_input_charset=utf-8&partner=1000000000000000&seller_id=1000000000000000&out_trade_no=20150401000-0001&subject=Order+Name&merchant_url=http%3A%2F%2Fexample.com%2Fitemback&total_fee=10.00¤cy=USD&return_url=https%3A%2F%2Fexample.com%2Forders%2F20150401000-0001¬ify_url=https%3A%2F%2Fexample.com%2Forders%2F20150401000-0001%2Fnotify&sign_type=MD5&sign=f15d9e3d885c12f1a994048342c07bef', Alipay::Service.create_forex_trade_wap_url(options) + assert_equal 'https://api-sea-global.alipayplus.com/gateway.do?service=create_forex_trade_wap&_input_charset=utf-8&partner=1000000000000000&seller_id=1000000000000000&out_trade_no=20150401000-0001&subject=Order+Name&merchant_url=http%3A%2F%2Fexample.com%2Fitemback&total_fee=10.00¤cy=USD&return_url=https%3A%2F%2Fexample.com%2Forders%2F20150401000-0001¬ify_url=https%3A%2F%2Fexample.com%2Forders%2F20150401000-0001%2Fnotify&sign_type=MD5&sign=f15d9e3d885c12f1a994048342c07bef', Alipay::Service.create_forex_trade_wap_url(options) end def test_batch_trans_notify_url @@ -260,7 +260,7 @@ def test_batch_trans_notify_url pay_date: '20080107' } - assert_equal 'https://mapi.alipay.com/gateway.do?service=batch_trans_notify&_input_charset=utf-8&partner=1000000000000000&pay_date=20080107¬ify_url=https%3A%2F%2Fexample.com%2Forders%2F20150401000-0001%2Fnotify&account_name=%E6%AF%9B%E6%AF%9B&detail_data=0315006%5Etestture0002%40126.com%5E%E5%B8%B8%E7%82%9C%E4%B9%B0%E5%AE%B6%5E1000.00%5Ehello&batch_no=20080107001&batch_num=1&batch_fee=1000.0&email=biz_932%40alitest.com&sign_type=MD5&sign=59c611607daafd1337e96b22404bd521', Alipay::Service.batch_trans_notify_url(options) + assert_equal 'https://api-sea-global.alipayplus.com/gateway.do?service=batch_trans_notify&_input_charset=utf-8&partner=1000000000000000&pay_date=20080107¬ify_url=https%3A%2F%2Fexample.com%2Forders%2F20150401000-0001%2Fnotify&account_name=%E6%AF%9B%E6%AF%9B&detail_data=0315006%5Etestture0002%40126.com%5E%E5%B8%B8%E7%82%9C%E4%B9%B0%E5%AE%B6%5E1000.00%5Ehello&batch_no=20080107001&batch_num=1&batch_fee=1000.0&email=biz_932%40alitest.com&sign_type=MD5&sign=59c611607daafd1337e96b22404bd521', Alipay::Service.batch_trans_notify_url(options) end def test_create_merchant_qr_code @@ -281,7 +281,7 @@ def test_create_merchant_qr_code current_time = Time.utc(2023, 12, 12, 1, 1, 1) Time.stub :now, current_time do - assert_equal 'https://mapi.alipay.com/gateway.do?service=alipay.commerce.qrcode.create&_input_charset=utf-8&partner=1000000000000000×tamp=2023-12-12+01%3A01%3A01&biz_data=%7B%22address%22%3A+%22No.278%2C+Road+YinCheng%2C+Shanghai%2C+China%22%2C%22country_code%22%3A+%22CN%22%2C%22currency%22%3A+%22USD%22%2C%22secondary_merchant_id%22%3A+%22xxx001%22%2C%22secondary_merchant_industry%22%3A+%227011%22%2C%22secondary_merchant_name%22%3A+%22xxx+Store%22%2C%22store_id%22%3A+%220001%22%2C%22store_name%22%3A+%22Apple+store%22%2C%22trans_currency%22%3A+%22USD%22%7D&biz_type=OVERSEASHOPQRCODE&sign_type=MD5&sign=1c8881161f5895d0e7bbc8f4f5cad06c', Alipay::Service.create_merchant_qr_code(params) + assert_equal 'https://api-sea-global.alipayplus.com/gateway.do?service=alipay.commerce.qrcode.create&_input_charset=utf-8&partner=1000000000000000×tamp=2023-12-12+01%3A01%3A01&biz_data=%7B%22address%22%3A+%22No.278%2C+Road+YinCheng%2C+Shanghai%2C+China%22%2C%22country_code%22%3A+%22CN%22%2C%22currency%22%3A+%22USD%22%2C%22secondary_merchant_id%22%3A+%22xxx001%22%2C%22secondary_merchant_industry%22%3A+%227011%22%2C%22secondary_merchant_name%22%3A+%22xxx+Store%22%2C%22store_id%22%3A+%220001%22%2C%22store_name%22%3A+%22Apple+store%22%2C%22trans_currency%22%3A+%22USD%22%7D&biz_type=OVERSEASHOPQRCODE&sign_type=MD5&sign=1c8881161f5895d0e7bbc8f4f5cad06c', Alipay::Service.create_merchant_qr_code(params) end end @@ -304,7 +304,7 @@ def test_update_merchant_qr_code current_time = Time.utc(2023, 12, 12, 1, 1, 1) Time.stub :now, current_time do - assert_equal 'https://mapi.alipay.com/gateway.do?service=alipay.commerce.qrcode.modify&_input_charset=utf-8&partner=1000000000000000×tamp=2023-12-12+01%3A01%3A01&biz_data=%7B%22address%22%3A+%22No.278%2C+Road+YinCheng%2C+Shanghai%2C+China%22%2C%22country_code%22%3A+%22CN%22%2C%22currency%22%3A+%22USD%22%2C%22secondary_merchant_id%22%3A+%22xxx001%22%2C%22secondary_merchant_industry%22%3A+%227011%22%2C%22secondary_merchant_name%22%3A+%22xxx+Store%22%2C%22store_id%22%3A+%220001%22%2C%22store_name%22%3A+%22Apple+store%22%2C%22trans_currency%22%3A+%22USD%22%7D&biz_type=OVERSEASHOPQRCODE&qr_code=https%3A%2F%2Fqr.alipay.com%2Fbaxxxxx&sign_type=MD5&sign=4d43f06b3d60cfc96750876287ef66ca', Alipay::Service.update_merchant_qr_code(params) + assert_equal 'https://api-sea-global.alipayplus.com/gateway.do?service=alipay.commerce.qrcode.modify&_input_charset=utf-8&partner=1000000000000000×tamp=2023-12-12+01%3A01%3A01&biz_data=%7B%22address%22%3A+%22No.278%2C+Road+YinCheng%2C+Shanghai%2C+China%22%2C%22country_code%22%3A+%22CN%22%2C%22currency%22%3A+%22USD%22%2C%22secondary_merchant_id%22%3A+%22xxx001%22%2C%22secondary_merchant_industry%22%3A+%227011%22%2C%22secondary_merchant_name%22%3A+%22xxx+Store%22%2C%22store_id%22%3A+%220001%22%2C%22store_name%22%3A+%22Apple+store%22%2C%22trans_currency%22%3A+%22USD%22%7D&biz_type=OVERSEASHOPQRCODE&qr_code=https%3A%2F%2Fqr.alipay.com%2Fbaxxxxx&sign_type=MD5&sign=4d43f06b3d60cfc96750876287ef66ca', Alipay::Service.update_merchant_qr_code(params) end end @@ -313,7 +313,7 @@ def test_acquirer_overseas_query partner_trans_id: "2010121000000002" } - assert_equal 'https://mapi.alipay.com/gateway.do?service=alipay.acquire.overseas.query&_input_charset=utf-8&partner=1000000000000000&partner_trans_id=2010121000000002&sign_type=MD5&sign=2a7f598bbb13d02f7de819ae689f80ba', Alipay::Service.acquirer_overseas_query(params) + assert_equal 'https://api-sea-global.alipayplus.com/gateway.do?service=alipay.acquire.overseas.query&_input_charset=utf-8&partner=1000000000000000&partner_trans_id=2010121000000002&sign_type=MD5&sign=2a7f598bbb13d02f7de819ae689f80ba', Alipay::Service.acquirer_overseas_query(params) end def test_acquirer_overseas_spot_refund_url @@ -325,6 +325,6 @@ def test_acquirer_overseas_spot_refund_url is_sync: "Y" } - assert_equal 'https://mapi.alipay.com/gateway.do?service=alipay.acquire.overseas.spot.refund&_input_charset=utf-8&partner=1000000000000000&partner_trans_id=2010121000000002&partner_refund_id=301012133000002¤cy=USD&refund_amount=0.01&is_sync=Y&sign_type=MD5&sign=397685a0c6b2d71d0d1f374ddba331a0', Alipay::Service.acquirer_overseas_spot_refund_url(params) + assert_equal 'https://api-sea-global.alipayplus.com/gateway.do?service=alipay.acquire.overseas.spot.refund&_input_charset=utf-8&partner=1000000000000000&partner_trans_id=2010121000000002&partner_refund_id=301012133000002¤cy=USD&refund_amount=0.01&is_sync=Y&sign_type=MD5&sign=397685a0c6b2d71d0d1f374ddba331a0', Alipay::Service.acquirer_overseas_spot_refund_url(params) end end diff --git a/test/alipay/wap/notify_test.rb b/test/alipay/wap/notify_test.rb index 74b4f54..833200b 100644 --- a/test/alipay/wap/notify_test.rb +++ b/test/alipay/wap/notify_test.rb @@ -17,21 +17,21 @@ def setup def test_unsign_notify stub_request( - :get, "https://mapi.alipay.com/gateway.do?service=notify_verify&partner=#{Alipay.pid}¬ify_id=#{@notify_id}" + :get, "https://api-sea-global.alipayplus.com/gateway.do?service=notify_verify&partner=#{Alipay.pid}¬ify_id=#{@notify_id}" ).to_return(body: "true") assert !Alipay::Wap::Notify.verify?(@notify_params) end def test_verify_notify_when_true stub_request( - :get, "https://mapi.alipay.com/gateway.do?service=notify_verify&partner=#{Alipay.pid}¬ify_id=#{@notify_id}" + :get, "https://api-sea-global.alipayplus.com/gateway.do?service=notify_verify&partner=#{Alipay.pid}¬ify_id=#{@notify_id}" ).to_return(body: "true") assert Alipay::Wap::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}¬ify_id=#{@notify_id}" + :get, "https://api-sea-global.alipayplus.com/gateway.do?service=notify_verify&partner=#{Alipay.pid}¬ify_id=#{@notify_id}" ).to_return(body: "false") assert !Alipay::Wap::Notify.verify?(@sign_params) end