VictoriaBankGateway
Ongoing release
판매자 시스템이 표준 CGI/WWW 양식 게시 방법을 사용하여 신용 카드 기반 전자 상거래 거래를 처리하는 데 사용하는 VictoriaBank(몰도바 공화국)의 인터페이스에 대한 액세스 권한을 PHP 기반 웹사이트에 제공하는 Packagist 패키지(라이브러리). 이 인터페이스는 3D 보안 및 보안 코드와 같은 다양한 카드 소지자 인증 프로토콜은 물론 기존의 인증되지 않은 SSL 상거래를 투명하게 지원합니다.
composer require fruitware/victoria-bank-gateway
작곡가 패키지 중 하나를 사용할 수 있습니다
composer require vlucas/phpdotenv
또는
composer require symfony/dotenv
.env 파일
# Merchant ID assigned by bank
VICTORIA_BANK_MERCHANT_ID =xxxxxxxxxxxxxxx
# Merchant Terminal ID assigned by bank
VICTORIA_BANK_MERCHANT_TERMINAL =xxxxxxxx
# Merchant primary web site URL
VICTORIA_BANK_MERCHANT_URL = ' http://example.com '
# Merchant name (recognizable by cardholder)
VICTORIA_BANK_MERCHANT_NAME = ' Merchant company name '
# Merchant company registered office address
VICTORIA_BANK_MERCHANT_ADDRESS = ' Merchant address '
# Security options - provided by the bank
VICTORIA_BANK_SECURITY_SIGNATURE_FIRST = ' 0001 '
VICTORIA_BANK_SECURITY_SIGNATURE_PREFIX = ' A00B00C00D00EA864886F70D020505000410 '
VICTORIA_BANK_SECURITY_SIGNATURE_PADDING = ' 00 '
# Merchant public rsa key
VICTORIA_BANK_MERCHANT_PUBLIC_KEY =public.pem
# Merchant private rsa key
VICTORIA_BANK_MERCHANT_PRIVATE_KEY =private.pem
# The public part of the bank key that P_SIGN is encrypted in the response in PEM format.
VICTORIA_BANK_MERCHANT_BANK_PUBLIC_KEY =victoria_pub.pem
# Default Merchant shop timezone
# Used to calculate the timezone offset sent to VictoriaBank
VICTORIA_BANK_MERCHANT_TIMEZONE_NAME = ' Europe/Chisinau '
# Merchant shop 2-character country code.
# Must be provided if merchant system is located
# in a country other than the gateway server's country.
VICTORIA_BANK_MERCHANT_COUNTRY_CODE =MD
# Default currency for all operations: 3-character currency code
VICTORIA_BANK_MERCHANT_DEFAULT_CURRENCY =MDL
# Default forms language
# By default are available forms in en, ro, ru.
# If need forms in another languages please contact gateway
# administrator
VICTORIA_BANK_MERCHANT_DEFAULT_LANGUAGE =ro
<?php
use Fruitware VictoriaBankGateway VictoriaBankGateway ;
$ VictoriaBankGateway = new VictoriaBankGateway ();
$ certDir = ' /path/to/cert/dir ' ;
$ VictoriaBankGateway
-> configureFromEnv ( $ certDir )
;
configureFromEnv() 메소드 구현을 재현할 수 있습니다.
<?php
use Fruitware VictoriaBankGateway VictoriaBankGateway ;
$ backRefUrl = getenv ( ' VICTORIA_BANK_MERCHANT_URL ' ). ' /after-payment/ ' ;
/** @var VictoriaBankGateway $ VictoriaBankGateway */
$ VictoriaBankGateway
-> requestAuthorization ( $ orderId = 1 , $ amount = 1 , $ backRefUrl , $ currency = null , $ description = null , $ clientEmail = null , $ language = null )
;
<?php
use Fruitware VictoriaBankGateway VictoriaBankGateway ;
use Fruitware VictoriaBankGateway VictoriaBank Exception ;
use Fruitware VictoriaBankGateway VictoriaBank Response ;
use Fruitware VictoriaBankGateway VictoriaBank AuthorizationResponse ;
/** @var VictoriaBankGateway $ VictoriaBankGateway */
$ bankResponse = $ VictoriaBankGateway -> getResponseObject ( $ _POST );
if (! $ bankResponse -> isValid ()) {
throw new Exception ( ' Invalid bank Auth response ' );
}
switch ( $ bankResponse :: TRX_TYPE ) {
case VictoriaBankGateway :: TRX_TYPE_AUTHORIZATION :
$ amount = $ bankResponse ->{Response:: AMOUNT };
$ bankOrderCode = $ bankResponse ->{Response:: ORDER };
$ rrn = $ bankResponse ->{Response:: RRN };
$ intRef = $ bankResponse ->{Response:: INT_REF };
#
# You must save $rrn and $intRef from the response here for reversal requests
#
# Funds locked on bank side - transfer the product/service to the customer and request completion
$ VictoriaBankGateway -> requestCompletion ( $ bankOrderCode , $ amount , $ rrn , $ intRef , $ currency = null );
break ;
case VictoriaBankGateway :: TRX_TYPE_COMPLETION :
# Funds successfully transferred on bank side
break ;
case VictoriaBankGateway :: TRX_TYPE_REVERSAL :
# Reversal successfully applied on bank size
break ;
default :
throw new Exception ( ' Unknown bank response transaction type ' );
}
$rrn
및 $intRef
4단계에서 저장되어야 합니다.
<?php
use Fruitware VictoriaBankGateway VictoriaBankGateway ;
/** @var VictoriaBankGateway $ VictoriaBankGateway */
$ VictoriaBankGateway
-> requestReversal ( $ orderId = 1 , $ amount = 1 , $ rrn = ' xxx ' , $ intRef = ' yyy ' , $ currency = null )
;
? Fruitware 팀 이 손수 제작한 사랑스러운 제품
기여, 문제 및 기능 요청을 환영합니다!
이슈 페이지를 확인해 보세요.
이 프로젝트가 도움이 되었는지 알려주세요!