Skip to content

Parameter names doesn't conform to Omnipay standard #192

@aimeos

Description

@aimeos

The used parameter names are not conforming to the Omnipay standard.
Current:

$order = [
    'subject'      => 'The test order',
    'out_trade_no' => date('YmdHis') . mt_rand(1000, 9999),
    'total_amount' => '0.01',
    'product_code' => 'FAST_INSTANT_TRADE_PAY',
];

Official parameter names:

$order = [
    'description'              => 'The test order',
    'transactionId'      => date('YmdHis').mt_rand(1000, 9999),
    'amount'         => '0.01',
    'clientIp'  => 'ip_address',
    'currency'          => 'CNY',
    'language'         => 'zh'
];

This causes the driver not to work in applications implementing the Omnipay standard parameter names if no special handling is applied to convert the parameter names.

Furthermore, require to call the setBizContent() method is custom to the driver and will also don't work. Instead, the data must be passed to the purchase method.

$response = $gateway->purchase([
    'description'              => 'The test order',
    'transactionId'      => date('YmdHis').mt_rand(1000, 9999),
    'amount'         => '0.01',
    'clientIp'  => 'ip_address',
    'currency'          => 'CNY',
    'language'         => 'zh'
])->send();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions