示例#1
0
    async def test_charge_close_dispute(self):
        charge = aiostripe.Charge(id='ch_update_id')

        await charge.close_dispute(idempotency_key='foo')

        self.requestor_mock.request.assert_called_with(
            'post', '/v1/charges/ch_update_id/dispute/close', {},
            {'Idempotency-Key': 'foo'})
示例#2
0
    async def test_noop_metadata(self):
        charge = aiostripe.Charge(id='ch_foo')
        charge.description = 'test'

        await charge.save()

        self.requestor_mock.request.assert_called_with(
            'post', '/v1/charges/ch_foo', {
                'description': 'test',
            }, None)
示例#3
0
    async def test_unset_metadata(self):
        charge = aiostripe.Charge(id='ch_foo')
        charge.metadata = {}

        await charge.save()

        self.requestor_mock.request.assert_called_with('post',
                                                       '/v1/charges/ch_foo', {
                                                           'metadata': {},
                                                       }, None)
示例#4
0
    async def test_mark_as_safe(self):
        charge = aiostripe.Charge(id='ch_update_id')

        await charge.mark_as_safe(idempotency_key='foo')

        self.requestor_mock.request.assert_called_with(
            'post', '/v1/charges/ch_update_id',
            {'fraud_details': {
                'user_report': 'safe'
            }}, {'Idempotency-Key': 'foo'})
示例#5
0
    async def test_individual_delete(self):
        charge = aiostripe.Charge(id='ch_foo')
        charge.metadata = {'whole': None}
        await charge.save()

        self.requestor_mock.request.assert_called_with('post',
                                                       '/v1/charges/ch_foo', {
                                                           'metadata': {
                                                               'whole': None
                                                           },
                                                       }, None)