Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameter names doesn't conform to Omnipay standard #192

Open
aimeos opened this issue Jan 18, 2022 · 0 comments
Open

Parameter names doesn't conform to Omnipay standard #192

aimeos opened this issue Jan 18, 2022 · 0 comments

Comments

@aimeos
Copy link

aimeos commented Jan 18, 2022

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();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant