Comments (5)
máximas de parcelas e quantos
Como você implementou?
Basicamente segui a forma de construção do XML no código, porém eu fiz de forma não genérica, pois fiz atendendo as necessidades do projeto por isso não abri PR para essa feature.
from laravel-pagseguro.
Descobri o que é necessário adicionar ao XML para conseguir fazer com que set a quantidade máximas de parcelas e quantos irei arcar com os juros
<paymentMethodConfigs>
<paymentMethodConfig>
<paymentMethod>
<group>CREDIT_CARD</group>
</paymentMethod>
<configs>
<config>
<key>MAX_INSTALLMENTS_NO_INTEREST</key>
<value>%s</value>
</config>
<config>
<key>MAX_INSTALLMENTS_LIMIT</key>
<value>%s</value>
</config>
</configs>
</paymentMethodConfig>
</paymentMethodConfigs>
from laravel-pagseguro.
máximas de parcelas e quantos
Como você implementou?
from laravel-pagseguro.
@thiivalente onde voce colocou esse xml?
from laravel-pagseguro.
@douglastehling você configura isso no PaymentMethod
, OBS: não esqueça do da interface.
/**
* Max Installments No Interest (Quantidade máxima de parcelas que não importam)
* @var float
*/
protected $maxInstallmentsNoInterest;
/**
* Get Max Installments Limit (Quantidade máxima de parcelas)
* @var float
*/
protected $maxInstallmentsLimit;
E também não esqueça de fazer os get e sets pro hydrate
/**
* Get Max Installments No Interest (Quantidade máxima de parcelas que não importam)
* @return float
*/
public function getMaxInstallmentsNoInterest()
{
return $this->maxInstallmentsNoInterest;
}
/**
* Get Max Installments Limit (Quantidade máxima de parcelas)
* @return float
*/
public function getMaxInstallmentsLimit()
{
return $this->maxInstallmentsLimit;
}
// ...
**
* Set Max Installments No Interest (Quantidade máxima de parcelas que não importam)
* @param float|null $method
* @return float
*/
public function setMaxInstallmentsNoInterest($maxInstallmentsNoInterest)
{
if(is_null($maxInstallmentsNoInterest)) {
return;
}
$this->maxInstallmentsNoInterest = $maxInstallmentsNoInterest;
return $this;
}
/**
* Set Max Installments No Interest (Quantidade máxima de parcelas que não importam)
* @param float|null $method
* @return float
*/
public function setMaxInstallmentsLimit($maxInstallmentsLimit)
{
if(is_null($maxInstallmentsLimit)) {
return;
}
$this->maxInstallmentsLimit = $maxInstallmentsLimit;
return $this;
}
No ValidationRules
coloque a validaçåo:
'maxInstallmentsNoInterest' => 'numeric|between:2,16|',
'maxInstallmentsLimit' => 'numeric|between:2,16|',
E por último, configurar dentro do XmlPaymentMethod
no método:
private function getPaymentMethodsXmlString(PaymentMethodInterface $paymentMethod)
{
// ...
$configs = [];
$hasConfigs = false;
if(!is_null($paymentMethod->getMaxInstallmentsNoInterest()) && $paymentMethod->getMaxInstallmentsNoInterest() > 1) {
$configs[] = $this->getInstallmentsNoInterestXmlString($paymentMethod->getMaxInstallmentsNoInterest());
$hasConfigs = true;
}
if(!is_null($paymentMethod->getMaxInstallmentsLimit())) {
$configs[] = $this->getMaxInstallmentsLimitXmlString($paymentMethod->getMaxInstallmentsNoInterest());
$hasConfigs = true;
}
// ..
}
**
* @param float $maxInstallmentsNoInterest
* @return string XML
*/
private function getInstallmentsNoInterestXmlString(float $maxInstallmentsNoInterest)
{
$str = <<<XML
<config>
<key>MAX_INSTALLMENTS_NO_INTEREST</key>
<value>%s</value>
</config>
XML;
return sprintf($str, $maxInstallmentsNoInterest);
}
/**
* @return string XML
*/
private function getMaxInstallmentsLimitXmlString(float $maxInstallmentsLimit)
{
$str = <<<XML
<config>
<key>MAX_INSTALLMENTS_LIMIT</key>
<value>%s</value>
</config>
XML;
return sprintf($str, $maxInstallmentsLimit);
}
from laravel-pagseguro.
Related Issues (20)
- Link fixo transiction
- Problemas com o Laravel 6
- "Unsupported type:preapproval" para IPN de pagamentos recorrentes
- Compra sem telefone informado HOT 1
- Quantidade máxima de pagamento recorrente
- Your configuration files are not serializable.
- alguem sabe fazer um plugins para bagisto - laravel ecommerce
- Preciso de um help. Funcionamento diferente no geração do código da transação!!
- Erro de Credenciais em Sistemas MarketPlace
- Checkout send failure HOT 12
- Como definir uma referência por código do contrato/produto? HOT 2
- Sua sessão expirou PagSeguro HOT 1
- Problemas no callback de notification HOT 6
- Atualização de Métodos de Pagement ( PIX ) HOT 4
- Notificação da Assinatura
- Error on send: 400
- Erro de "Checkout send failure" HOT 4
- Está implementado Checkout transparent?
- Diversos problemas ao criar um plano.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-pagseguro.