Skip to content

Commit

Permalink
fix: currency code fields
Browse files Browse the repository at this point in the history
  • Loading branch information
avlyalin committed Jul 27, 2020
1 parent bd9c79a commit 42bb17b
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion database/factories/GooglePayPaymentFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
'client_id' => Str::random(30),
'ip' => $faker->ipv6,
'amount' => $faker->numberBetween(),
'currency_code' => $faker->currencyCode,
'currency_code' => (string)$faker->numberBetween(100, 999),
'email' => $faker->email,
'phone' => $faker->phoneNumber,
'return_url' => $faker->url,
Expand Down
2 changes: 1 addition & 1 deletion database/factories/SamsungPayPaymentFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

declare(strict_types=1);

use Avlyalin\SberbankAcquiring\Models\AcquiringPayment;
use Avlyalin\SberbankAcquiring\Models\SamsungPayPayment;
use Illuminate\Support\Str;
use Faker\Generator as Faker;
Expand All @@ -17,5 +16,6 @@
'client_id' => Str::random(30),
'ip' => $faker->ipv6,
'payment_token' => Str::random(100),
'currency_code' => (string)$faker->numberBetween(100, 999),
];
});
2 changes: 1 addition & 1 deletion database/factories/SberbankPaymentFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
return [
'order_number' => Str::random(32),
'amount' => $faker->numberBetween(),
'currency' => $faker->currencyCode,
'currency' => $faker->numberBetween(100, 999),
'return_url' => $faker->url,
'fail_url' => $faker->url,
'description' => $faker->sentence,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public function up()
$table->string('client_id', 255)->nullable()->comment('Номер (идентификатор) клиента в системе продавца');
$table->string('ip', 39)->nullable()->comment('IP-адрес покупателя');
$table->text('payment_token')->comment('Токен, полученный от Samsung Pay');
$table->string('currency_code', 3)->nullable()->comment('Цифровой код валюты платежа ISO 4217');
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function up()
$table->string('client_id', 255)->nullable()->comment('Номер (идентификатор) клиента в системе продавца');
$table->string('ip', 39)->nullable()->comment('IP-адрес покупателя');
$table->unsignedBigInteger('amount')->unsigned()->comment('Сумма платежа в минимальных единицах валюты');
$table->unsignedSmallInteger('currency_code')->nullable()->comment('Цифровой код валюты платежа ISO 4217');
$table->string('currency_code')->nullable()->comment('Цифровой код валюты платежа ISO 4217');
$table->string('email')->nullable()->comment('Адрес электронной почты покупателя');
$table->string('phone')->nullable()->comment('Номер телефона покупателя');
$table->string('return_url', 512)->comment('Адрес для перехода в случае успешной оплаты');
Expand Down
2 changes: 2 additions & 0 deletions src/Models/SamsungPayPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class SamsungPayPayment extends BasePaymentModel implements HasPaymentTokenInter
'pre_auth',
'client_id',
'ip',
'currency_code',
];

protected $casts = [
Expand All @@ -41,5 +42,6 @@ class SamsungPayPayment extends BasePaymentModel implements HasPaymentTokenInter
'preAuth' => 'pre_auth',
'clientId' => 'client_id',
'ip' => 'ip',
'currencyCode' => 'currency_code',
];
}

0 comments on commit 42bb17b

Please sign in to comment.